just-bash 3.4.2 → 3.6.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 +242 -0
- package/README.md +22 -9
- package/dist/AGENTS.md +58 -2
- package/dist/Bash.d.ts +4 -2
- package/dist/abort-signals.d.ts +10 -0
- package/dist/bin/chunks/awk2-U22OR5B5.js +3 -0
- package/dist/bin/{shell/chunks/base64-FLJ4YPHB.js → chunks/base64-2KKH5BCT.js} +1 -1
- package/dist/bin/chunks/{cat-2J5MA5PY.js → cat-V45MVNBT.js} +1 -1
- package/dist/bin/{shell/chunks/chmod-ZM5WLMZI.js → chunks/chmod-A54R4UUQ.js} +1 -1
- package/dist/bin/chunks/chunk-2NJJXU4K.js +27 -0
- package/dist/bin/{shell/chunks/chunk-BJRT4VKD.js → chunks/chunk-3LKMI5IX.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-4APSDE57.js → chunks/chunk-44SKMHU6.js} +1 -1
- package/dist/bin/chunks/{chunk-GRP7L2EL.js → chunk-6DAR25KN.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-VGR3NA3H.js → chunks/chunk-723HNGID.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-MRPJL3ZK.js → chunks/chunk-7X4QBCFW.js} +1 -1
- package/dist/bin/chunks/{chunk-42AMF6EE.js → chunk-ABM5WFEO.js} +1 -1
- package/dist/bin/chunks/{chunk-2HFDEZUY.js → chunk-AINNAQBQ.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-BPWZ7ADB.js → chunks/chunk-AL7RVSF4.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-MHAGHCSO.js → chunks/chunk-ARYCSNJJ.js} +7 -7
- package/dist/bin/{shell/chunks/chunk-2INNLNI5.js → chunks/chunk-BJF6B4YW.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-BZWGVRFA.js → chunks/chunk-BOXG6XBN.js} +2 -2
- package/dist/bin/chunks/chunk-DA3RFNKK.js +17 -0
- package/dist/bin/chunks/chunk-DH7M46D3.js +20 -0
- package/dist/bin/chunks/{chunk-2ND6MMXN.js → chunk-DTGQQKI2.js} +1 -1
- package/dist/bin/chunks/{chunk-YOIFOOGX.js → chunk-ECZAFQ22.js} +1 -1
- package/dist/bin/chunks/{chunk-PPVF2N6C.js → chunk-EFS34UUR.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-TW2IJRUF.js → chunks/chunk-ENEHPI32.js} +1 -1
- package/dist/bin/chunks/chunk-HFW2LXQV.js +13 -0
- package/dist/bin/{shell/chunks/chunk-UHNV55NF.js → chunks/chunk-HRKG3ZK2.js} +1 -1
- package/dist/bin/chunks/{chunk-74TZ7ZF7.js → chunk-IKUY74NG.js} +1 -1
- package/dist/bin/chunks/chunk-ILXMFIYG.js +7 -0
- package/dist/bin/chunks/chunk-IMVXTSPG.js +275 -0
- package/dist/bin/chunks/chunk-J5L5DJWL.js +3 -0
- package/dist/bin/{shell/chunks/chunk-MF3GVFLC.js → chunks/chunk-JKS7WXGR.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-XBX7KFWK.js → chunks/chunk-LG6IN6SW.js} +11 -11
- package/dist/bin/chunks/chunk-LMFAALLO.js +21 -0
- package/dist/bin/{shell/chunks/chunk-DYIBFLS3.js → chunks/chunk-LOU52GPJ.js} +2 -2
- package/dist/bin/chunks/{chunk-FB44CW33.js → chunk-M5ZBECGM.js} +1 -1
- package/dist/bin/chunks/chunk-MA6BMA4M.js +3 -0
- package/dist/bin/chunks/{chunk-Z7QCL4IA.js → chunk-MPQMTLXN.js} +1 -1
- package/dist/bin/chunks/{chunk-TIHFGNPS.js → chunk-MUIYG2RB.js} +1 -1
- package/dist/bin/chunks/{chunk-PUZGSIMN.js → chunk-NGMFI3RH.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-RYQB6GQ7.js → chunks/chunk-NLMTGTSG.js} +1 -1
- package/dist/bin/chunks/{chunk-QAYU7HPM.js → chunk-OBVTFHVP.js} +1 -1
- package/dist/bin/chunks/{chunk-MNSMZU47.js → chunk-OOKVPG5D.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-O2BCKSMK.js → chunks/chunk-PEJXCXSY.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-MYEPQX6Y.js → chunks/chunk-PL4EU7Y2.js} +1 -1
- package/dist/bin/chunks/{chunk-QFTZKD5O.js → chunk-QCGH2ZOW.js} +1 -1
- package/dist/bin/chunks/chunk-QKWMWSV3.js +3 -0
- package/dist/bin/{shell/chunks/chunk-ISOWCECJ.js → chunks/chunk-S5Z7DMIE.js} +10 -10
- package/dist/bin/{shell/chunks/chunk-OLEQNRKX.js → chunks/chunk-SQ7SZZMW.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-44MQ5AXA.js → chunks/chunk-SQUH76NP.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-BOYPCOSV.js → chunks/chunk-TGRZ42DS.js} +1 -1
- package/dist/bin/chunks/{chunk-LUHU7UUN.js → chunk-THTKNRO6.js} +1 -1
- package/dist/bin/chunks/{chunk-VKTV45AP.js → chunk-TQXLQEIT.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-2OQ5HPZE.js → chunks/chunk-U6BXPMLD.js} +1 -1
- package/dist/bin/chunks/chunk-U6DBRMD5.js +5 -0
- package/dist/bin/{shell/chunks/chunk-CC2AQ6B7.js → chunks/chunk-U6JTVQU6.js} +1 -1
- package/dist/bin/chunks/chunk-UPUFWGHR.js +3 -0
- package/dist/bin/chunks/{chunk-E5VZGTZ6.js → chunk-URRH3GPG.js} +1 -1
- package/dist/bin/chunks/{chunk-EXGPMLIE.js → chunk-VBU3UEG5.js} +1 -1
- package/dist/bin/chunks/chunk-VGSRQOLD.js +7 -0
- package/dist/bin/chunks/{chunk-GTULZ3ZD.js → chunk-WBST7XJW.js} +1 -1
- package/dist/bin/chunks/{chunk-ROFYAVPF.js → chunk-WEQ5WM2M.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-BCQSUELK.js → chunks/chunk-WZ7MIBLR.js} +1 -1
- package/dist/bin/chunks/{chunk-H4BRFPKY.js → chunk-X45GP3AQ.js} +1 -1
- package/dist/bin/chunks/chunk-YQEKKZTU.js +12 -0
- package/dist/bin/chunks/{chunk-UNKX6YM6.js → chunk-Z3KAV6YJ.js} +1 -1
- package/dist/bin/chunks/{chunk-3SCW7PD5.js → chunk-Z5KICK5X.js} +1 -1
- package/dist/bin/chunks/{column-7VBJL757.js → column-LHHS4D3K.js} +1 -1
- package/dist/bin/{shell/chunks/cp-MF5GADQN.js → chunks/cp-HPLQA35N.js} +1 -1
- package/dist/bin/chunks/curl-FIRG3RB6.js +31 -0
- package/dist/bin/chunks/{cut-QOTYBJJJ.js → cut-KP3S36XS.js} +1 -1
- package/dist/bin/{shell/chunks/diff-YXZZCUSQ.js → chunks/diff-JSJ56EOK.js} +1 -1
- package/dist/bin/chunks/dist-4NZ74CRE.js +141 -0
- package/dist/bin/chunks/{du-A3UGHIKJ.js → du-WEF5YWQK.js} +1 -1
- package/dist/bin/chunks/{expr-TDF3B6QJ.js → expr-FLWT4OCO.js} +1 -1
- package/dist/bin/chunks/{file-AJGG7RYT.js → file-JLUCGBCB.js} +1 -1
- package/dist/bin/chunks/{find-6DH6TRDN.js → find-XGVQ6N6L.js} +1 -1
- package/dist/bin/chunks/flag-coverage-4JYKIAVV.js +3 -0
- package/dist/bin/chunks/{grep-WUZMZDGY.js → grep-DCPCPQOS.js} +1 -1
- package/dist/bin/chunks/{gzip-JA7JQBUS.js → gzip-6DZIKNBW.js} +1 -1
- package/dist/bin/{shell/chunks/head-YGKW3HS4.js → chunks/head-TLFXMM2T.js} +1 -1
- package/dist/bin/{shell/chunks/help-HVIDHJ6M.js → chunks/help-EXVKU23F.js} +1 -1
- package/dist/bin/chunks/{html-to-markdown-ZWL7LZIP.js → html-to-markdown-E22RLT2U.js} +1 -1
- package/dist/bin/chunks/{jq-5MI4V3G5.js → jq-GDM3OBBK.js} +1 -1
- package/dist/bin/chunks/js-exec-VU6F6WLS.js +1578 -0
- package/dist/bin/chunks/{ln-XSDIE6SU.js → ln-B35EKC2Q.js} +1 -1
- package/dist/bin/chunks/{ls-R6DAGGBH.js → ls-67NUUIYT.js} +1 -1
- package/dist/bin/chunks/{mkdir-74BP5NTG.js → mkdir-AWDWRBKC.js} +1 -1
- package/dist/bin/chunks/mktemp-L6OGMDUO.js +3 -0
- package/dist/bin/chunks/{mv-YG75IRRE.js → mv-4BJSOT4Y.js} +1 -1
- package/dist/bin/{shell/chunks/od-YCY27MMO.js → chunks/od-SI75GLRE.js} +1 -1
- package/dist/bin/chunks/{paste-ACKOG3XS.js → paste-5TSIBDF7.js} +1 -1
- package/dist/bin/chunks/python3-GUWCSSDP.js +23 -0
- package/dist/bin/{shell/chunks/readlink-HMHVGSAM.js → chunks/readlink-URO5XTBB.js} +1 -1
- package/dist/bin/{shell/chunks/rg-A3E7YM2A.js → chunks/rg-RVULUPDH.js} +1 -1
- package/dist/bin/{shell/chunks/rm-3PLW4O4B.js → chunks/rm-UCUTHC3I.js} +1 -1
- package/dist/bin/chunks/{rmdir-DCJ3XJRR.js → rmdir-J3HM7GGM.js} +1 -1
- package/dist/bin/{shell/chunks/sed-KJWKB22J.js → chunks/sed-MCLGHZOI.js} +1 -1
- package/dist/bin/chunks/{seq-Q4LZ6EXV.js → seq-I54NZE75.js} +1 -1
- package/dist/bin/{shell/chunks/sleep-DVFE2GSF.js → chunks/sleep-CV6B4M6W.js} +1 -1
- package/dist/bin/chunks/{split-XMXBXL5Q.js → split-VZO7223N.js} +1 -1
- package/dist/bin/chunks/{sqlite3-DNH2VLVN.js → sqlite3-HXVFVP4Z.js} +1 -1
- package/dist/bin/chunks/sqlite3-worker.js +75 -11
- package/dist/bin/chunks/{stat-5PUSTPTK.js → stat-UJ37RBMM.js} +1 -1
- package/dist/bin/chunks/{tail-4MB7HHIZ.js → tail-5TSF5YM4.js} +1 -1
- package/dist/bin/{shell/chunks/tar-FRDUJZDN.js → chunks/tar-ZGZZDQXO.js} +1 -1
- package/dist/bin/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
- package/dist/bin/chunks/timeout-ATTDYXLX.js +3 -0
- package/dist/bin/chunks/{tr-Z6N34HZM.js → tr-6RPFASYV.js} +1 -1
- package/dist/bin/chunks/worker.js +88 -15
- package/dist/bin/chunks/{xan-VSF6ZQGZ.js → xan-CCS53B7D.js} +1 -1
- package/dist/bin/chunks/{xan-view-UEFBHYVN.js → xan-view-KOXASOEV.js} +1 -1
- package/dist/bin/chunks/yes-ELH3XQWY.js +3 -0
- package/dist/bin/chunks/yq-GSCDUHGM.js +3 -0
- package/dist/bin/just-bash.js +333 -328
- package/dist/bin/shell/chunks/awk2-U22OR5B5.js +3 -0
- package/dist/bin/{chunks/base64-FLJ4YPHB.js → shell/chunks/base64-2KKH5BCT.js} +1 -1
- package/dist/bin/shell/chunks/{cat-2J5MA5PY.js → cat-V45MVNBT.js} +1 -1
- package/dist/bin/{chunks/chmod-ZM5WLMZI.js → shell/chunks/chmod-A54R4UUQ.js} +1 -1
- package/dist/bin/shell/chunks/chunk-2NJJXU4K.js +27 -0
- package/dist/bin/{chunks/chunk-BJRT4VKD.js → shell/chunks/chunk-3LKMI5IX.js} +1 -1
- package/dist/bin/{chunks/chunk-4APSDE57.js → shell/chunks/chunk-44SKMHU6.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-GRP7L2EL.js → chunk-6DAR25KN.js} +1 -1
- package/dist/bin/{chunks/chunk-VGR3NA3H.js → shell/chunks/chunk-723HNGID.js} +1 -1
- package/dist/bin/{chunks/chunk-MRPJL3ZK.js → shell/chunks/chunk-7X4QBCFW.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-42AMF6EE.js → chunk-ABM5WFEO.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-2HFDEZUY.js → chunk-AINNAQBQ.js} +1 -1
- package/dist/bin/{chunks/chunk-BPWZ7ADB.js → shell/chunks/chunk-AL7RVSF4.js} +1 -1
- package/dist/bin/{chunks/chunk-MHAGHCSO.js → shell/chunks/chunk-ARYCSNJJ.js} +7 -7
- package/dist/bin/{chunks/chunk-2INNLNI5.js → shell/chunks/chunk-BJF6B4YW.js} +1 -1
- package/dist/bin/{chunks/chunk-BZWGVRFA.js → shell/chunks/chunk-BOXG6XBN.js} +2 -2
- package/dist/bin/shell/chunks/chunk-DA3RFNKK.js +17 -0
- package/dist/bin/shell/chunks/chunk-DH7M46D3.js +20 -0
- package/dist/bin/shell/chunks/{chunk-2ND6MMXN.js → chunk-DTGQQKI2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-YOIFOOGX.js → chunk-ECZAFQ22.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-PPVF2N6C.js → chunk-EFS34UUR.js} +1 -1
- package/dist/bin/{chunks/chunk-TW2IJRUF.js → shell/chunks/chunk-ENEHPI32.js} +1 -1
- package/dist/bin/shell/chunks/chunk-HFW2LXQV.js +13 -0
- package/dist/bin/{chunks/chunk-UHNV55NF.js → shell/chunks/chunk-HRKG3ZK2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-74TZ7ZF7.js → chunk-IKUY74NG.js} +1 -1
- package/dist/bin/shell/chunks/chunk-ILXMFIYG.js +7 -0
- package/dist/bin/shell/chunks/chunk-IMVXTSPG.js +275 -0
- package/dist/bin/shell/chunks/chunk-J5L5DJWL.js +3 -0
- package/dist/bin/{chunks/chunk-MF3GVFLC.js → shell/chunks/chunk-JKS7WXGR.js} +1 -1
- package/dist/bin/{chunks/chunk-XBX7KFWK.js → shell/chunks/chunk-LG6IN6SW.js} +11 -11
- package/dist/bin/shell/chunks/chunk-LMFAALLO.js +21 -0
- package/dist/bin/{chunks/chunk-DYIBFLS3.js → shell/chunks/chunk-LOU52GPJ.js} +2 -2
- package/dist/bin/shell/chunks/{chunk-FB44CW33.js → chunk-M5ZBECGM.js} +1 -1
- package/dist/bin/shell/chunks/chunk-MA6BMA4M.js +3 -0
- package/dist/bin/shell/chunks/{chunk-Z7QCL4IA.js → chunk-MPQMTLXN.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-TIHFGNPS.js → chunk-MUIYG2RB.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-PUZGSIMN.js → chunk-NGMFI3RH.js} +1 -1
- package/dist/bin/{chunks/chunk-RYQB6GQ7.js → shell/chunks/chunk-NLMTGTSG.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-QAYU7HPM.js → chunk-OBVTFHVP.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-MNSMZU47.js → chunk-OOKVPG5D.js} +1 -1
- package/dist/bin/{chunks/chunk-O2BCKSMK.js → shell/chunks/chunk-PEJXCXSY.js} +1 -1
- package/dist/bin/{chunks/chunk-MYEPQX6Y.js → shell/chunks/chunk-PL4EU7Y2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-QFTZKD5O.js → chunk-QCGH2ZOW.js} +1 -1
- package/dist/bin/shell/chunks/chunk-QKWMWSV3.js +3 -0
- package/dist/bin/{chunks/chunk-ISOWCECJ.js → shell/chunks/chunk-S5Z7DMIE.js} +10 -10
- package/dist/bin/{chunks/chunk-OLEQNRKX.js → shell/chunks/chunk-SQ7SZZMW.js} +1 -1
- package/dist/bin/{chunks/chunk-44MQ5AXA.js → shell/chunks/chunk-SQUH76NP.js} +1 -1
- package/dist/bin/{chunks/chunk-BOYPCOSV.js → shell/chunks/chunk-TGRZ42DS.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-LUHU7UUN.js → chunk-THTKNRO6.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-VKTV45AP.js → chunk-TQXLQEIT.js} +1 -1
- package/dist/bin/{chunks/chunk-2OQ5HPZE.js → shell/chunks/chunk-U6BXPMLD.js} +1 -1
- package/dist/bin/shell/chunks/chunk-U6DBRMD5.js +5 -0
- package/dist/bin/{chunks/chunk-CC2AQ6B7.js → shell/chunks/chunk-U6JTVQU6.js} +1 -1
- package/dist/bin/shell/chunks/chunk-UPUFWGHR.js +3 -0
- package/dist/bin/shell/chunks/{chunk-E5VZGTZ6.js → chunk-URRH3GPG.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-EXGPMLIE.js → chunk-VBU3UEG5.js} +1 -1
- package/dist/bin/shell/chunks/chunk-VGSRQOLD.js +7 -0
- package/dist/bin/shell/chunks/{chunk-GTULZ3ZD.js → chunk-WBST7XJW.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-ROFYAVPF.js → chunk-WEQ5WM2M.js} +1 -1
- package/dist/bin/{chunks/chunk-BCQSUELK.js → shell/chunks/chunk-WZ7MIBLR.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-H4BRFPKY.js → chunk-X45GP3AQ.js} +1 -1
- package/dist/bin/shell/chunks/chunk-YQEKKZTU.js +12 -0
- package/dist/bin/shell/chunks/{chunk-UNKX6YM6.js → chunk-Z3KAV6YJ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-3SCW7PD5.js → chunk-Z5KICK5X.js} +1 -1
- package/dist/bin/shell/chunks/{column-7VBJL757.js → column-LHHS4D3K.js} +1 -1
- package/dist/bin/{chunks/cp-MF5GADQN.js → shell/chunks/cp-HPLQA35N.js} +1 -1
- package/dist/bin/shell/chunks/curl-FIRG3RB6.js +31 -0
- package/dist/bin/shell/chunks/{cut-QOTYBJJJ.js → cut-KP3S36XS.js} +1 -1
- package/dist/bin/{chunks/diff-YXZZCUSQ.js → shell/chunks/diff-JSJ56EOK.js} +1 -1
- package/dist/bin/shell/chunks/dist-4NZ74CRE.js +141 -0
- package/dist/bin/shell/chunks/{du-A3UGHIKJ.js → du-WEF5YWQK.js} +1 -1
- package/dist/bin/shell/chunks/{expr-TDF3B6QJ.js → expr-FLWT4OCO.js} +1 -1
- package/dist/bin/shell/chunks/{file-AJGG7RYT.js → file-JLUCGBCB.js} +1 -1
- package/dist/bin/shell/chunks/{find-6DH6TRDN.js → find-XGVQ6N6L.js} +1 -1
- package/dist/bin/shell/chunks/flag-coverage-4JYKIAVV.js +3 -0
- package/dist/bin/shell/chunks/{grep-WUZMZDGY.js → grep-DCPCPQOS.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-JA7JQBUS.js → gzip-6DZIKNBW.js} +1 -1
- package/dist/bin/{chunks/head-YGKW3HS4.js → shell/chunks/head-TLFXMM2T.js} +1 -1
- package/dist/bin/{chunks/help-HVIDHJ6M.js → shell/chunks/help-EXVKU23F.js} +1 -1
- package/dist/bin/shell/chunks/{html-to-markdown-ZWL7LZIP.js → html-to-markdown-E22RLT2U.js} +1 -1
- package/dist/bin/shell/chunks/{jq-5MI4V3G5.js → jq-GDM3OBBK.js} +1 -1
- package/dist/bin/shell/chunks/js-exec-VU6F6WLS.js +1578 -0
- package/dist/bin/shell/chunks/{ln-XSDIE6SU.js → ln-B35EKC2Q.js} +1 -1
- package/dist/bin/shell/chunks/{ls-R6DAGGBH.js → ls-67NUUIYT.js} +1 -1
- package/dist/bin/shell/chunks/{mkdir-74BP5NTG.js → mkdir-AWDWRBKC.js} +1 -1
- package/dist/bin/shell/chunks/mktemp-L6OGMDUO.js +3 -0
- package/dist/bin/shell/chunks/{mv-YG75IRRE.js → mv-4BJSOT4Y.js} +1 -1
- package/dist/bin/{chunks/od-YCY27MMO.js → shell/chunks/od-SI75GLRE.js} +1 -1
- package/dist/bin/shell/chunks/{paste-ACKOG3XS.js → paste-5TSIBDF7.js} +1 -1
- package/dist/bin/shell/chunks/python3-GUWCSSDP.js +23 -0
- package/dist/bin/{chunks/readlink-HMHVGSAM.js → shell/chunks/readlink-URO5XTBB.js} +1 -1
- package/dist/bin/{chunks/rg-A3E7YM2A.js → shell/chunks/rg-RVULUPDH.js} +1 -1
- package/dist/bin/{chunks/rm-3PLW4O4B.js → shell/chunks/rm-UCUTHC3I.js} +1 -1
- package/dist/bin/shell/chunks/{rmdir-DCJ3XJRR.js → rmdir-J3HM7GGM.js} +1 -1
- package/dist/bin/{chunks/sed-KJWKB22J.js → shell/chunks/sed-MCLGHZOI.js} +1 -1
- package/dist/bin/shell/chunks/{seq-Q4LZ6EXV.js → seq-I54NZE75.js} +1 -1
- package/dist/bin/{chunks/sleep-DVFE2GSF.js → shell/chunks/sleep-CV6B4M6W.js} +1 -1
- package/dist/bin/shell/chunks/{split-XMXBXL5Q.js → split-VZO7223N.js} +1 -1
- package/dist/bin/shell/chunks/{sqlite3-DNH2VLVN.js → sqlite3-HXVFVP4Z.js} +1 -1
- package/dist/bin/shell/chunks/{stat-5PUSTPTK.js → stat-UJ37RBMM.js} +1 -1
- package/dist/bin/shell/chunks/{tail-4MB7HHIZ.js → tail-5TSF5YM4.js} +1 -1
- package/dist/bin/{chunks/tar-FRDUJZDN.js → shell/chunks/tar-ZGZZDQXO.js} +1 -1
- package/dist/bin/shell/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
- package/dist/bin/shell/chunks/timeout-ATTDYXLX.js +3 -0
- package/dist/bin/shell/chunks/{tr-Z6N34HZM.js → tr-6RPFASYV.js} +1 -1
- package/dist/bin/shell/chunks/{xan-VSF6ZQGZ.js → xan-CCS53B7D.js} +1 -1
- package/dist/bin/shell/chunks/{xan-view-UEFBHYVN.js → xan-view-KOXASOEV.js} +1 -1
- package/dist/bin/shell/chunks/yes-ELH3XQWY.js +3 -0
- package/dist/bin/shell/chunks/yq-GSCDUHGM.js +3 -0
- package/dist/bin/shell/shell.js +334 -329
- package/dist/browser.d.ts +1 -1
- package/dist/bundle/browser.js +866 -836
- package/dist/bundle/chunks/awk2-V7KYQWCD.js +2 -0
- package/dist/bundle/chunks/{base64-2BAITDZF.js → base64-QPSYZAAJ.js} +1 -1
- package/dist/bundle/chunks/{cat-33KGN4MZ.js → cat-54BXBS6X.js} +1 -1
- package/dist/bundle/chunks/{chmod-APOXUPXW.js → chmod-4OPV4QKK.js} +1 -1
- package/dist/bundle/chunks/{chunk-IBRT3OJS.js → chunk-2WBUTDF5.js} +1 -1
- package/dist/bundle/chunks/{chunk-WNH3HOQA.js → chunk-353VO5TF.js} +1 -1
- package/dist/bundle/chunks/chunk-3HDTNUL3.js +6 -0
- package/dist/bundle/chunks/{chunk-XV2V56NQ.js → chunk-3KWM4FFA.js} +1 -1
- package/dist/bundle/chunks/{chunk-WXPNKIIH.js → chunk-43OP7DFL.js} +1 -1
- package/dist/bundle/chunks/{chunk-DMWNBCXJ.js → chunk-4GEHRJMD.js} +1 -1
- package/dist/bundle/chunks/{chunk-3CBCABOZ.js → chunk-4IMUNIUJ.js} +1 -1
- package/dist/bundle/chunks/chunk-5BMPT6SF.js +19 -0
- package/dist/bundle/chunks/{chunk-XPDOK3XY.js → chunk-5QWGR2WA.js} +1 -1
- package/dist/bundle/chunks/{chunk-X3TZEFQG.js → chunk-5UTZMNI5.js} +1 -1
- package/dist/bundle/chunks/{chunk-QPZVR6ZN.js → chunk-65LVAUWW.js} +1 -1
- package/dist/bundle/chunks/{chunk-YDR2IWKO.js → chunk-72JHTO7E.js} +1 -1
- package/dist/bundle/chunks/{chunk-KVG5FR5F.js → chunk-7GA3QWJJ.js} +11 -11
- package/dist/bundle/chunks/{chunk-ICQYTW7W.js → chunk-7M672HB6.js} +1 -1
- package/dist/bundle/chunks/chunk-B6OSJB22.js +26 -0
- package/dist/bundle/chunks/{chunk-N3FZSEG7.js → chunk-BM3X75NC.js} +1 -1
- package/dist/bundle/chunks/chunk-CBM6J4AL.js +6 -0
- package/dist/bundle/chunks/{chunk-FNEG7DFQ.js → chunk-CGI6V2HW.js} +1 -1
- package/dist/bundle/chunks/{chunk-BKUWXPEM.js → chunk-CHWP6GRK.js} +1 -1
- package/dist/bundle/chunks/{chunk-UL6YJ7FT.js → chunk-D5ZJISRS.js} +1 -1
- package/dist/bundle/chunks/{chunk-TUNYNC46.js → chunk-DIRWTBKE.js} +1 -1
- package/dist/bundle/chunks/chunk-DIWMSSQY.js +2 -0
- package/dist/bundle/chunks/{chunk-273265WK.js → chunk-DPZVOEUP.js} +1 -1
- package/dist/bundle/chunks/chunk-EGTVQWAP.js +20 -0
- package/dist/bundle/chunks/{chunk-SI5VPVOA.js → chunk-EXXOLIVE.js} +1 -1
- package/dist/bundle/chunks/chunk-GLAFXDZC.js +4 -0
- package/dist/bundle/chunks/{chunk-PMYUC5JF.js → chunk-H42OAUJL.js} +1 -1
- package/dist/bundle/chunks/chunk-H53EPEGD.js +12 -0
- package/dist/bundle/chunks/{chunk-QE275OWT.js → chunk-HDOXCDVK.js} +1 -1
- package/dist/bundle/chunks/{chunk-USNDURQI.js → chunk-HIQEVPXM.js} +1 -1
- package/dist/bundle/chunks/{chunk-G4SEENI7.js → chunk-M4LDT7V7.js} +1 -1
- package/dist/bundle/chunks/{chunk-MHY57JTL.js → chunk-MDE25PQK.js} +1 -1
- package/dist/bundle/chunks/{chunk-Q6JV5CBB.js → chunk-MHDZERK4.js} +1 -1
- package/dist/bundle/chunks/{chunk-5ELNHAAJ.js → chunk-MHZF23KB.js} +1 -1
- package/dist/bundle/chunks/{chunk-LPJEKUCB.js → chunk-N6W6FM4N.js} +1 -1
- package/dist/bundle/chunks/{chunk-POIWRLUV.js → chunk-NRLE7KYI.js} +1 -1
- package/dist/bundle/chunks/{chunk-MQKGGNPS.js → chunk-NXBUT5V2.js} +2 -2
- package/dist/bundle/chunks/{chunk-4HMWZAP7.js → chunk-OB46N7Q7.js} +1 -1
- package/dist/bundle/chunks/{chunk-ALOFNPKY.js → chunk-PPHGMG47.js} +2 -2
- package/dist/bundle/chunks/{chunk-UXHSH7BM.js → chunk-R6ZGLVXI.js} +1 -1
- package/dist/bundle/chunks/chunk-RCRHDT54.js +274 -0
- package/dist/bundle/chunks/{chunk-N4TGZ6H7.js → chunk-RIIUVFUS.js} +1 -1
- package/dist/bundle/chunks/chunk-RK2WBVP4.js +2 -0
- package/dist/bundle/chunks/{chunk-MLIO3BK2.js → chunk-SQX6WQXB.js} +1 -1
- package/dist/bundle/chunks/chunk-SRB6FXRH.js +2 -0
- package/dist/bundle/chunks/{chunk-7IFSXTCJ.js → chunk-T4INBNHX.js} +1 -1
- package/dist/bundle/chunks/{chunk-TVJ6JVK4.js → chunk-TUQG2YRH.js} +1 -1
- package/dist/bundle/chunks/{chunk-JA6EY7US.js → chunk-U7UNEMLJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-GVKYQN5J.js → chunk-UK2K3DHN.js} +1 -1
- package/dist/bundle/chunks/{chunk-HW6ZCMM5.js → chunk-VDJ53ESK.js} +1 -1
- package/dist/bundle/chunks/{chunk-WHHRIZS3.js → chunk-VGCXKMXN.js} +1 -1
- package/dist/bundle/chunks/chunk-VOQZ5TSL.js +2 -0
- package/dist/bundle/chunks/{chunk-R2FBRMDU.js → chunk-VWUMR4IC.js} +1 -1
- package/dist/bundle/chunks/chunk-W2Z6LYL6.js +11 -0
- package/dist/bundle/chunks/{chunk-CFBEDNHJ.js → chunk-W5J5ADJF.js} +7 -7
- package/dist/bundle/chunks/{chunk-V2SOLEQN.js → chunk-XHFP44Y4.js} +1 -1
- package/dist/bundle/chunks/{chunk-KIGPB52X.js → chunk-XZ34OGNM.js} +1 -1
- package/dist/bundle/chunks/{chunk-A3D7NRT6.js → chunk-Y32R7EZP.js} +10 -10
- package/dist/bundle/chunks/chunk-YUFU7O6I.js +16 -0
- package/dist/bundle/chunks/{chunk-MFGH46GH.js → chunk-YZH7FUSY.js} +1 -1
- package/dist/bundle/chunks/{column-LKMDIDCH.js → column-F5JDBRV6.js} +1 -1
- package/dist/bundle/chunks/{cp-FKTQRFYJ.js → cp-LTFB4EUA.js} +1 -1
- package/dist/bundle/chunks/curl-XCX2ZQEA.js +30 -0
- package/dist/bundle/chunks/{cut-RWPUW5FY.js → cut-IRSHL3BB.js} +1 -1
- package/dist/bundle/chunks/{diff-CSARC7WF.js → diff-VDB6RXHO.js} +1 -1
- package/dist/bundle/chunks/{du-PR3M44X6.js → du-DOWSRLXR.js} +1 -1
- package/dist/bundle/chunks/{expr-UMT2OHZ7.js → expr-GZ4DABKB.js} +1 -1
- package/dist/bundle/chunks/{file-VEGKTTSF.js → file-UI6QJAAU.js} +1 -1
- package/dist/bundle/chunks/{find-PM3TD7V4.js → find-JTXDH3MR.js} +1 -1
- package/dist/bundle/chunks/flag-coverage-EDO3VM43.js +2 -0
- package/dist/bundle/chunks/{grep-5UPEO42U.js → grep-OZCR76FT.js} +1 -1
- package/dist/bundle/chunks/{gzip-ZINVK3M6.js → gzip-GQC6CWVL.js} +1 -1
- package/dist/bundle/chunks/{head-CFENJILH.js → head-J6RVJFRS.js} +1 -1
- package/dist/bundle/chunks/{help-QDDMBDU7.js → help-62M75TSG.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-GGVR4YGL.js → html-to-markdown-7OG5VWYG.js} +1 -1
- package/dist/bundle/chunks/{jq-X2P7Q64K.js → jq-FCG2IUBK.js} +1 -1
- package/dist/bundle/chunks/js-exec-NDLXDUBN.js +1577 -0
- package/dist/bundle/chunks/{ln-VYDFOFNO.js → ln-OPY2ZVGQ.js} +1 -1
- package/dist/bundle/chunks/{ls-R5CQLZQM.js → ls-MQTYWW4T.js} +1 -1
- package/dist/bundle/chunks/{mkdir-WDDKK2P3.js → mkdir-4A5W3RXH.js} +1 -1
- package/dist/bundle/chunks/mktemp-XKIE5N3X.js +2 -0
- package/dist/bundle/chunks/{mv-XSJA2FNL.js → mv-ZPIATQJL.js} +1 -1
- package/dist/bundle/chunks/{od-BI6XJPXY.js → od-LUHOH7CG.js} +1 -1
- package/dist/bundle/chunks/{paste-LLZ3ZQR2.js → paste-U57ZU47S.js} +1 -1
- package/dist/bundle/chunks/python3-SDFCGIU4.js +22 -0
- package/dist/bundle/chunks/{readlink-IY6QKK2P.js → readlink-YNNS6F7K.js} +1 -1
- package/dist/bundle/chunks/{rg-UQE6KUBP.js → rg-F4SX2PHI.js} +1 -1
- package/dist/bundle/chunks/{rm-JQ4GDKDD.js → rm-3XUUYAXQ.js} +1 -1
- package/dist/bundle/chunks/{rmdir-WZKAT6M5.js → rmdir-OGSEXEF4.js} +1 -1
- package/dist/bundle/chunks/{sed-JW2JDLSI.js → sed-MBB5SXGD.js} +1 -1
- package/dist/bundle/chunks/{seq-5R2GKXC6.js → seq-IN77HD3S.js} +1 -1
- package/dist/bundle/chunks/{sleep-PPRBTSVR.js → sleep-3QNP3BGR.js} +1 -1
- package/dist/bundle/chunks/{split-2SD6EP72.js → split-6R2TSQY6.js} +1 -1
- package/dist/bundle/chunks/{sqlite3-UVVRYDAL.js → sqlite3-7MBPFI6W.js} +1 -1
- package/dist/bundle/chunks/sqlite3-worker.js +75 -11
- package/dist/bundle/chunks/{stat-6KILP5AL.js → stat-YLVJ4L67.js} +1 -1
- package/dist/bundle/chunks/{tail-BDNMS4FR.js → tail-UGFWX3YY.js} +1 -1
- package/dist/bundle/chunks/{tar-6365WH6H.js → tar-BNHPWTOY.js} +1 -1
- package/dist/bundle/chunks/{time-NERE2JJ2.js → time-N6J6DC6C.js} +1 -1
- package/dist/bundle/chunks/timeout-ZHCL5KTP.js +2 -0
- package/dist/bundle/chunks/{tr-3I4MDKIF.js → tr-4NGL47UU.js} +1 -1
- package/dist/bundle/chunks/worker.js +88 -15
- package/dist/bundle/chunks/{xan-HUOXKUQA.js → xan-7R3I2DJO.js} +1 -1
- package/dist/bundle/chunks/xan-view-S4ZILLPU.js +2 -0
- package/dist/bundle/chunks/yes-I7SAR7XX.js +2 -0
- package/dist/bundle/chunks/yq-IOMBQYB2.js +2 -0
- package/dist/bundle/index.cjs +2862 -1489
- package/dist/bundle/index.js +349 -344
- package/dist/commands/curl/response-formatting.d.ts +2 -2
- package/dist/commands/curl/types.d.ts +5 -0
- package/dist/commands/diff/format.d.ts +46 -0
- package/dist/commands/js-exec/js-exec.d.ts +1 -10
- package/dist/commands/js-exec/run-runtime.d.ts +10 -0
- package/dist/commands/mktemp/mktemp.d.ts +4 -0
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/sqlite3/worker.js +75 -11
- package/dist/commands/worker-request-controller.d.ts +3 -23
- package/dist/commands/yes/yes.d.ts +4 -0
- package/dist/custom-commands.d.ts +7 -0
- package/dist/fs/create-exclusive.d.ts +30 -0
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +8 -1
- package/dist/fs/interface.d.ts +37 -0
- package/dist/fs/mountable-fs/mountable-fs.d.ts +20 -1
- package/dist/fs/overlay-fs/overlay-fs.d.ts +9 -1
- package/dist/fs/read-write-fs/read-write-fs.d.ts +27 -1
- package/dist/fs/traversal.d.ts +9 -0
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/interpreter/expansion/array-prefix-suffix.d.ts +2 -1
- package/dist/interpreter/expansion/parameter-ops.d.ts +1 -0
- package/dist/interpreter/expansion/pattern-removal.d.ts +3 -0
- package/dist/interpreter/expansion/variable.d.ts +1 -1
- package/dist/interpreter/helpers/loop.d.ts +32 -0
- package/dist/interpreter/helpers/substitution-status.d.ts +34 -0
- package/dist/interpreter/interpreter.d.ts +1 -1
- package/dist/interpreter/types.d.ts +8 -1
- package/dist/limits.d.ts +2 -0
- package/dist/network/allow-list/shared.d.ts +0 -8
- package/dist/network/dns-pin.d.ts +1 -35
- package/dist/network/fetch.d.ts +4 -6
- package/dist/network/types.d.ts +20 -2
- package/dist/security/defense-in-depth-box.d.ts +7 -0
- package/dist/security/trusted-globals.d.ts +8 -0
- package/dist/security/worker-defense-in-depth.d.ts +7 -0
- package/dist/types.d.ts +4 -3
- package/dist/worker-lifecycle.d.ts +27 -0
- package/package.json +12 -13
- package/dist/bin/chunks/awk2-C4A37H5N.js +0 -3
- package/dist/bin/chunks/chunk-23OI2XDJ.js +0 -20
- package/dist/bin/chunks/chunk-2ORJ5HTY.js +0 -276
- package/dist/bin/chunks/chunk-3PCPQIUD.js +0 -3
- package/dist/bin/chunks/chunk-7WBCA2BB.js +0 -3
- package/dist/bin/chunks/chunk-APV27ZZW.js +0 -21
- package/dist/bin/chunks/chunk-CPTQXTBJ.js +0 -3
- package/dist/bin/chunks/chunk-FE6GSISP.js +0 -22
- package/dist/bin/chunks/chunk-HL7NFZVQ.js +0 -13
- package/dist/bin/chunks/chunk-HWI42GQO.js +0 -7
- package/dist/bin/chunks/chunk-JQM3DKCH.js +0 -12
- package/dist/bin/chunks/chunk-TOTKK2XI.js +0 -16
- package/dist/bin/chunks/chunk-YTL6DXBO.js +0 -11
- package/dist/bin/chunks/curl-FS5LAEYI.js +0 -30
- package/dist/bin/chunks/flag-coverage-DOLZIUQ7.js +0 -3
- package/dist/bin/chunks/js-exec-DJQLXWCS.js +0 -99
- package/dist/bin/chunks/js-exec-worker.js +0 -4809
- package/dist/bin/chunks/python3-JCJHSX4Z.js +0 -14
- package/dist/bin/chunks/timeout-YGFHQJKX.js +0 -3
- package/dist/bin/chunks/undici-CKF2L2IP.js +0 -141
- package/dist/bin/chunks/yq-K5N5JD4N.js +0 -3
- package/dist/bin/shell/chunks/awk2-C4A37H5N.js +0 -3
- package/dist/bin/shell/chunks/chunk-23OI2XDJ.js +0 -20
- package/dist/bin/shell/chunks/chunk-2ORJ5HTY.js +0 -276
- package/dist/bin/shell/chunks/chunk-3PCPQIUD.js +0 -3
- package/dist/bin/shell/chunks/chunk-7WBCA2BB.js +0 -3
- package/dist/bin/shell/chunks/chunk-APV27ZZW.js +0 -21
- package/dist/bin/shell/chunks/chunk-CPTQXTBJ.js +0 -3
- package/dist/bin/shell/chunks/chunk-FE6GSISP.js +0 -22
- package/dist/bin/shell/chunks/chunk-HL7NFZVQ.js +0 -13
- package/dist/bin/shell/chunks/chunk-HWI42GQO.js +0 -7
- package/dist/bin/shell/chunks/chunk-JQM3DKCH.js +0 -12
- package/dist/bin/shell/chunks/chunk-TOTKK2XI.js +0 -16
- package/dist/bin/shell/chunks/chunk-YTL6DXBO.js +0 -11
- package/dist/bin/shell/chunks/curl-FS5LAEYI.js +0 -30
- package/dist/bin/shell/chunks/flag-coverage-DOLZIUQ7.js +0 -3
- package/dist/bin/shell/chunks/js-exec-DJQLXWCS.js +0 -99
- package/dist/bin/shell/chunks/python3-JCJHSX4Z.js +0 -14
- package/dist/bin/shell/chunks/timeout-YGFHQJKX.js +0 -3
- package/dist/bin/shell/chunks/undici-CKF2L2IP.js +0 -141
- package/dist/bin/shell/chunks/yq-K5N5JD4N.js +0 -3
- package/dist/bundle/chunks/awk2-NPLZQ3K7.js +0 -2
- package/dist/bundle/chunks/chunk-6DTD75TR.js +0 -275
- package/dist/bundle/chunks/chunk-6KK46B7Q.js +0 -12
- package/dist/bundle/chunks/chunk-AH7VTVWU.js +0 -2
- package/dist/bundle/chunks/chunk-BRJERIF4.js +0 -2
- package/dist/bundle/chunks/chunk-ELHOZMBD.js +0 -10
- package/dist/bundle/chunks/chunk-INDA53JL.js +0 -21
- package/dist/bundle/chunks/chunk-KBXRZGTY.js +0 -15
- package/dist/bundle/chunks/chunk-N3A4JVFJ.js +0 -2
- package/dist/bundle/chunks/chunk-UTKGYVUZ.js +0 -7
- package/dist/bundle/chunks/chunk-XMMV24SP.js +0 -20
- package/dist/bundle/chunks/chunk-YJKHREBZ.js +0 -11
- package/dist/bundle/chunks/chunk-ZBUZKIPX.js +0 -6
- package/dist/bundle/chunks/curl-DEHFBW27.js +0 -29
- package/dist/bundle/chunks/flag-coverage-I6UJUKQ4.js +0 -2
- package/dist/bundle/chunks/js-exec-XKF2B7C3.js +0 -98
- package/dist/bundle/chunks/js-exec-worker.js +0 -4809
- package/dist/bundle/chunks/python3-F5S5TYGS.js +0 -13
- package/dist/bundle/chunks/timeout-C6WDYPLV.js +0 -2
- package/dist/bundle/chunks/undici-PSPBDOYF.js +0 -140
- package/dist/bundle/chunks/xan-view-RT2WKDOQ.js +0 -2
- package/dist/bundle/chunks/yq-MI27NZ2U.js +0 -2
- package/dist/commands/js-exec/js-exec-worker.d.ts +0 -33
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as A}from"./chunk-
|
|
2
|
+
import{a as A}from"./chunk-U7UNEMLJ.js";import{l as f}from"./chunk-EFORKKSH.js";import{a as z,d as T}from"./chunk-GN6CQ3J4.js";import{a as _}from"./chunk-FOCWZZDE.js";import{a as B}from"./chunk-QIQMJJZ4.js";import{a as M,b as q}from"./chunk-QAYAQNCG.js";var L={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
|
|
3
3
|
a-z character range
|
|
4
4
|
[:alnum:] all letters and digits
|
|
5
5
|
[:alpha:] all letters
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{d as S}from"./chunk-GN6CQ3J4.js";import{a as v}from"./chunk-QIQMJJZ4.js";import{a as T,b as F}from"./chunk-QAYAQNCG.js";import*as k from"diff";var z=`\
|
|
3
|
+
`,b=3;function x(o){if(o==="")return{lines:[],noEol:!1};let n=!o.endsWith(`
|
|
4
|
+
`),t=o.split(`
|
|
5
|
+
`);return n||t.pop(),{lines:t,noEol:n}}function N(o,n){let t=o.lines.length-1;return o.lines.map((e,i)=>{let s=i===t&&o.noEol?e:`${e}
|
|
6
|
+
`;return n?s.toLowerCase():s})}function D(o,n,t){let e=k.diffArrays(N(o,t),N(n,t)),i=[],s=0,f=0,l=0;for(;l<e.length;){let r=e[l];if(!r.added&&!r.removed){s+=r.count??r.value.length,f+=r.count??r.value.length,l++;continue}let u={oldStart:s,oldCount:0,newStart:f,newCount:0};for(;l<e.length&&(e[l].added||e[l].removed);){let a=e[l].count??e[l].value.length;e[l].removed?(u.oldCount+=a,s+=a):(u.newCount+=a,f+=a),l++}i.push(u)}return i}function C(o){if(!/[\s"\u0000-\u001f\u007f]/.test(o))return o;let n='"';for(let t of o)t==='"'||t==="\\"?n+=`\\${t}`:t===" "?n+="\\t":t===`
|
|
7
|
+
`?n+="\\n":t==="\r"?n+="\\r":t<" "||t==="\x7F"?n+=`\\${t.charCodeAt(0).toString(8).padStart(3,"0")}`:n+=t;return`${n}"`}function p(o,n,t,e){o.push(`${e}${n.lines[t]}
|
|
8
|
+
`),n.noEol&&t===n.lines.length-1&&o.push(z)}function E(o,n){return n===0?String(o):n===1?String(o+1):`${o+1},${o+n}`}function U(o,n,t){let e=[];for(let i of t){let s=i.oldCount===0?"a":i.newCount===0?"d":"c";e.push(`${E(i.oldStart,i.oldCount)}${s}${E(i.newStart,i.newCount)}
|
|
9
|
+
`);for(let f=0;f<i.oldCount;f++)p(e,o,i.oldStart+f,"< ");s==="c"&&e.push(`---
|
|
10
|
+
`);for(let f=0;f<i.newCount;f++)p(e,n,i.newStart+f,"> ")}return e.join("")}function j(o,n){let t=[],e=[];for(let i of o){let s=e[e.length-1];s&&i.oldStart-(s.oldStart+s.oldCount)>2*n&&(t.push(e),e=[]),e.push(i)}return e.length>0&&t.push(e),t}function q(o,n,t,e){let i=o[0],s=o[o.length-1];return{oldFrom:Math.max(0,i.oldStart-e),oldTo:Math.min(n.lines.length,s.oldStart+s.oldCount+e),newFrom:Math.max(0,i.newStart-e),newTo:Math.min(t.lines.length,s.newStart+s.newCount+e)}}function L(o,n){let t=n-o;return t===0?`${o},0`:t===1?String(o+1):`${o+1},${t}`}function H(o,n,t,e,i,s){let f=[`--- ${C(o)}
|
|
11
|
+
`,`+++ ${C(n)}
|
|
12
|
+
`];for(let l of j(i,s)){let r=q(l,t,e,s);f.push(`@@ -${L(r.oldFrom,r.oldTo)} +${L(r.newFrom,r.newTo)} @@
|
|
13
|
+
`);let u=r.oldFrom;for(let a of l){for(;u<a.oldStart;u++)p(f,t,u," ");for(let d=0;d<a.oldCount;d++)p(f,t,a.oldStart+d,"-");for(let d=0;d<a.newCount;d++)p(f,e,a.newStart+d,"+");u=a.oldStart+a.oldCount}for(;u<r.oldTo;u++)p(f,t,u," ")}return f.join("")}function I(o,n){let t=n-o;return t===0?String(o):t===1?String(o+1):`${o+1},${n}`}function A(o,n,t,e,i,s){if(!t.some(r=>(s?r.oldCount:r.newCount)>0))return;let l=e;for(let r of t){let u=s?r.oldStart:r.newStart,a=s?r.oldCount:r.newCount;for(;l<u;l++)p(o,n,l," ");let d=r.oldCount>0&&r.newCount>0?"! ":s?"- ":"+ ";for(let c=0;c<a;c++)p(o,n,u+c,d);l=u+a}for(;l<i;l++)p(o,n,l," ")}function M(o,n,t,e,i,s){let f=[`*** ${C(o)}
|
|
14
|
+
`,`--- ${C(n)}
|
|
15
|
+
`];for(let l of j(i,s)){let r=q(l,t,e,s);f.push(`***************
|
|
16
|
+
`),f.push(`*** ${I(r.oldFrom,r.oldTo)} ****
|
|
17
|
+
`),A(f,t,l,r.oldFrom,r.oldTo,!0),f.push(`--- ${I(r.newFrom,r.newTo)} ----
|
|
18
|
+
`),A(f,e,l,r.newFrom,r.newTo,!1)}return f.join("")}var P={name:"diff",summary:"compare files line by line",usage:"diff [OPTION]... FILE1 FILE2",options:[" --normal output a normal diff (default)","-u, --unified output a unified diff","-c, --context output a context diff","-q, --brief report only whether files differ","-s, --report-identical-files report when files are the same","-i, --ignore-case ignore case differences"," --version output version information and exit"," --help display this help and exit"]},R={normal:{long:"normal",type:"boolean"},unified:{short:"u",long:"unified",type:"boolean"},context:{short:"c",long:"context",type:"boolean"},brief:{short:"q",long:"brief",type:"boolean"},reportSame:{short:"s",long:"report-identical-files",type:"boolean"},ignoreCase:{short:"i",long:"ignore-case",type:"boolean"},version:{long:"version",type:"boolean"}},G={name:"diff",async execute(o,n){if(F(o))return T(P);let t=v("diff",o,R);if(!t.ok)return t.error;let e=t.result.flags;if(e.version)return{stdout:`diff (just-bash)
|
|
19
|
+
`,stderr:"",exitCode:0};if(Number(e.normal)+Number(e.unified)+Number(e.context)>1)return{stdout:"",stderr:`diff: conflicting output style options
|
|
20
|
+
diff: Try 'diff --help' for more information.
|
|
21
|
+
`,exitCode:2};let s=e.brief,f=e.reportSame,l=e.ignoreCase,r=t.result.positional;if(r.length<2)return{stdout:"",stderr:`diff: missing operand
|
|
22
|
+
`,exitCode:2};let u,a,[d,c]=r;try{u=d==="-"?S(n.stdin):await n.fs.readFile(n.fs.resolvePath(n.cwd,d))}catch{return{stdout:"",stderr:`diff: ${d}: No such file or directory
|
|
23
|
+
`,exitCode:2}}try{a=c==="-"?S(n.stdin):await n.fs.readFile(n.fs.resolvePath(n.cwd,c))}catch{return{stdout:"",stderr:`diff: ${c}: No such file or directory
|
|
24
|
+
`,exitCode:2}}let w=u,$=a;if(l&&(w=w.toLowerCase(),$=$.toLowerCase()),w===$)return f?{stdout:`Files ${d} and ${c} are identical
|
|
25
|
+
`,stderr:"",exitCode:0}:{stdout:"",stderr:"",exitCode:0};if(s)return{stdout:`Files ${d} and ${c} differ
|
|
26
|
+
`,stderr:"",exitCode:1};let h=x(u),g=x(a),y=D(h,g,l),m;return e.unified?m=H(d,c,h,g,y,b):e.context?m=M(d,c,h,g,y,b):m=U(h,g,y),{stdout:m,stderr:"",exitCode:1}}},J={name:"diff",flags:[{flag:"--normal",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-q",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-i",type:"boolean"}],needsArgs:!0,minArgs:2};export{G as a,J as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as W}from"./chunk-
|
|
2
|
+
import{a as W}from"./chunk-VOQZ5TSL.js";import{c as $}from"./chunk-CHWP6GRK.js";import{b as C}from"./chunk-CBM6J4AL.js";import{a as V}from"./chunk-2WBUTDF5.js";import{d as I}from"./chunk-GN6CQ3J4.js";import{a as x}from"./chunk-W5DWRFSU.js";import{a as B,b}from"./chunk-FOCWZZDE.js";import{a as N,b as R}from"./chunk-QAYAQNCG.js";import{existsSync as ce}from"node:fs";import{dirname as de,join as T,sep as Q}from"node:path";import{fileURLToPath as me}from"node:url";import{Worker as he}from"node:worker_threads";import pe from"sql.js";function K(e,t){return e==null?Buffer.byteLength(t,"utf8"):e instanceof Uint8Array||Buffer.isBuffer(e)?e.byteLength:Buffer.byteLength(String(e),"utf8")}function X(e,t,r){let n=r.maxOutputSize??Number.MAX_SAFE_INTEGER,s=Buffer.byteLength(r.separator,"utf8");s+=Buffer.byteLength(r.newline,"utf8");for(let a of e)s+=Buffer.byteLength(a,"utf8");for(let a of t){s+=a.length*16;for(let i of a)s+=K(i,r.nullValue);if(s>n)break}let o=s*8+(t.length+3)*(e.length+3)*16;if(!Number.isSafeInteger(o)||o>n)throw new Error(`formatted output exceeds ${n} byte limit`);return n}function _(e,t,r){let n=X(e,t,r),s;switch(r.mode){case"list":s=Y(e,t,r);break;case"csv":s=Z(e,t,r);break;case"json":s=te(e,t);break;case"line":s=re(e,t,r);break;case"column":s=ne(e,t,r);break;case"table":s=se(e,t,r);break;case"markdown":s=oe(e,t,r);break;case"tabs":s=ie(e,t,r);break;case"box":s=ae(e,t,r);break;case"quote":s=le(e,t,r);break;case"html":s=fe(e,t,r);break;case"ascii":s=ue(e,t,r);break}if(Buffer.byteLength(s,"utf8")>n)throw new Error(`formatted output exceeds ${n} byte limit`);return s}function m(e,t){return e==null?t:e instanceof Uint8Array||Buffer.isBuffer(e)?Buffer.from(e).toString("utf8"):typeof e=="number"&&!Number.isInteger(e)?e.toPrecision(17).replace(/\.?0+$/,""):String(e)}function Y(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.join(r.separator));for(let s of t)n.push(s.map(o=>m(o,r.nullValue)).join(r.separator));return n.length>0?`${n.join(r.newline)}${r.newline}`:""}function Z(e,t,r){let n=[];r.header&&e.length>0&&n.push(e.map(v).join(","));for(let s of t)n.push(s.map(o=>v(m(o,r.nullValue))).join(","));return n.length>0?`${n.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`:""}function v(e){return e.includes(",")||e.includes('"')||e.includes("'")||e.includes(`
|
|
5
5
|
`)?`"${e.replace(/"/g,'""')}"`:e}function F(e){return e.toPrecision(17).replace(/\.?0+$/,"")}function ee(e){return e===null?"null":typeof e=="number"?Number.isInteger(e)?String(e):F(e):JSON.stringify(e)}function te(e,t){return t.length===0?"":`[${t.map(n=>`{${e.map((o,a)=>`${JSON.stringify(o)}:${ee(n[a])}`).join(",")}}`).join(`,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import*as M from"node:async_hooks";import*as $ from"node:module";var P;function T(){return P||_(),P}function _(){let l=[{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&&l.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&&l.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&&l.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=l.filter(t=>{try{return t.target[t.prop]!==void 0}catch{return!1}});return P??=new Set(e.map(({violationType:t})=>t)),e}var F=performance.timeOrigin,R=performance.now.bind(performance);function E(){return Math.floor(F+R())}var D=new Set(["function_constructor","async_function_constructor","generator_function_constructor","async_generator_function_constructor"]);function O(l){let e=l?.find(t=>D.has(t));if(e)throw new RangeError(`defenseInDepth.excludeViolationTypes cannot disable the non-excludable "${e}" protection`)}var V=`
|
|
3
|
+
|
|
4
|
+
This is a defense-in-depth measure and indicates a bug in just-bash. Please report this at security@vercel.com`;function S(l,e,t){let i=t&&!D.has(e)?`
|
|
5
|
+
|
|
6
|
+
If this access is required by trusted host-runtime code, add "${e}" to defenseInDepth.excludeViolationTypes.`:"";return l+V+i}var b=typeof __BROWSER__<"u"&&__BROWSER__;function I(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,l=>{let e=Math.random()*16|0;return(l==="x"?e:e&3|8).toString(16)})}var k=null,v=null,j=null;if(!b)try{k=M.AsyncLocalStorage,v=$,j=v.Module??v.default??null}catch{}var d=class extends Error{violation;constructor(e,t){super(S(e,t.type,t.type==="error_prepare_stack_trace"||T().has(t.type))),this.violation=t,this.name="SecurityViolationError"}},p=!b&&k?new k:null,G=1e3;function L(l,e,...t){return p.run(l,()=>e(...t))}var N={enabled:!0,auditMode:!1,processLifetimeIntrinsicHardening:!1};function C(){return!b&&typeof v?.registerHooks=="function"}function A(l){let e=typeof l=="boolean"?{enabled:l}:l??{};if(O(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",o={...t,enabled:i!=="disabled",requested:i};return o.excludeViolationTypes&&(o.excludeViolationTypes=[...new Set(o.excludeViolationTypes)].sort()),o}function H(l,e){if(l.enabled!==e.enabled||l.auditMode!==e.auditMode||l.processLifetimeIntrinsicHardening!==e.processLifetimeIntrinsicHardening||l.onViolation!==e.onViolation)return!1;let t=l.excludeViolationTypes??[],i=e.excludeViolationTypes??[];return t.length===i.length&&t.every((o,r)=>o===i[r])}var B=class l{static instance=null;static importHooksRegistered=!1;static trustedExecutionDepth=new Map;config;refCount=0;patchFailures=[];activeExecutionIds=new Set;contextCache=new Map;originalDescriptors=[];moduleAccessorResets=[];temporaryIntrinsicDescriptors=[];violations=[];activationTime=0;totalActiveTimeMs=0;constructor(e){this.config=e}static getInstance(e){let t=A(e);if(!l.instance)l.instance=new l(t);else{let i=l.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 l.instance}static resetInstance(){l.instance&&(l.instance.forceDeactivate(),l.instance=null),l.trustedExecutionDepth.clear()}static isInSandboxedContext(){return p?p?.getStore()?.sandboxActive===!0:!1}static getCurrentExecutionId(){if(p)return p?.getStore()?.executionId}static enterTrustedScope(e){let t=l.trustedExecutionDepth.get(e)??0;l.trustedExecutionDepth.set(e,t+1)}static leaveTrustedScope(e){let t=l.trustedExecutionDepth.get(e);if(t){if(t===1){l.trustedExecutionDepth.delete(e);return}l.trustedExecutionDepth.set(e,t-1)}}static isTrustedScopeActive(e){return e?(l.trustedExecutionDepth.get(e)??0)>0:!1}static isTrustedContext(e){return!e||e.forceUntrusted?!1:e.trusted===!0||l.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 r=l.instance?.getCachedContext(i)??{sandboxActive:!0,executionId:i},s=t?.forceUntrusted?{...r,forceUntrusted:!0}:r;return((...n)=>{let c=l.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 L(s,e,...n)})}isEnabled(){return this.getStatus().state==="enabled"}getStatus(){let e=C();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||b?{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=A({...this.config,...e})}activate(){if(!b&&this.config.enabled&&!p)throw new Error("DefenseInDepthBox: enabled protection requires node:async_hooks and node:module");if(b||!this.config.enabled){let i=I(),o=!1;return{run:r=>o?Promise.reject(new Error("DefenseInDepthBox handle is deactivated and cannot run new work")):r(),deactivate:()=>{o=!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=I(),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),l.trustedExecutionDepth.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},()=>{l.enterTrustedScope(i);try{let o=e();return typeof o=="object"&&o!==null&&"finally"in o&&typeof o.finally=="function"?o.finally(()=>{l.leaveTrustedScope(i)}):(l.leaveTrustedScope(i),o)}catch(o){throw l.leaveTrustedScope(i),o}})}static async runTrustedAsync(e){if(!p)return e();let t=p.getStore();if(!t)return e();let{executionId:i}=t;return await p.run({...t,trusted:!0,forceUntrusted:!1},async()=>{l.enterTrustedScope(i);try{return await e()}finally{l.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(b||this.config.auditMode||!p)return!1;let e=p?.getStore();return!(e?.sandboxActive!==!0||l.isTrustedContext(e))}shouldAudit(){if(!this.config.auditMode||!p)return!1;let e=p.getStore();return e?.sandboxActive===!0&&!l.isTrustedContext(e)}recordViolation(e,t,i){let o={timestamp:E(),type:e,message:i,path:t,stack:new Error().stack,executionId:p?.getStore()?.executionId};if(this.violations.length<G&&this.violations.push(o),this.config.onViolation)try{this.config.onViolation(o)}catch(r){console.debug("[DefenseInDepthBox] onViolation callback threw:",r instanceof Error?r.message:r)}return o}createBlockingProxy(e,t,i){let o=this;return new Proxy(e,{apply(r,s,n){if(o.shouldBlock()){let c=`${t} is blocked during script execution`,a=o.recordViolation(i,t,c);throw new d(c,a)}return o.shouldAudit()&&o.recordViolation(i,t,`${t} called (audit mode)`),Reflect.apply(r,s,n)},construct(r,s,n){if(o.shouldBlock()){let c=`${t} constructor is blocked during script execution`,a=o.recordViolation(i,t,c);throw new d(c,a)}return o.shouldAudit()&&o.recordViolation(i,t,`${t} constructor called (audit mode)`),Reflect.construct(r,s,n)}})}createBlockingObjectProxy(e,t,i,o){let r=this;return new Proxy(e,{get(s,n,c){if(r.shouldBlock()){if(o&&typeof n=="string"&&o.has(n))return Reflect.get(s,n,c);let a=`${t}.${String(n)}`,u=`${a} is blocked during script execution`,h=r.recordViolation(i,a,u);throw new d(u,h)}if(r.shouldAudit()){let a=`${t}.${String(n)}`;r.recordViolation(i,a,`${a} accessed (audit mode)`)}return Reflect.get(s,n,c)},set(s,n,c,a){if(r.shouldBlock()){let u=`${t}.${String(n)}`,h=`${u} modification is blocked during script execution`,y=r.recordViolation(i,u,h);throw new d(h,y)}return t==="process.env"&&n==="DEBUG"?Reflect.set(s,n,c):Reflect.set(s,n,c,a)},ownKeys(s){if(r.shouldBlock()){let n=`${t} enumeration is blocked during script execution`,c=r.recordViolation(i,t,n);throw new d(n,c)}return Reflect.ownKeys(s)},getOwnPropertyDescriptor(s,n){if(r.shouldBlock()){let c=`${t}.${String(n)}`,a=`${c} descriptor access is blocked during script execution`,u=r.recordViolation(i,c,a);throw new d(a,u)}return Reflect.getOwnPropertyDescriptor(s,n)},has(s,n){if(r.shouldBlock()){let c=`${t}.${String(n)}`,a=`${c} existence check is blocked during script execution`,u=r.recordViolation(i,c,a);throw new d(a,u)}return Reflect.has(s,n)},deleteProperty(s,n){if(r.shouldBlock()){let c=`${t}.${String(n)}`,a=`${c} deletion is blocked during script execution`,u=r.recordViolation(i,c,a);throw new d(a,u)}return Reflect.deleteProperty(s,n)},setPrototypeOf(s,n){if(r.shouldBlock()){let c=`${t} setPrototypeOf is blocked during script execution`,a=r.recordViolation(i,t,c);throw new d(c,a)}return Reflect.setPrototypeOf(s,n)},defineProperty(s,n,c){if(r.shouldBlock()){let a=`${t}.${String(n)}`,u=`${a} defineProperty is blocked during script execution`,h=r.recordViolation(i,a,u);throw new d(u,h)}return Reflect.defineProperty(s,n,c)}})}createReadonlyObjectProxy(e,t,i){let o=this,r=s=>{let n=`${t} ${s} is blocked during script execution`,c=o.recordViolation(i,t,n);throw new d(n,c)};return new Proxy(e,{set(s,n,c,a){return o.shouldBlock()&&r("modification"),Reflect.set(s,n,c,a)},defineProperty(s,n,c){return o.shouldBlock()&&r("defineProperty"),Reflect.defineProperty(s,n,c)},deleteProperty(s,n){return o.shouldBlock()&&r("deletion"),Reflect.deleteProperty(s,n)},setPrototypeOf(s,n){return o.shouldBlock()&&r("setPrototypeOf"),Reflect.setPrototypeOf(s,n)},preventExtensions(s){return o.shouldBlock()&&r("preventExtensions"),Reflect.preventExtensions(s)}})}applyPatches(){this.patchFailures=[];let e=_(),t=new Set(this.config.excludeViolationTypes??[]),i=new Set(["process_send","process_channel","process_stdout","process_stderr"]),o=[];for(let n of e)if(!t.has(n.violationType)&&!i.has(n.violationType)){if(n.strategy==="freeze"){o.push(n);continue}this.applyPatch(n)}this.protectConstructorChain(),t.has("error_prepare_stack_trace")||this.protectErrorPrepareStackTrace(),this.protectPromiseThen(),C()&&this.protectDynamicImport(),this.protectModuleLoad(),this.protectModuleResolveFilename(),this.protectProcessMainModule(),this.protectProcessExecPath(),this.protectProxyRevocable();let r=["Function.prototype.constructor","Module._load","Module._resolveFilename"],s=this.patchFailures.filter(n=>r.includes(n));if(s.length>0)throw this.restorePatches(),new Error(`DefenseInDepthBox: critical patches failed: ${s.join(", ")}`);this.config.processLifetimeIntrinsicHardening||this.protectReversibleIntrinsics(o);for(let n of o)this.applyPatch(n,this.config.processLifetimeIntrinsicHardening===!0);this.config.processLifetimeIntrinsicHardening&&this.lockWellKnownSymbols()}protectReversibleIntrinsics(e){let t=new Set,i=(s,n)=>{let c=Object.getOwnPropertyDescriptor(s,n);!c||!("value"in c)||c.writable!==!0||c.configurable!==!0||(this.temporaryIntrinsicDescriptors.push({target:s,prop:n,descriptor:c}),Object.defineProperty(s,n,{...c,writable:!1}))};for(let{target:s,prop:n}of e){let c=s[n];if(!(typeof c!="object"||c===null)){t.add(c);for(let a of Reflect.ownKeys(c))i(c,a)}}let o=[];for(let s of[Array,Map,Set,RegExp,Promise])o.push([s,Symbol.species]);for(let s of[Array.prototype,String.prototype,Map.prototype,Set.prototype])o.push([s,Symbol.iterator]);o.push([Symbol.prototype,Symbol.toPrimitive],[Date.prototype,Symbol.toPrimitive],[Function.prototype,Symbol.hasInstance],[Array.prototype,Symbol.unscopables]);for(let s of[Symbol.match,Symbol.matchAll,Symbol.replace,Symbol.search,Symbol.split])o.push([RegExp.prototype,s]);for(let s of[Map.prototype,Set.prototype,Promise.prototype,ArrayBuffer.prototype])o.push([s,Symbol.toStringTag]);for(let[s,n]of o)t.add(s),i(s,n);let r=(s,n,c)=>{let a=Object.getOwnPropertyDescriptor(s,n);if(!a||!("value"in a)||typeof a.value!="function"||a.configurable!==!0)return;let u=a.value,h=this,y=function(...f){let g=f[0];if(h.shouldBlock()&&typeof g=="object"&&g!==null&&t.has(g)){let x=`${c}.${n}`,m=`${x} is blocked for protected intrinsics during script execution`,w=h.recordViolation("prototype_mutation",x,m);throw new d(m,w)}return Reflect.apply(u,this,f)};this.temporaryIntrinsicDescriptors.push({target:s,prop:n,descriptor:a}),Object.defineProperty(s,n,{...a,value:y,writable:!1})};for(let s of["assign","defineProperties","defineProperty","freeze","preventExtensions","seal","setPrototypeOf"])r(Object,s,"Object");for(let s of["defineProperty","deleteProperty","preventExtensions","set","setPrototypeOf"])r(Reflect,s,"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(o){if(e.shouldBlock()){let r="Error.prepareStackTrace modification is blocked during script execution",s=e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace",r);throw new d(r,s)}e.shouldAudit()&&e.recordViolation("error_prepare_stack_trace","Error.prepareStackTrace","Error.prepareStackTrace set (audit mode)"),i=o},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 r=function(...s){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,s);if(this.kind==="fulfilled")return s[0];throw s[0]}return Reflect.apply(this.cb,void 0,s)})};var t=r;let i=Object.getOwnPropertyDescriptor(Promise.prototype,"then");this.originalDescriptors.push({target:Promise.prototype,prop:"then",descriptor:i});let o=i?.value;if(typeof o!="function")return;Object.defineProperty(Promise.prototype,"then",{value:function(n,c){if(!p)return Reflect.apply(o,this,[n,c]);let a=p.getStore(),u=a?.sandboxActive===!0&&a.trusted!==!0?a.executionId:void 0;if(!u)return Reflect.apply(o,this,[n,c]);let h=e.getCachedContext(u),y=a?.forceUntrusted?{...h,forceUntrusted:!0}:h,f=(g,x)=>typeof g!="function"?g:r.bind({box:e,executionId:u,captured:y,cb:g,kind:x});return Reflect.apply(o,this,[f(n,"fulfilled"),f(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 o=this;try{let r=Object.getOwnPropertyDescriptor(e,"constructor");this.originalDescriptors.push({target:e,prop:"constructor",descriptor:r});let s=r?.value;Object.defineProperty(e,"constructor",{get(){if(o.shouldBlock()){let n=`${t} access is blocked during script execution`,c=o.recordViolation(i,t,n);throw new d(n,c)}return o.shouldAudit()&&o.recordViolation(i,t,`${t} accessed (audit mode)`),s},set(n){if(o.shouldBlock()){let c=`${t} modification is blocked during script execution`,a=o.recordViolation(i,t,c);throw new d(c,a)}Object.defineProperty(this,"constructor",{value:n,writable:!0,configurable:!0})},configurable:!0})}catch(r){this.patchFailures.push(t),console.debug(`[DefenseInDepthBox] Could not patch ${t}:`,r instanceof Error?r.message:r)}}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 o="process.mainModule access is blocked during script execution",r=e.recordViolation("process_main_module","process.mainModule",o);throw new d(o,r)}return e.shouldAudit()&&e.recordViolation("process_main_module","process.mainModule","process.mainModule accessed (audit mode)"),i},set(o){if(e.shouldBlock()){let r="process.mainModule modification is blocked during script execution",s=e.recordViolation("process_main_module","process.mainModule",r);throw new d(r,s)}Object.defineProperty(process,"mainModule",{value:o,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 o="process.execPath access is blocked during script execution",r=e.recordViolation("process_exec_path","process.execPath",o);throw new d(o,r)}return e.shouldAudit()&&e.recordViolation("process_exec_path","process.execPath","process.execPath accessed (audit mode)"),i},set(o){if(e.shouldBlock()){let r="process.execPath modification is blocked during script execution",s=e.recordViolation("process_exec_path","process.execPath",r);throw new d(r,s)}Object.defineProperty(process,"execPath",{value:o,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 o=Object.getOwnPropertyDescriptor(t,i);if(o?.configurable){if("value"in o){Object.defineProperty(t,i,{...o,configurable:!1,writable:!1});return}Object.defineProperty(t,i,{...o,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(r,s){if(e.shouldBlock()){let n="Proxy.revocable is blocked during script execution",c=e.recordViolation("proxy","Proxy.revocable",n);throw new d(n,c)}return e.shouldAudit()&&e.recordViolation("proxy","Proxy.revocable","Proxy.revocable called (audit mode)"),t(r,s)},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(!(b||l.importHooksRegistered))try{let e=v;if(!e)throw new Error("node:module is unavailable");let t=new Set;for(let r of e.builtinModules??[]){let s=r.startsWith("node:")?r.slice(5):r;t.add(s);let n=s.indexOf("/");n>0&&t.add(s.slice(0,n))}let i=r=>{if(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")||r.startsWith("file:")||r.startsWith("data:")||r.startsWith("blob:")||r.startsWith("http:")||r.startsWith("https:"))return!1;let s=r.startsWith("node:")?r.slice(5):r;if(!s)return!1;if(typeof e.isBuiltin=="function"&&e.isBuiltin(s)||t.has(s))return!0;let n=s.indexOf("/");return n>0&&t.has(s.slice(0,n))},o=r=>{let s=p?.getStore();return r.config.auditMode===!0&&s?.sandboxActive===!0&&!l.isTrustedContext(s)};if(typeof e.registerHooks=="function"){e.registerHooks({resolve(r,s,n){let c=l.instance;if(!c)return n(r,s);if((r.startsWith("data:")||r.startsWith("blob:"))&&c.shouldBlock()){let a=`import(${r.startsWith("data:")?"data:":"blob:"})`,u=`dynamic import of ${r.startsWith("data:")?"data:":"blob:"} URLs is blocked by defense-in-depth`,h=c.recordViolation("dynamic_import_builtin",a,u);throw new d(u,h)}if(i(r)){let a=`import(${r})`,u=`dynamic import of Node.js builtin '${r}' is blocked during script execution`;if(c.shouldBlock()){let h=c.recordViolation("dynamic_import_builtin",a,u);throw new d(u,h)}o(c)&&c.recordViolation("dynamic_import_builtin",a,`dynamic import of Node.js builtin '${r}' called (audit mode)`)}return n(r,s)}}),l.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(b)return;let i=`Module.${e}`;try{let o=j,r=o?.[e];if(!o||typeof r!="function")throw new Error("node:module Module class or method is unavailable");let s=Object.getOwnPropertyDescriptor(o,e);if(!s)throw new Error("method has no own property descriptor");if(s.configurable===!1&&s.writable===!1)throw new Error("method is non-configurable and non-writable");let n=a=>this.createBlockingProxy(a,i,t),c=n(r);if(this.originalDescriptors.push({target:o,prop:e,descriptor:s}),"value"in s){Object.defineProperty(o,e,{...s,value:c});let a=Object.getOwnPropertyDescriptor(o,e);if(o[e]!==c||a?.value!==c)throw new Error("installed patch failed verification")}else{let a=s.get,u=s.set;if(typeof u!="function")throw new Error("accessor has no setter to install protection through");this.moduleAccessorResets.push(()=>{u.call(o,r)});let h={configurable:s.configurable,enumerable:s.enumerable,get:a,set:f=>{if(this.shouldBlock()){let m=`${i} modification is blocked during script execution`,w=this.recordViolation(t,i,m);throw new d(m,w)}this.shouldAudit()&&this.recordViolation(t,i,`${i} modified (audit mode)`);let g=typeof f=="function"?n(f):f,x=a?.call(o);try{y(g)}catch(m){throw y(x),m}}},y=f=>{try{u.call(o,f)}finally{Object.defineProperty(o,e,h)}let g=Object.getOwnPropertyDescriptor(o,e);if(g?.get!==h.get||g?.set!==h.set||a?.call(o)!==f||o[e]!==f)throw new Error("installed patch failed accessor verification")};y(c)}}catch{this.patchFailures.push(i)}}applyPatch(e,t=!1){let{target:i,prop:o,violationType:r,strategy:s}=e;try{let n=i[o];if(n===void 0)return;let c=Object.getOwnPropertyDescriptor(i,o);if(this.originalDescriptors.push({target:i,prop:o,descriptor:c}),s==="freeze"){if(typeof n=="object"&&n!==null){t&&Object.freeze(n);let a=this.getPathForTarget(i,o),u=this.createReadonlyObjectProxy(n,a,r);Object.defineProperty(i,o,{...c,value:u})}}else{let a=this.getPathForTarget(i,o),u=typeof n=="function"?this.createBlockingProxy(n,a,r):this.createBlockingObjectProxy(n,a,r,e.allowedKeys);Object.defineProperty(i,o,{value:u,writable:!0,configurable:!0})}}catch(n){let c=this.getPathForTarget(i,o);this.patchFailures.push(c),console.debug(`[DefenseInDepthBox] Could not patch ${c}:`,n instanceof Error?n.message:n)}}restorePatches(){for(let e=this.moduleAccessorResets.length-1;e>=0;e--)try{this.moduleAccessorResets[e]()}catch(t){console.debug("[DefenseInDepthBox] Could not reset module accessor override slot:",t instanceof Error?t.message:t)}this.moduleAccessorResets=[];for(let e=this.temporaryIntrinsicDescriptors.length-1;e>=0;e--){let{target:t,prop:i,descriptor:o}=this.temporaryIntrinsicDescriptors[e];try{Object.defineProperty(t,i,o)}catch(r){console.debug(`[DefenseInDepthBox] Could not restore temporary intrinsic ${String(i)}:`,r instanceof Error?r.message:r)}}this.temporaryIntrinsicDescriptors=[];for(let e=this.originalDescriptors.length-1;e>=0;e--){let{target:t,prop:i,descriptor:o}=this.originalDescriptors[e];try{o?Object.defineProperty(t,i,o):delete t[i]}catch(r){let s=this.getPathForTarget(t,i);console.debug(`[DefenseInDepthBox] Could not restore ${s}:`,r instanceof Error?r.message:r)}}this.originalDescriptors=[]}};export{d as a,B as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as $}from"./chunk-
|
|
2
|
+
import{a as $}from"./chunk-U7UNEMLJ.js";import{e as y}from"./chunk-DIWMSSQY.js";import{l as h}from"./chunk-EFORKKSH.js";import{e as I,g as b}from"./chunk-GN6CQ3J4.js";import{c as w}from"./chunk-QAYAQNCG.js";function A(e,s){let i=10,r=null,u=!1,n=!1,l=!1,f=[];for(let o=0;o<e.length;o++){let t=e[o];if(t==="-n"&&o+1<e.length){let a=e[++o];s==="tail"&&a.startsWith("+")?(l=!0,i=parseInt(a.slice(1),10)):i=parseInt(a,10)}else if(s==="tail"&&t.startsWith("-n+"))l=!0,i=parseInt(t.slice(3),10);else if(t.startsWith("-n"))i=parseInt(t.slice(2),10);else if(t==="-c"&&o+1<e.length)r=parseInt(e[++o],10);else if(t.startsWith("-c"))r=parseInt(t.slice(2),10);else if(t.startsWith("--bytes="))r=parseInt(t.slice(8),10);else if(t.startsWith("--lines="))i=parseInt(t.slice(8),10);else if(t==="-q"||t==="--quiet"||t==="--silent")u=!0;else if(t==="-v"||t==="--verbose")n=!0;else if(t.match(/^-\d+$/))i=parseInt(t.slice(1),10);else{if(t.startsWith("--"))return{ok:!1,error:w(s,t)};if(t.startsWith("-")&&t!=="-")return{ok:!1,error:w(s,t)};f.push(t)}}return r!==null&&(Number.isNaN(r)||r<0)?{ok:!1,error:{stdout:"",stderr:`${s}: invalid number of bytes
|
|
3
3
|
`,exitCode:1}}:Number.isNaN(i)||i<0?{ok:!1,error:{stdout:"",stderr:`${s}: invalid number of lines
|
|
4
4
|
`,exitCode:1}}:{ok:!0,options:{lines:i,bytes:r,quiet:u,verbose:n,files:f,fromLine:l}}}async function F(e,s,i,r){let{quiet:u,verbose:n,files:l}=s;if(l.length>e.limits.maxArrayElements)throw new h(`${i}: file operand limit exceeded (${e.limits.maxArrayElements})`,"array_elements");if(l.length===0)return{stdout:r(e.stdin),stderr:"",exitCode:0,stdoutEncoding:"binary"};let f=Math.min(e.limits.maxOutputSize,e.limits.maxStringLength),o=new y(f,i),t=new y(f,i),a=0,g=0,B=n||!u&&l.length>1,x=0;for(let m=0;m<l.length;m++){let c=l[m];try{let p=e.fs.resolvePath(e.cwd,c);if((await e.fs.stat(p)).size>e.limits.maxInputBytes-g)throw new h(`${i}: aggregate input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");let d=await b(e.fs,p);if(d.length>e.limits.maxInputBytes-g)throw new h(`${i}: aggregate input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");g+=d.length,e.executionScope?.consumeInput(d.length,i),B&&(x>0&&o.append(`
|
|
5
5
|
`),o.append(I(`==> ${c} <==
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as s,b as i}from"./chunk-
|
|
2
|
+
import{a as s,b as i}from"./chunk-CBM6J4AL.js";function a(t,e,n){if(!t||i.isInSandboxedContext())return;let r=`${e} ${n} attempted outside defense context`;throw new s(r,{timestamp:Date.now(),type:"missing_defense_context",message:r,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:i.getCurrentExecutionId()})}async function x(t,e,n,r){a(t,e,`${n} (pre-await)`);let o=await r();return a(t,e,`${n} (post-await)`),o}function d(t,e,n,r){let o=((...c)=>(a(t,e,n),r(...c)));return t?i.bindCurrentContext(o):o}export{a,x as b,d as c};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as Y,b as C,c as Z,d as ee}from"./chunk-
|
|
2
|
+
import{a as Y,b as C,c as Z,d as ee}from"./chunk-H53EPEGD.js";import{d as M}from"./chunk-FIMO5HLX.js";import{a as K,b as X}from"./chunk-CHWP6GRK.js";import{b as F}from"./chunk-CHHWTPDH.js";import{a as H}from"./chunk-CBM6J4AL.js";import{l as j}from"./chunk-EFORKKSH.js";import{a as P,d as L}from"./chunk-GN6CQ3J4.js";import{a as B}from"./chunk-FOCWZZDE.js";import{a as W,b as G,c as T}from"./chunk-QAYAQNCG.js";function se(i){switch(i){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
3
3
|
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${i.charCodeAt(0).toString(16).padStart(4,"0")}`}}function ne(i){let t="",d=!1,m=!1;for(let s=0;s<i.length;s++){let a=i[s];if(m){t+=a,m=!1;continue}if(a==="\\"){t+=a,m=!0;continue}if(a==='"'){t+=a,d=!d;continue}if(d&&a.charCodeAt(0)<=31){t+=se(a);continue}t+=a}return t}function R(i,t,d){return JSON.parse(ne(i.slice(t,d)))}function J(i,t){let d=[],m=x=>{if(d.length>=t.maxElements)throw new j(`query result element limit exceeded (${t.maxElements})`,"array_elements");d.push(x)},s=0,a=i.length;for(;s<a;){for(;s<a&&/\s/.test(i[s]);)s++;if(s>=a)break;let x=s,p=i[s];if(p==="{"||p==="["){let u=[p==="{"?"}":"]"],h=!1,E=!1;for(s++;s<a&&u.length>0;){let g=i[s];if(E)E=!1;else if(g==="\\")E=!0;else if(g==='"')h=!h;else if(!h){if(g==="{"||g==="["){if(u.push(g==="{"?"}":"]"),u.length>t.maxDepth)throw new j(`query depth limit exceeded (${t.maxDepth})`,"recursion")}else if((g==="}"||g==="]")&&u.pop()!==g)throw new Error(`Mismatched JSON delimiter at position ${s}`)}s++}if(u.length!==0)throw new Error(`Unexpected end of JSON input at position ${s} (unclosed ${p})`);m(M(R(i,x,s),{maxDepth:t.maxDepth,maxElements:t.maxElements}))}else if(p==='"'){let u=!1;for(s++;s<a;){let h=i[s];if(u)u=!1;else if(h==="\\")u=!0;else if(h==='"'){s++;break}s++}m(M(R(i,x,s),t))}else if(p==="-"||p>="0"&&p<="9"){for(;s<a&&/[\d.eE+-]/.test(i[s]);)s++;m(M(R(i,x,s),t))}else if(i.slice(s,s+4)==="true")m(!0),s+=4;else if(i.slice(s,s+5)==="false")m(!1),s+=5;else if(i.slice(s,s+4)==="null")m(null),s+=4;else{let u=i.slice(s,s+10);throw new Error(`Invalid JSON at position ${x}: unexpected '${u.split(/\s/)[0]}'`)}}return d}function S(i){return{stdout:"",stderr:`jq: ${i}
|
|
4
4
|
`,exitCode:2}}var re={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE...]",options:["-R, --raw-input read each line as string instead of JSON","-r, --raw-output output strings without quotes","-c, --compact-output compact instead of pretty-printed output","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --arg NAME VALUE bind $NAME to the string VALUE"," --argjson NAME JSON bind $NAME to the JSON-decoded value JSON"," --rawfile NAME FILE bind $NAME to the raw contents of FILE"," --slurpfile NAME FILE bind $NAME to the array of JSON values in FILE"," --args remaining arguments are string positional args ($ARGS.positional)"," --jsonargs remaining arguments are JSON positional args ($ARGS.positional)"," --help display this help and exit"]},we={name:"jq",async execute(i,t){K(t.requireDefenseContext,"jq","execution entry");let d=(r,e)=>X(t.requireDefenseContext,"jq",r,e);if(G(i))return W(re);let m=!1,s=!1,a=!1,x=!1,p=!1,u=!1,h=!1,E=!1,g=!1,V=".",_=!1,A="none",N=[],$=new Map,k=[],q=[],v={maxDepth:t.limits.maxQueryDepth,maxElements:t.limits.maxQueryElements};for(let r=0;r<i.length;r++){let e=i[r];if(e==="-R"||e==="--raw-input")s=!0;else if(e==="-r"||e==="--raw-output")m=!0;else if(e==="-c"||e==="--compact-output")a=!0;else if(e==="-e"||e==="--exit-status")x=!0;else if(e==="-s"||e==="--slurp")p=!0;else if(e==="-n"||e==="--null-input")u=!0;else if(e==="-j"||e==="--join-output")h=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")E=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")g=!0;else if(e==="--arg"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--arg takes two parameters (e.g. --arg varname value)");$.set(n,l),r+=2}else if(e==="--argjson"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--argjson takes two parameters (e.g. --argjson varname text)");let y;try{y=J(l.trim(),v)}catch{return S("invalid JSON text passed to --argjson")}if(y.length!==1)return S("invalid JSON text passed to --argjson");$.set(n,y[0]),r+=2}else if(e==="--rawfile"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--rawfile takes two parameters (e.g. --rawfile varname filename)");q.push({name:n,file:l,mode:"raw"}),r+=2}else if(e==="--slurpfile"){let n=i[r+1],l=i[r+2];if(n===void 0||l===void 0)return S("--slurpfile takes two parameters (e.g. --slurpfile varname filename)");q.push({name:n,file:l,mode:"slurp"}),r+=2}else if(e==="--args")A="args";else if(e==="--jsonargs")A="jsonargs";else if(e==="-")N.push("-");else{if(e.startsWith("--"))return T("jq",e);if(e.startsWith("-")){for(let n of e.slice(1))if(n==="R")s=!0;else if(n==="r")m=!0;else if(n==="c")a=!0;else if(n==="e")x=!0;else if(n==="s")p=!0;else if(n==="n")u=!0;else if(n==="j")h=!0;else if(n!=="a"){if(n==="S")E=!0;else if(n!=="C"){if(n!=="M")return T("jq",`-${n}`)}}}else if(!_)V=e,_=!0;else if(A==="args")k.push(e);else if(A==="jsonargs"){let n;try{n=J(e.trim(),v)}catch{return S("invalid JSON text passed to --jsonargs")}if(n.length!==1)return S("invalid JSON text passed to --jsonargs");k.push(n[0])}else N.push(e)}}}}if(q.length>0){let r=await d("arg file read",()=>F(t,q.map(e=>e.file),{cmdName:"jq",stopOnError:!0}));if(r.exitCode!==0)return{stdout:"",stderr:r.stderr,exitCode:2};for(let e=0;e<q.length;e++){let{name:n,mode:l}=q[e],y=L(r.files[e].content);if(l==="raw")$.set(n,y);else{let b=y.trim();try{$.set(n,b?J(b,v):[])}catch{return S("invalid JSON text passed to --slurpfile")}}}}let D=[];if(!u)if(N.length===0||N.length===1&&N[0]==="-")D.push({source:"stdin",content:L(t.stdin)});else{let r=await d("file read",()=>F(t,N,{cmdName:"jq",stopOnError:!0}));if(r.exitCode!==0)return{stdout:"",stderr:r.stderr,exitCode:2};D=r.files.map(e=>({source:e.filename||"stdin",content:L(e.content)}))}try{let r=Z(V,{maxDepth:t.limits.maxQueryDepth,maxTokens:t.limits.maxQueryTokens,maxSourceLength:t.limits.maxStringLength}),e=[],n={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength,maxOutputSize:t.limits.maxOutputSize,maxArrayElements:t.limits.maxQueryElements,maxDepth:t.limits.maxQueryDepth}:void 0,env:t.env,namedArgs:$,positionalArgs:k,coverage:t.coverage,requireDefenseContext:t.requireDefenseContext,budget:{operations:0,callDepth:0}},l=(o,f)=>{if(f.length>t.limits.maxQueryElements-o.length)throw new j(`query result element limit exceeded (${t.limits.maxQueryElements})`,"array_elements");for(let c of f)o.push(c)};if(u)e=C(null,r,n);else if(s&&p){let o=D.map(({content:f})=>f).join("");e=C(o,r,n)}else if(s){let o="";for(let{content:f}of D){let c=o+f,w=0,O=c.indexOf(`
|
|
5
5
|
`,w);for(;O!==-1;)l(e,C(c.slice(w,O),r,n)),w=O+1,O=c.indexOf(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as Y}from"./chunk-
|
|
2
|
+
import{a as Y}from"./chunk-7GA3QWJJ.js";import{l as G,m as V}from"./chunk-EFORKKSH.js";function X(t,n){let e=t.ignoreCase?n.toLowerCase():n,i=t.needles;for(let s=0;s<i.length;s++)if(e.indexOf(i[s])!==-1)return!0;return!1}function ee(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,s)=>{if(i==="&")return n[0];if(s!==void 0)return n.groups?.[s]??"";let o=parseInt(i,10);return n[o]??""})}function ne(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:s=!1,countOnly:o=!1,countMatches:c=!1,filename:h="",onlyMatching:L=!1,beforeContext:F=0,afterContext:O=0,maxCount:A=0,contextSeparator:q="--",showColumn:Z=!1,vimgrep:H=!1,showByteOffset:W=!1,replace:E=null,passthru:K=!1,multiline:Q=!1,kResetGroup:S,preFilter:R,maxWork:N,maxMatches:g,signal:U}=e;if(Q)return ie(t,n,{invertMatch:i,showLineNumbers:s,countOnly:o,countMatches:c,filename:h,onlyMatching:L,beforeContext:F,afterContext:O,maxCount:A,contextSeparator:q,showColumn:Z,showByteOffset:W,replace:E,kResetGroup:S,preFilter:R,maxWork:N,maxMatches:g,signal:U});let _=0,C=(l=1)=>{if(U?.aborted)throw new V;if(_+=l,N!==void 0&&_>N)throw new G(`search: matching work limit exceeded (${N})`,"iterations")},b=(l,a)=>{if(g!==void 0&&l.length>=g)throw new G(`search: result limit exceeded (${g})`,"array_elements");l.push(a)},j=1;for(let l=0;l<t.length;l++)if((l&1023)===0&&C(),t.charCodeAt(l)===10&&(j++,g!==void 0&&j>g))throw new G(`search: line limit exceeded (${g})`,"array_elements");let P=t.split(`
|
|
3
3
|
`),y=P.length,k=y>0&&P[y-1]===""?y-1:y;if(o||c){let l=0,a=(c||L)&&!i;for(let r=0;r<k;r++){C();let u=P[r];if(!(R&&!i&&!X(R,u)))if(n.lastIndex=0,a)for(let x=n.exec(u);x!==null;x=n.exec(u))C(),l++,x[0].length===0&&n.lastIndex++;else n.test(u)!==i&&l++}return{output:`${h?`${h}:${l}`:String(l)}
|
|
4
4
|
`,matched:l>0,matchCount:l}}if(F===0&&O===0&&!K){let l=[],a=!1,d=0,r=0;for(let u=0;u<k&&(C(),!(A>0&&d>=A));u++){let x=P[u],I=null;if(R&&!X(R,x)||(n.lastIndex=0,I=n.exec(x)),I!==null!==i)if(a=!0,d++,L)for(let w=I;w!==null;w=n.exec(x)){C();let z=S!==void 0?w[S]??"":w[0],B=E!==null?ee(E,w):z,p=h?`${h}:`:"";W&&(p+=`${r+w.index}:`),s&&(p+=`${u+1}:`),Z&&(p+=`${w.index+1}:`),b(l,p+B),w[0].length===0&&n.lastIndex++}else if(H)for(let w=I;w!==null;w=n.exec(x)){C();let z=h?`${h}:`:"";W&&(z+=`${r+w.index}:`),s&&(z+=`${u+1}:`),Z&&(z+=`${w.index+1}:`),b(l,z+x),w[0].length===0&&n.lastIndex++}else{let w=I?I.index+1:1,z=x;E!==null&&(n.lastIndex=0,z=n.replace(x,(...p)=>{if(p[0].length===0)return"";let D=p,J=p[p.length-1];return typeof J=="object"&&J!==null?(D.groups=J,D.input=p[p.length-2],D.index=p[p.length-3]):(D.input=p[p.length-1],D.index=p[p.length-2]),ee(E,D)}));let B=h?`${h}:`:"";W&&(B+=`${r+(I?I.index:0)}:`),s&&(B+=`${u+1}:`),Z&&(B+=`${w}:`),b(l,B+z)}r+=x.length+1}return{output:l.length>0?`${l.join(`
|
|
5
5
|
`)}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{l as o}from"./chunk-EFORKKSH.js";import{a}from"./chunk-GN6CQ3J4.js";function r(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){r(s,e),r(t,e);let i=s+t;if(!Number.isSafeInteger(i))throw c(e);return i}function p(s,t,e){if(r(s,e),r(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 n=new u(e,i);return n.repeat(s,t),n.build()}function b(s,t,e,i){let n=new u(e,i);for(let h=0;h<s.length;h++)h>0&&n.append(t),n.append(s[h]);return n.build()}var u=class{maxBytes;label;createLimitError;reservedBytes;chunks=[];usedBytes=0;constructor(t,e,i=void 0,n=0){this.maxBytes=t,this.label=e,this.createLimitError=i,this.reservedBytes=n,r(t,e),r(n,e),n>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){r(t,this.label),t>this.remainingBytes&&this.fail()}append(t){let e=a(t);return this.reserve(e),t&&this.chunks.push(t),this.usedBytes+=e,this}repeat(t,e){r(e,this.label);let i=a(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,b as d,u as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{c as E}from"./chunk-CHHWTPDH.js";import{
|
|
2
|
+
import{c as E}from"./chunk-CHHWTPDH.js";import{e as W}from"./chunk-DIWMSSQY.js";import{l as h}from"./chunk-EFORKKSH.js";import{d as N}from"./chunk-GN6CQ3J4.js";import{a as v,b as L,c as b}from"./chunk-QAYAQNCG.js";var k={name:"cut",summary:"remove sections from each line of files",usage:"cut [OPTION]... [FILE]...",options:["-c LIST select only these characters","-d DELIM use DELIM instead of TAB for field delimiter","-f LIST select only these fields","-s, --only-delimited do not print lines without delimiters"," --help display this help and exit"]};function M(r,o){let l=[],a=r.split(",");if(a.length>o)throw new h(`cut: range count limit exceeded (${o})`,"array_elements");for(let s of a)if(s.includes("-")){let[i,u]=s.split("-"),t=i?Number(i):1,f=u?Number(u):null;if(!Number.isSafeInteger(t)||t<1||f!==null&&(!Number.isSafeInteger(f)||f<t))throw new h("cut: invalid range","array_elements");l.push({start:t,end:f})}else{let i=Number(s);if(!Number.isSafeInteger(i)||i<1)throw new h("cut: invalid range","array_elements");l.push({start:i,end:i})}return l}function B(r,o){let l=[],a=new Set;for(let s of o){let i=s.start-1,u=s.end===null?r.length:s.end;for(let t=i;t<u&&t<r.length;t++)t>=0&&!a.has(t)&&(a.add(t),l.push(r[t]))}return l}var R={name:"cut",async execute(r,o){if(L(r))return v(k);let l=" ",a=null,s=null,i=!1,u=[];for(let n=0;n<r.length;n++){let e=r[n];if(e==="-d")l=r[++n]||" ";else if(e.startsWith("-d"))l=e.slice(2);else if(e==="-f")a=r[++n];else if(e.startsWith("-f"))a=e.slice(2);else if(e==="-c")s=r[++n];else if(e.startsWith("-c"))s=e.slice(2);else if(e==="-s"||e==="--only-delimited")i=!0;else{if(e.startsWith("--"))return b("cut",e);if(e.startsWith("-")){let d=!1;for(let c of e.slice(1))if(c==="s")i=!0;else if(!"dfc".includes(c)){d=!0;break}if(d)return b("cut",e)}else u.push(e)}}if(!a&&!s)return{stdout:"",stderr:`cut: you must specify a list of bytes, characters, or fields
|
|
3
3
|
`,exitCode:1};let t=await E(o,u,{cmdName:"cut"});if(!t.ok)return t.error;let m=(s?N(t.content):t.content).split(`
|
|
4
4
|
`);m.length>0&&m[m.length-1]===""&&m.pop();let x=M(a||s||"1",o.limits.maxArrayElements),g=new W(Math.min(o.limits.maxOutputSize,o.limits.maxStringLength),"cut"),S=0,I=n=>{if(!Number.isSafeInteger(n)||n<0||n>o.limits.maxLoopIterations-S)throw new h(`cut: range expansion limit exceeded (${o.limits.maxLoopIterations})`,"iterations");S+=n,o.executionScope?.consumeWork(n,"cut range expansion")};for(let n of m)if(s){let e=Array.from(n),d=[];for(let c of x){let y=c.start-1,w=c.end===null?e.length:c.end;I(Math.max(0,Math.min(w,e.length)-y));for(let p=y;p<w&&p<e.length;p++)p>=0&&d.push(e[p])}g.append(`${d.join("")}
|
|
5
5
|
`)}else{if(i&&!n.includes(l))continue;let e=n.split(l);for(let c of x){let y=c.start-1,w=c.end===null?e.length:c.end;I(Math.max(0,Math.min(w,e.length)-y))}let d=B(e,x);g.append(`${d.join(l)}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{a as E}from"./chunk-OB46N7Q7.js";import{a as ne,b as se}from"./chunk-DIRWTBKE.js";import{a as I}from"./chunk-U7UNEMLJ.js";import{l as A}from"./chunk-EFORKKSH.js";import{d as D}from"./chunk-GN6CQ3J4.js";import{a as ce,c as te}from"./chunk-QAYAQNCG.js";var ye="(standard input)";function he(t){let e=t.limits.maxLoopIterations,i=t.limits.maxArrayElements;return Math.max(e,Math.min(i,e*10))}function F(t){if(++t.operations>t.maxOperations)throw new A(`grep: glob operation limit exceeded (${t.maxOperations})`,"glob_operations")}function U(t){if(t.results>=t.maxResults)throw new A(`grep: array element limit exceeded (${t.maxResults})`,"array_elements");t.results++}var xe="[^\\s\\S]";function we(t){return t.split(`
|
|
3
|
+
`)}function Fe(t){if(t==="")return[];let e=t.split(`
|
|
4
|
+
`);return e[e.length-1]===""&&e.pop(),e}function ve(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 Ce={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"]},me={name:"grep",async execute(t,e){let i=!1,g=!1,f=!1,m=!1,c=!1,u=!1,l=!1,a=!1,h=!1,v=!1,$=!1,y=!1,x=!1,M=!1,_=!1,O=0,N=0,W=0,S=[],B=[],V=[],w=[],b=[],X=[],G=!0;for(let s=0;s<t.length;s++){let r=t[s];if(G&&r==="--"){G=!1;continue}if(G&&r==="--help")return ce(Ce);if(G&&r.startsWith("-")&&r!=="-"){if(r==="-e"&&s+1<t.length){w.push(t[++s]);continue}if(r.startsWith("--file=")){b.push(r.slice(7));continue}if(r.startsWith("--include=")){S.push(r.slice(10));continue}if(r.startsWith("--exclude=")){B.push(r.slice(10));continue}if(r.startsWith("--exclude-dir=")){V.push(r.slice(14));continue}if(r.startsWith("--max-count=")){O=parseInt(r.slice(12),10);continue}let C=r.match(/^-m(\d+)$/);if(C){O=parseInt(C[1],10);continue}if(r==="-m"&&s+1<t.length){O=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 q=n==="f"?d.slice(p+1).join(""):"";if(q.length>0)b.push(q);else if(s+1<t.length)b.push(t[++s]);else return{stdout:"",stderr:n==="f"?`grep: option requires an argument -- 'f'
|
|
5
|
+
`:`grep: option '--file' requires an argument
|
|
6
|
+
`,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")m=!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")l=!0;else if(n==="w"||n==="--word-regexp")a=!0;else if(n==="x"||n==="--line-regexp")h=!0;else if(n==="E"||n==="--extended-regexp")v=!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")_=!0;else{if(n.startsWith("--"))return te("grep",n);if(n.length===1)return te("grep",`-${n}`)}}}else X.push(r)}if(w.length===0&&b.length===0){let s=X.shift();if(s===void 0)return{stdout:"",stderr:`grep: missing pattern
|
|
7
|
+
`,exitCode:2};w.push(s)}w=w.flatMap(we);let Z=!1;for(let s of b){let r;if(s==="")return{stdout:"",stderr:`grep: : No such file or directory
|
|
8
|
+
`,exitCode:2};if(s==="-")r=Z?"":D(e.stdin),Z=!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
|
|
9
|
+
`,exitCode:2};r=await e.fs.readFile(o)}catch(o){return I(o),{stdout:"",stderr:`grep: ${s}: No such file or directory
|
|
10
|
+
`,exitCode:2}}let C=Fe(r);if(w.length+C.length>e.limits.maxArrayElements)throw new A(`grep: array element limit exceeded (${e.limits.maxArrayElements})`,"array_elements");w.push(...C)}if(w.length===0&&!f&&!u)return{stdout:"",stderr:"",exitCode:1};let J=X,Q=y?"fixed":v?"extended":$?"perl":"basic";if(Q==="perl"&&new Set(w).size>1)return{stdout:"",stderr:`grep: the -P option only supports a single pattern
|
|
11
|
+
`,exitCode:2};if(w.length>1&&Q!=="fixed")for(let s of w)try{se(s,{mode:Q})}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${s}
|
|
12
|
+
`,exitCode:2}}let re=w.length===0?{pattern:xe,mode:"extended"}:ve(w,Q),K,Y,L;try{let s=se(re.pattern,{mode:re.mode,ignoreCase:i,wholeWord:a,lineRegexp:h});K=s.regex,Y=s.kResetGroup,L=s.preFilter}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${w.join(`
|
|
13
|
+
`)}
|
|
14
|
+
`,exitCode:2}}if(J.length===0&&e.stdin!==void 0){let s=Z?"":D(e.stdin),r=ne(s,K,{invertMatch:f,showLineNumbers:g,countOnly:m,filename:"",onlyMatching:x,beforeContext:N,afterContext:W,maxCount:O,kResetGroup:Y,preFilter:L,maxWork:he(e),maxMatches:e.limits.maxArrayElements,signal:e.signal});return _?{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
|
|
15
|
+
`,exitCode:2};let H="",ie="",oe=!1,ae=!1,P=[],R={operations:0,results:0,maxOperations:e.limits.maxGlobOperations,maxResults:e.limits.maxArrayElements},ee=s=>{if(s.length>R.maxResults-P.length)throw new A(`grep: array element limit exceeded (${R.maxResults})`,"array_elements");P.push(...s)},le=!1,fe=!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:ye,isFile:!0,isStdin:!0,stdinAtEof:le}),le=!0;continue}if(fe=!0,s.includes("*")||s.includes("?")||s.includes("[")){let r=await Ee(s,e,R);if(l)for(let C of r){let o=await j(C.path,e,S,B,V,C.isFile,R);ee(o)}else ee(r)}else if(l){let r=await j(s,e,S,B,V,void 0,R);ee(r)}else{if(P.length>=R.maxResults)throw new A(`grep: array element limit exceeded (${R.maxResults})`,"array_elements");P.push({path:s})}}let ue=(P.length>1||l&&fe)&&!M,pe=50;for(let s=0;s<P.length;s+=pe){let r=P.slice(s,s+pe),C=await Promise.all(r.map(async o=>{let d=o.path,p=d.split("/").pop()||d;if(B.length>0&&!l&&!o.isStdin&&B.some(n=>E(p,n,{stripQuotes:!0}))||S.length>0&&!l&&!o.isStdin&&!S.some(n=>E(p,n,{stripQuotes:!0})))return null;try{let n;if(o.isStdin)n=o.stdinAtEof||e.stdin===void 0?"":D(e.stdin);else{let z=e.fs.resolvePath(e.cwd,d),T=!1;if(o.isFile===void 0?T=(await e.fs.stat(z)).isDirectory:T=!o.isFile,T)return l?null:{error:`grep: ${d}: Is a directory
|
|
16
|
+
`};n=await e.fs.readFile(z)}if(L&&!f){let z=L.ignoreCase?n.toLowerCase():n;if(!L.needles.some(T=>z.includes(T))){if(m){let T=ue?`${d}:0`:"0";return{file:d,result:{output:`${T}
|
|
17
|
+
`,matched:!1,matchCount:0}}}return{file:d,result:{output:"",matched:!1,matchCount:0}}}}let q=ne(n,K,{invertMatch:f,showLineNumbers:g,countOnly:m,filename:ue?d:"",onlyMatching:x,beforeContext:N,afterContext:W,maxCount:O,kResetGroup:Y,preFilter:L,maxWork:he(e),maxMatches:e.limits.maxArrayElements,signal:e.signal});return{file:d,result:q}}catch(n){return I(n),{error:`grep: ${d}: No such file or directory
|
|
18
|
+
`}}}));for(let o of C){if(o===null)continue;if("error"in o&&o.error){ie+=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(oe=!0,_)return{stdout:"",stderr:"",exitCode:0};c?H+=`${d}
|
|
19
|
+
`:u||(H+=p.output)}else u?H+=`${d}
|
|
20
|
+
`:m&&!c&&(H+=p.output)}}let k;return ae?k=2:k=oe?0:1,_?{stdout:"",stderr:"",exitCode:k}:{stdout:H,stderr:ie,exitCode:k}}},de=256;async function ge(t,e,i,g,f,m=0){if(m>=de)return;let c=i.fs.resolvePath(i.cwd,t);try{if(F(f),!(await i.fs.stat(c)).isDirectory){let a=t.split("/").pop()||"";if(e){let h=e.replace(/^\//,"");E(a,h,{stripQuotes:!0})&&(U(f),g.push(t))}return}F(f);let l=await i.fs.readdir(c);for(let a of l){let h=t==="."?a:`${t}/${a}`,v=i.fs.resolvePath(i.cwd,h);if(F(f),(await i.fs.stat(v)).isDirectory)await ge(h,e,i,g,f,m+1);else if(e){let y=e.replace(/^\//,"");E(a,y,{stripQuotes:!0})&&(U(f),g.push(h))}}}catch(u){I(u)}}async function Ee(t,e,i){let g=[],f=t.lastIndexOf("/"),m,c;if(f===-1?(m=e.cwd,c=t):(m=t.slice(0,f)||"/",c=t.slice(f+1)),t.includes("**")){let l=[],a=t.split("**"),h=a[0].replace(/\/$/,"")||".",v=a[1]||"";return await ge(h,v,e,l,i),l.map($=>({path:$}))}let u=e.fs.resolvePath(e.cwd,m);try{if(e.fs.readdirWithFileTypes){F(i);let l=await e.fs.readdirWithFileTypes(u);for(let a of l)if(F(i),E(a.name,c,{stripQuotes:!0})){let h=f===-1?a.name:`${m}/${a.name}`;U(i),g.push({path:h,isFile:a.isFile})}}else{F(i);let l=await e.fs.readdir(u);for(let a of l)if(F(i),E(a,c,{stripQuotes:!0})){let h=f===-1?a:`${m}/${a}`;U(i),g.push({path:h})}}}catch(l){I(l)}return g.sort((l,a)=>l.path.localeCompare(a.path))}async function j(t,e,i=[],g=[],f=[],m,c={operations:0,results:0,maxOperations:e.limits.maxGlobOperations,maxResults:e.limits.maxArrayElements},u=[],l=0){if(l>=de)return u;let a=e.fs.resolvePath(e.cwd,t);try{let h,v;if(m!==void 0)h=m,v=!m;else{F(c);let y=await e.fs.stat(a);h=y.isFile,v=y.isDirectory}if(h){let y=t.split("/").pop()||t;return g.length>0&&g.some(x=>E(y,x,{stripQuotes:!0}))||i.length>0&&!i.some(x=>E(y,x,{stripQuotes:!0}))||(U(c),u.push({path:t,isFile:!0})),u}if(!v)return u;let $=t.split("/").pop()||t;if(f.length>0&&f.some(y=>E($,y,{stripQuotes:!0})))return u;if(e.fs.readdirWithFileTypes){F(c);let y=await e.fs.readdirWithFileTypes(a);for(let x of y){if(F(c),x.name.startsWith("."))continue;let M=t==="."?x.name:`${t}/${x.name}`;await j(M,e,i,g,f,x.isFile,c,u,l+1)}}else{F(c);let y=await e.fs.readdir(a);for(let x of y){if(F(c),x.startsWith("."))continue;let M=t==="."?x:`${t}/${x}`;await j(M,e,i,g,f,void 0,c,u,l+1)}}}catch(h){I(h)}return u}var We={name:"fgrep",async execute(t,e){return me.execute(["-F",...t],e)}},Le={name:"egrep",async execute(t,e){return me.execute(["-E",...t],e)}},Ie={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},Oe={name:"fgrep",flags:[],stdinType:"text",needsArgs:!0},Se={name:"egrep",flags:[],stdinType:"text",needsArgs:!0};export{me as a,We as b,Le as c,Ie as d,Oe as e,Se as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{f as Y}from"./chunk-FIMO5HLX.js";import{a as P,b as J,c as D}from"./chunk-
|
|
2
|
+
import{f as Y}from"./chunk-FIMO5HLX.js";import{a as P,b as J,c as D}from"./chunk-DIRWTBKE.js";import{a as K}from"./chunk-L2UW7DWF.js";import{a as W}from"./chunk-7GA3QWJJ.js";import{a as N}from"./chunk-U7UNEMLJ.js";import{e as V}from"./chunk-DIWMSSQY.js";import{d as Z}from"./chunk-2WBUTDF5.js";import{l as M}from"./chunk-EFORKKSH.js";import{a as G,d as T,g as _}from"./chunk-GN6CQ3J4.js";import{a as q,b as H,c as O}from"./chunk-QAYAQNCG.js";var X=Y({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),A=class{types;constructor(){this.types=new Map(Object.entries(X).map(([t,s])=>[t,{extensions:[...s.extensions],globs:[...s.globs]}]))}addType(t){let s=t.indexOf(":");if(s===-1)return;let n=t.slice(0,s),r=t.slice(s+1);if(r.startsWith("include:")){let i=r.slice(8),l=this.types.get(i);if(l){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...l.extensions),o.globs.push(...l.globs),this.types.set(n,o)}}else{let i=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let l=r.slice(1);i.extensions.includes(l)||i.extensions.push(l)}else i.globs.includes(r)||i.globs.push(r);this.types.set(n,i)}}clearType(t){let s=this.types.get(t);s&&(s.extensions=[],s.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,s){let n=t.toLowerCase();for(let r of s){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(r);if(i){for(let l of i.extensions)if(n.endsWith(l))return!0;for(let l of i.globs)if(l.includes("*")){let o=l.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${o}$`,"i").test(t))return!0}else if(n===l.toLowerCase())return!0}}return!1}matchesAnyType(t){let s=t.toLowerCase();for(let n of this.types.values()){for(let r of n.extensions)if(s.endsWith(r))return!0;for(let r of n.globs)if(r.includes("*")){let i=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${i}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function Q(){let e=[];for(let[t,s]of Object.entries(X).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`}function ee(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:512*1024*1024,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function ue(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let s=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return s*1024;case"M":return s*1024*1024;case"G":return s*1024*1024*1024;default:return s}}function fe(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
5
5
|
`,exitCode:1}}function he(e,t){return!/^\d+$/.test(t)||!Number.isSafeInteger(Number(t))?{stdout:"",stderr:`rg: invalid --${e} value: ${t}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
+
import{c as u,d as l}from"./chunk-DIWMSSQY.js";import{a as r}from"./chunk-GN6CQ3J4.js";import{a as p,c as o}from"./chunk-QAYAQNCG.js";var y={name:"yes",summary:"output a string repeatedly",usage:"yes [STRING]...",description:["Repeatedly output a line with all specified STRING(s), or 'y'."],options:[" --help display this help and exit"],notes:["Real yes writes until its reader goes away. Pipelines here are not","streaming \u2014 a stage runs to completion before the next one starts \u2014 so","yes stops on its own after executionLimits.maxLoopIterations lines, or","earlier if the repeated line would exceed the output size limit.","`yes | head -3` therefore behaves as expected; an unbounded consumer","sees a finite stream."]},x={name:"yes",async execute(m,s){let t=[],i=!1;for(let e of m){if(i){t.push(e);continue}if(e==="--"){i=!0;continue}if(e==="--help")return p(y);if(e.startsWith("--"))return o("yes",e);if(e.startsWith("-")&&e!=="-")return o("yes",`-${e[1]}`);t.push(e)}let n=Math.min(s.limits.maxStringLength,s.limits.maxOutputSize),a=t.length>0?`${l(t," ",n,"yes")}
|
|
3
|
+
`:`y
|
|
4
|
+
`,d=Math.floor(n/r(a)),h=Math.min(s.limits.maxLoopIterations,Math.max(1,d));return{stdout:u(a,h,n,"yes"),stderr:"",exitCode:0}}},w={name:"yes",flags:[]};export{x as a,w as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{b as P,c as F,d as O,e as T}from"./chunk-
|
|
2
|
+
import{b as P,c as F,d as O,e as T}from"./chunk-2WBUTDF5.js";import{b as S}from"./chunk-YUSFCOM7.js";import{l as v,m as w}from"./chunk-EFORKKSH.js";import{a as D}from"./chunk-W5DWRFSU.js";import{a as E}from"./chunk-QIQMJJZ4.js";import{a as $,b as C}from"./chunk-QAYAQNCG.js";var R={name:"cp",summary:"copy files and directories",usage:"cp [OPTION]... SOURCE... DEST",options:["-r, -R, --recursive copy directories recursively","-n, --no-clobber do not overwrite an existing file","-p, --preserve preserve file attributes","-v, --verbose explain what is being done"," --help display this help and exit"]},H={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},noClobber:{short:"n",long:"no-clobber",type:"boolean"},preserve:{short:"p",long:"preserve",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},j={name:"cp",async execute(u,e){if(C(u))return $(R);let s=E("cp",u,H);if(!s.ok)return s.error;let d=s.result.flags.recursive||s.result.flags.recursiveUpper,k=s.result.flags.noClobber,A=s.result.flags.preserve,N=s.result.flags.verbose,p=s.result.positional;if(p.length<2)return{stdout:"",stderr:`cp: missing destination file operand
|
|
3
3
|
`,exitCode:1};let g=p.pop()??"",m=p,l=e.fs.resolvePath(e.cwd,g),y="",n="",i=0,h=new O({limits:e.limits,signal:e.signal,executionScope:e.executionScope,site:"cp"}),f=!1;try{f=(await e.fs.stat(l)).isDirectory}catch{}if(m.length>1&&!f)return{stdout:"",stderr:`cp: target '${g}' is not a directory
|
|
4
4
|
`,exitCode:1};for(let t of m)try{let o=e.fs.resolvePath(e.cwd,t),a=await e.fs.stat(o),r=l;if(f){let c=t.split("/").pop()||t;r=l==="/"?`/${c}`:`${l}/${c}`}if(a.isDirectory&&!d){n+=`cp: -r not specified; omitting directory '${t}'
|
|
5
5
|
`,i=1;continue}if(a.isDirectory){let c=await F(e.fs,o,r,h);if(S(o,r)||c==="inside"){n+=`cp: cannot copy '${t}' into itself, '${r}'
|