just-bash 3.3.0 → 3.4.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 +6 -0
- package/dist/bin/chunks/{awk2-7UZLEPVX.js → awk2-DZN2ZRSE.js} +1 -1
- package/dist/bin/{shell/chunks/base64-W6FVFNXJ.js → chunks/base64-TP4NUOEB.js} +1 -1
- package/dist/bin/chunks/{cat-5YECZSFQ.js → cat-A3REFE6L.js} +1 -1
- package/dist/bin/{shell/chunks/chmod-45TMYSW2.js → chunks/chmod-PHPDPTZD.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-DSZQ22OX.js → chunks/chunk-35BSNGJK.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-BWRQ5HYX.js → chunks/chunk-3DCUOX7D.js} +1 -1
- package/dist/bin/chunks/{chunk-OKU677H3.js → chunk-57BWX3A3.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-XAAXPEOP.js → chunks/chunk-62NF3462.js} +1 -1
- package/dist/bin/chunks/{chunk-3OYRDLJJ.js → chunk-6KTOOQK6.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-IJIJAQBT.js → chunks/chunk-6WNZWDBA.js} +1 -1
- package/dist/bin/chunks/{chunk-QK6BXSHU.js → chunk-7NMBLWZ5.js} +1 -1
- package/dist/bin/chunks/{chunk-W4U4QOZF.js → chunk-BPMGKB5E.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-NGD6G5ZG.js → chunks/chunk-BXDEO6VY.js} +1 -1
- package/dist/bin/chunks/{chunk-ZXIW4JPL.js → chunk-DX5LO7JF.js} +1 -1
- package/dist/bin/chunks/{chunk-SSK3N7FN.js → chunk-EJIZDPMG.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-PQPFDJFF.js → chunks/chunk-FC5CC5UP.js} +1 -1
- package/dist/bin/chunks/chunk-FE6GSISP.js +22 -0
- package/dist/bin/{shell/chunks/chunk-VTAIIBJT.js → chunks/chunk-GE5ERIO2.js} +1 -1
- package/dist/bin/chunks/{chunk-KXWWWQZK.js → chunk-GGPUS2B4.js} +1 -1
- package/dist/bin/chunks/{chunk-WWOUFMMY.js → chunk-IHS3YLRI.js} +1 -1
- package/dist/bin/chunks/{chunk-TROO33BG.js → chunk-KHS7PCAP.js} +2 -2
- package/dist/bin/chunks/chunk-KP2UH5CJ.js +22 -0
- package/dist/bin/chunks/{chunk-B7RRNV3A.js → chunk-MLJZPRDV.js} +1 -1
- package/dist/bin/chunks/{chunk-USMDLXMM.js → chunk-MOCKUJD6.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-TPU3OX2A.js → chunks/chunk-NFYXRUSI.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-IAAPXDHN.js → chunks/chunk-NWBQ75GZ.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-D5G3L4PR.js → chunks/chunk-O5R7J45W.js} +1 -1
- package/dist/bin/chunks/{chunk-7I6MNC5I.js → chunk-OD2SHTFL.js} +1 -1
- package/dist/bin/chunks/{chunk-BNYIXXC2.js → chunk-ODCVIRIN.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-NJ67YJRE.js → chunks/chunk-ODPB5AH7.js} +1 -1
- package/dist/bin/chunks/chunk-QUWWWM4E.js +276 -0
- package/dist/bin/chunks/{chunk-XAVWLYZR.js → chunk-ROFYAVPF.js} +1 -1
- package/dist/bin/chunks/chunk-SHAOH2UJ.js +5 -0
- package/dist/bin/chunks/{chunk-PKWK3LQM.js → chunk-SOKKZSUV.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-WSLBBXPJ.js → chunks/chunk-TIYIKCEZ.js} +1 -1
- package/dist/bin/chunks/{chunk-4SQKKW2M.js → chunk-TKBTWIXO.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-VY2K25J4.js → chunks/chunk-TOTKK2XI.js} +1 -1
- package/dist/bin/chunks/{chunk-X63MJBLH.js → chunk-TY77F4UM.js} +1 -1
- package/dist/bin/chunks/{chunk-CB4SODHK.js → chunk-XBX7KFWK.js} +19 -19
- package/dist/bin/{shell/chunks/chunk-GEUCQ4AB.js → chunks/chunk-XG7YUZ3R.js} +1 -1
- package/dist/bin/chunks/chunk-YABXNPH6.js +65 -0
- package/dist/bin/chunks/{chunk-6UK23ZFT.js → chunk-YB3A42T5.js} +1 -1
- package/dist/bin/chunks/{chunk-MZM7RVYU.js → chunk-YBTJPT3R.js} +1 -1
- package/dist/bin/chunks/{chunk-X5VUGFUL.js → chunk-Z7QCL4IA.js} +1 -1
- package/dist/bin/{shell/chunks/expr-56X7LYOS.js → chunks/expr-FAB3XEIB.js} +1 -1
- package/dist/bin/{shell/chunks/file-SQSOBJLR.js → chunks/file-ZHL2YACR.js} +1 -1
- package/dist/bin/chunks/{find-XY2NTAT5.js → find-6DH6TRDN.js} +1 -1
- package/dist/bin/chunks/{flag-coverage-EB3DK32J.js → flag-coverage-SPPGTKG3.js} +1 -1
- package/dist/bin/{shell/chunks/grep-73YHJEX4.js → chunks/grep-FBVRTH4M.js} +1 -1
- package/dist/bin/chunks/{gzip-DJSFJOY6.js → gzip-AWQGRTSF.js} +1 -1
- package/dist/bin/chunks/{head-KPRH4HKC.js → head-A7CPWX7R.js} +1 -1
- package/dist/bin/{shell/chunks/html-to-markdown-WUBAMB4O.js → chunks/html-to-markdown-EMODJ24M.js} +1 -1
- package/dist/bin/chunks/{jq-AO5GTPN4.js → jq-DXL4NMI5.js} +1 -1
- package/dist/bin/chunks/{js-exec-4KNUPGHA.js → js-exec-BFLXGNPQ.js} +1 -1
- package/dist/bin/chunks/{ls-FTHYNINH.js → ls-R6DAGGBH.js} +1 -1
- package/dist/bin/{shell/chunks/od-A7CW5RMS.js → chunks/od-ZPR6FUOW.js} +1 -1
- package/dist/bin/{shell/chunks/paste-YJLYVJMP.js → chunks/paste-RQKXCKQO.js} +1 -1
- package/dist/bin/chunks/{python3-N252MJV6.js → python3-WKVKCO33.js} +1 -1
- package/dist/bin/{shell/chunks/rg-OGGL3RIE.js → chunks/rg-34TWIR7N.js} +1 -1
- package/dist/bin/{shell/chunks/sed-QJ2LNV2N.js → chunks/sed-SW74NKGU.js} +1 -1
- package/dist/bin/chunks/{sleep-FUDWGDCE.js → sleep-J2AVORMB.js} +1 -1
- package/dist/bin/{shell/chunks/split-7IYQYKOW.js → chunks/split-EDDYGW4A.js} +1 -1
- package/dist/bin/chunks/{sqlite3-FEUFATVW.js → sqlite3-AZ27WWV7.js} +1 -1
- package/dist/bin/{shell/chunks/stat-Y5D3VPLG.js → chunks/stat-XNGV2W6W.js} +1 -1
- package/dist/bin/chunks/{tail-QISQLA3I.js → tail-H2WOZSEI.js} +1 -1
- package/dist/bin/chunks/{tar-TB2XWXF6.js → tar-MZP7QXR4.js} +1 -1
- package/dist/bin/{shell/chunks/timeout-TDOV6JDA.js → chunks/timeout-GH6S72QX.js} +1 -1
- package/dist/bin/chunks/{tr-AR6EK7JH.js → tr-RVCBERJ4.js} +1 -1
- package/dist/bin/chunks/undici-CKF2L2IP.js +141 -0
- package/dist/bin/chunks/{xan-Q52EBQYW.js → xan-BSNJF6SH.js} +1 -1
- package/dist/bin/chunks/{xan-view-QGKWT354.js → xan-view-H3LNQ72O.js} +1 -1
- package/dist/bin/chunks/{yq-UA5NX5RT.js → yq-GNMXK6OP.js} +1 -1
- package/dist/bin/just-bash.js +332 -332
- package/dist/bin/shell/chunks/{awk2-7UZLEPVX.js → awk2-DZN2ZRSE.js} +1 -1
- package/dist/bin/{chunks/base64-W6FVFNXJ.js → shell/chunks/base64-TP4NUOEB.js} +1 -1
- package/dist/bin/shell/chunks/{cat-5YECZSFQ.js → cat-A3REFE6L.js} +1 -1
- package/dist/bin/{chunks/chmod-45TMYSW2.js → shell/chunks/chmod-PHPDPTZD.js} +1 -1
- package/dist/bin/{chunks/chunk-DSZQ22OX.js → shell/chunks/chunk-35BSNGJK.js} +1 -1
- package/dist/bin/{chunks/chunk-BWRQ5HYX.js → shell/chunks/chunk-3DCUOX7D.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-OKU677H3.js → chunk-57BWX3A3.js} +1 -1
- package/dist/bin/{chunks/chunk-XAAXPEOP.js → shell/chunks/chunk-62NF3462.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-3OYRDLJJ.js → chunk-6KTOOQK6.js} +1 -1
- package/dist/bin/{chunks/chunk-IJIJAQBT.js → shell/chunks/chunk-6WNZWDBA.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-QK6BXSHU.js → chunk-7NMBLWZ5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-W4U4QOZF.js → chunk-BPMGKB5E.js} +1 -1
- package/dist/bin/{chunks/chunk-NGD6G5ZG.js → shell/chunks/chunk-BXDEO6VY.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-ZXIW4JPL.js → chunk-DX5LO7JF.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-SSK3N7FN.js → chunk-EJIZDPMG.js} +1 -1
- package/dist/bin/{chunks/chunk-PQPFDJFF.js → shell/chunks/chunk-FC5CC5UP.js} +1 -1
- package/dist/bin/shell/chunks/chunk-FE6GSISP.js +22 -0
- package/dist/bin/{chunks/chunk-VTAIIBJT.js → shell/chunks/chunk-GE5ERIO2.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-KXWWWQZK.js → chunk-GGPUS2B4.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-WWOUFMMY.js → chunk-IHS3YLRI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-TROO33BG.js → chunk-KHS7PCAP.js} +2 -2
- package/dist/bin/shell/chunks/chunk-KP2UH5CJ.js +22 -0
- package/dist/bin/shell/chunks/{chunk-B7RRNV3A.js → chunk-MLJZPRDV.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-USMDLXMM.js → chunk-MOCKUJD6.js} +1 -1
- package/dist/bin/{chunks/chunk-TPU3OX2A.js → shell/chunks/chunk-NFYXRUSI.js} +1 -1
- package/dist/bin/{chunks/chunk-IAAPXDHN.js → shell/chunks/chunk-NWBQ75GZ.js} +1 -1
- package/dist/bin/{chunks/chunk-D5G3L4PR.js → shell/chunks/chunk-O5R7J45W.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-7I6MNC5I.js → chunk-OD2SHTFL.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-BNYIXXC2.js → chunk-ODCVIRIN.js} +1 -1
- package/dist/bin/{chunks/chunk-NJ67YJRE.js → shell/chunks/chunk-ODPB5AH7.js} +1 -1
- package/dist/bin/shell/chunks/chunk-QUWWWM4E.js +276 -0
- package/dist/bin/shell/chunks/{chunk-XAVWLYZR.js → chunk-ROFYAVPF.js} +1 -1
- package/dist/bin/shell/chunks/chunk-SHAOH2UJ.js +5 -0
- package/dist/bin/shell/chunks/{chunk-PKWK3LQM.js → chunk-SOKKZSUV.js} +1 -1
- package/dist/bin/{chunks/chunk-WSLBBXPJ.js → shell/chunks/chunk-TIYIKCEZ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-4SQKKW2M.js → chunk-TKBTWIXO.js} +1 -1
- package/dist/bin/{chunks/chunk-VY2K25J4.js → shell/chunks/chunk-TOTKK2XI.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-X63MJBLH.js → chunk-TY77F4UM.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-CB4SODHK.js → chunk-XBX7KFWK.js} +19 -19
- package/dist/bin/{chunks/chunk-GEUCQ4AB.js → shell/chunks/chunk-XG7YUZ3R.js} +1 -1
- package/dist/bin/shell/chunks/chunk-YABXNPH6.js +65 -0
- package/dist/bin/shell/chunks/{chunk-6UK23ZFT.js → chunk-YB3A42T5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-MZM7RVYU.js → chunk-YBTJPT3R.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-X5VUGFUL.js → chunk-Z7QCL4IA.js} +1 -1
- package/dist/bin/{chunks/expr-56X7LYOS.js → shell/chunks/expr-FAB3XEIB.js} +1 -1
- package/dist/bin/{chunks/file-SQSOBJLR.js → shell/chunks/file-ZHL2YACR.js} +1 -1
- package/dist/bin/shell/chunks/{find-XY2NTAT5.js → find-6DH6TRDN.js} +1 -1
- package/dist/bin/shell/chunks/{flag-coverage-EB3DK32J.js → flag-coverage-SPPGTKG3.js} +1 -1
- package/dist/bin/{chunks/grep-73YHJEX4.js → shell/chunks/grep-FBVRTH4M.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-DJSFJOY6.js → gzip-AWQGRTSF.js} +1 -1
- package/dist/bin/shell/chunks/{head-KPRH4HKC.js → head-A7CPWX7R.js} +1 -1
- package/dist/bin/{chunks/html-to-markdown-WUBAMB4O.js → shell/chunks/html-to-markdown-EMODJ24M.js} +1 -1
- package/dist/bin/shell/chunks/{jq-AO5GTPN4.js → jq-DXL4NMI5.js} +1 -1
- package/dist/bin/shell/chunks/{js-exec-4KNUPGHA.js → js-exec-BFLXGNPQ.js} +1 -1
- package/dist/bin/shell/chunks/{ls-FTHYNINH.js → ls-R6DAGGBH.js} +1 -1
- package/dist/bin/{chunks/od-A7CW5RMS.js → shell/chunks/od-ZPR6FUOW.js} +1 -1
- package/dist/bin/{chunks/paste-YJLYVJMP.js → shell/chunks/paste-RQKXCKQO.js} +1 -1
- package/dist/bin/shell/chunks/{python3-N252MJV6.js → python3-WKVKCO33.js} +1 -1
- package/dist/bin/{chunks/rg-OGGL3RIE.js → shell/chunks/rg-34TWIR7N.js} +1 -1
- package/dist/bin/{chunks/sed-QJ2LNV2N.js → shell/chunks/sed-SW74NKGU.js} +1 -1
- package/dist/bin/shell/chunks/{sleep-FUDWGDCE.js → sleep-J2AVORMB.js} +1 -1
- package/dist/bin/{chunks/split-7IYQYKOW.js → shell/chunks/split-EDDYGW4A.js} +1 -1
- package/dist/bin/shell/chunks/{sqlite3-FEUFATVW.js → sqlite3-AZ27WWV7.js} +1 -1
- package/dist/bin/{chunks/stat-Y5D3VPLG.js → shell/chunks/stat-XNGV2W6W.js} +1 -1
- package/dist/bin/shell/chunks/{tail-QISQLA3I.js → tail-H2WOZSEI.js} +1 -1
- package/dist/bin/shell/chunks/{tar-TB2XWXF6.js → tar-MZP7QXR4.js} +1 -1
- package/dist/bin/{chunks/timeout-TDOV6JDA.js → shell/chunks/timeout-GH6S72QX.js} +1 -1
- package/dist/bin/shell/chunks/{tr-AR6EK7JH.js → tr-RVCBERJ4.js} +1 -1
- package/dist/bin/shell/chunks/undici-CKF2L2IP.js +141 -0
- package/dist/bin/shell/chunks/{xan-Q52EBQYW.js → xan-BSNJF6SH.js} +1 -1
- package/dist/bin/shell/chunks/{xan-view-QGKWT354.js → xan-view-H3LNQ72O.js} +1 -1
- package/dist/bin/shell/chunks/{yq-UA5NX5RT.js → yq-GNMXK6OP.js} +1 -1
- package/dist/bin/shell/shell.js +259 -259
- package/dist/bundle/browser.js +525 -525
- package/dist/bundle/chunks/{awk2-IPNBFNH2.js → awk2-IDCJYLV2.js} +1 -1
- package/dist/bundle/chunks/{base64-OXGTKKDA.js → base64-3XQZ3ADB.js} +1 -1
- package/dist/bundle/chunks/{cat-636HYSH4.js → cat-XWS72C47.js} +1 -1
- package/dist/bundle/chunks/{chmod-4CIOYX5Q.js → chmod-6FVWFWKL.js} +1 -1
- package/dist/bundle/chunks/{chunk-6IUGGJ2Y.js → chunk-264HW33U.js} +1 -1
- package/dist/bundle/chunks/{chunk-LGLR6TFP.js → chunk-2TLWENMK.js} +1 -1
- package/dist/bundle/chunks/{chunk-FBXMKFE2.js → chunk-4HMWZAP7.js} +1 -1
- package/dist/bundle/chunks/{chunk-EAQUR2NP.js → chunk-4MPKG4PJ.js} +1 -1
- package/dist/bundle/chunks/{chunk-LJRVJXUI.js → chunk-4X2R47I5.js} +1 -1
- package/dist/bundle/chunks/{chunk-J5G3ZBEK.js → chunk-5GI2HJYO.js} +1 -1
- package/dist/bundle/chunks/{chunk-PJWSSENQ.js → chunk-6D2ZCRTO.js} +1 -1
- package/dist/bundle/chunks/chunk-6RK4AAB7.js +21 -0
- package/dist/bundle/chunks/{chunk-H3PXMIY3.js → chunk-73DVPW3C.js} +1 -1
- package/dist/bundle/chunks/{chunk-3ZBJCAAR.js → chunk-CA7HMEGG.js} +1 -1
- package/dist/bundle/chunks/{chunk-SELXJ5KQ.js → chunk-CVMQI27W.js} +1 -1
- package/dist/bundle/chunks/{chunk-ORDZCFFT.js → chunk-CYCUGNN7.js} +1 -1
- package/dist/bundle/chunks/{chunk-UB6T3UHL.js → chunk-ENMIHC6G.js} +1 -1
- package/dist/bundle/chunks/{chunk-FHFPWM4W.js → chunk-EVJMYTCY.js} +2 -2
- package/dist/bundle/chunks/{chunk-JYQ6MII2.js → chunk-EZFSCUSP.js} +1 -1
- package/dist/bundle/chunks/{chunk-E3D4WVAH.js → chunk-FFNWVPYL.js} +1 -1
- package/dist/bundle/chunks/{chunk-MF4F4ZPP.js → chunk-GP3D65AC.js} +1 -1
- package/dist/bundle/chunks/{chunk-IHGFM3FN.js → chunk-HZYCWAEC.js} +1 -1
- package/dist/bundle/chunks/{chunk-QTLI5LUD.js → chunk-JQL34RLH.js} +1 -1
- package/dist/bundle/chunks/{chunk-JCPCQREJ.js → chunk-KBXRZGTY.js} +1 -1
- package/dist/bundle/chunks/{chunk-CN3HTJTZ.js → chunk-KESUKNUF.js} +1 -1
- package/dist/bundle/chunks/{chunk-XVL654YD.js → chunk-KVG5FR5F.js} +19 -19
- package/dist/bundle/chunks/{chunk-KKVPMNSS.js → chunk-LDCENVG4.js} +1 -1
- package/dist/bundle/chunks/chunk-M7DIEMEN.js +275 -0
- package/dist/bundle/chunks/{chunk-MAWVZWRK.js → chunk-MMSRUX6V.js} +1 -1
- package/dist/bundle/chunks/{chunk-INHMNORI.js → chunk-MP3NNO6W.js} +1 -1
- package/dist/bundle/chunks/{chunk-AI5LSBJC.js → chunk-QKQP2SCP.js} +1 -1
- package/dist/bundle/chunks/{chunk-OTYP7VVT.js → chunk-QNXJ5FEA.js} +1 -1
- package/dist/bundle/chunks/{chunk-K3XJ2WT4.js → chunk-QXYDKHGI.js} +1 -1
- package/dist/bundle/chunks/chunk-RT7ROXPF.js +4 -0
- package/dist/bundle/chunks/{chunk-LTCWFMCI.js → chunk-TUNYNC46.js} +1 -1
- package/dist/bundle/chunks/{chunk-FC5NW7U4.js → chunk-UGU4ZDZA.js} +1 -1
- package/dist/bundle/chunks/{chunk-D3W7DTI6.js → chunk-VPJHPG6G.js} +1 -1
- package/dist/bundle/chunks/{chunk-5HXWWNWH.js → chunk-VQCA62JK.js} +1 -1
- package/dist/bundle/chunks/{chunk-NNH4ERNJ.js → chunk-W4IV5QW4.js} +1 -1
- package/dist/bundle/chunks/{chunk-3DHFIWMM.js → chunk-XJWBSZIU.js} +1 -1
- package/dist/bundle/chunks/{chunk-VOSNSQE2.js → chunk-XOBSBDA5.js} +1 -1
- package/dist/bundle/chunks/chunk-XW6UBSKO.js +64 -0
- package/dist/bundle/chunks/{chunk-UK4BO5W3.js → chunk-XZZSXYTK.js} +1 -1
- package/dist/bundle/chunks/{expr-SHRJJ4PX.js → expr-VKQHAJNO.js} +1 -1
- package/dist/bundle/chunks/{file-YC4YEI4P.js → file-WGI2QYXG.js} +1 -1
- package/dist/bundle/chunks/{find-DWWMZFO5.js → find-PM3TD7V4.js} +1 -1
- package/dist/bundle/chunks/{flag-coverage-UV7GI2DF.js → flag-coverage-6LWPOTGE.js} +1 -1
- package/dist/bundle/chunks/{grep-UDCQDUQK.js → grep-SAEHL7UZ.js} +1 -1
- package/dist/bundle/chunks/{gzip-BTI6CWY4.js → gzip-2SHFSHNB.js} +1 -1
- package/dist/bundle/chunks/{head-UCOA3VQC.js → head-RMKV5HCV.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-NUF6QEX4.js → html-to-markdown-GEKF6U7Z.js} +1 -1
- package/dist/bundle/chunks/{jq-B5324QOX.js → jq-MW2VEOCW.js} +1 -1
- package/dist/bundle/chunks/{js-exec-PNUEDFT5.js → js-exec-J4DLDAWY.js} +1 -1
- package/dist/bundle/chunks/{od-YXD2NNIU.js → od-26HTHXXM.js} +1 -1
- package/dist/bundle/chunks/{paste-ZU3EODNI.js → paste-WIDT5N6N.js} +1 -1
- package/dist/bundle/chunks/{python3-ETPBGJP3.js → python3-4Q7M5CDT.js} +1 -1
- package/dist/bundle/chunks/{rg-XCX2J2RF.js → rg-IA4UE2UF.js} +1 -1
- package/dist/bundle/chunks/{sed-TZIPJOGL.js → sed-LSWWSQ6J.js} +1 -1
- package/dist/bundle/chunks/{sleep-VPYWSKDR.js → sleep-YMKR4HFQ.js} +1 -1
- package/dist/bundle/chunks/{split-KNDNAFPT.js → split-EATPU6Q7.js} +1 -1
- package/dist/bundle/chunks/{sqlite3-ZTQJIC3G.js → sqlite3-XXXHFJGP.js} +1 -1
- package/dist/bundle/chunks/{stat-MLNSW25G.js → stat-AKB6X3TV.js} +1 -1
- package/dist/bundle/chunks/{tail-G3W6PNG3.js → tail-OEM7DTYC.js} +1 -1
- package/dist/bundle/chunks/{tar-GLX6QUHW.js → tar-26DH77YN.js} +1 -1
- package/dist/bundle/chunks/{timeout-SYQCWBMZ.js → timeout-FOKHN3GQ.js} +1 -1
- package/dist/bundle/chunks/{tr-3KPFH3J4.js → tr-VUNRKFC3.js} +1 -1
- package/dist/bundle/chunks/undici-PSPBDOYF.js +140 -0
- package/dist/bundle/chunks/{xan-EGU5VRRP.js → xan-LUEGYXLV.js} +1 -1
- package/dist/bundle/chunks/{xan-view-47P277LZ.js → xan-view-MDMZTFFI.js} +1 -1
- package/dist/bundle/chunks/{yq-FMWLA3S2.js → yq-B7E6UX7Y.js} +1 -1
- package/dist/bundle/index.cjs +885 -900
- package/dist/bundle/index.js +230 -230
- package/dist/types.d.ts +7 -0
- package/package.json +21 -21
- package/dist/bin/chunks/chunk-46CDVHZ3.js +0 -5
- package/dist/bin/chunks/chunk-D3MUBZ4P.js +0 -65
- package/dist/bin/chunks/chunk-DKIOFM35.js +0 -291
- package/dist/bin/chunks/chunk-LGERQ5TD.js +0 -22
- package/dist/bin/chunks/chunk-LNFTLSWJ.js +0 -22
- package/dist/bin/chunks/undici-JES22UVU.js +0 -141
- package/dist/bin/shell/chunks/chunk-46CDVHZ3.js +0 -5
- package/dist/bin/shell/chunks/chunk-D3MUBZ4P.js +0 -65
- package/dist/bin/shell/chunks/chunk-DKIOFM35.js +0 -291
- package/dist/bin/shell/chunks/chunk-LGERQ5TD.js +0 -22
- package/dist/bin/shell/chunks/chunk-LNFTLSWJ.js +0 -22
- package/dist/bin/shell/chunks/undici-JES22UVU.js +0 -141
- package/dist/bundle/chunks/chunk-EZDB7TGH.js +0 -290
- package/dist/bundle/chunks/chunk-T2RHALUC.js +0 -64
- package/dist/bundle/chunks/chunk-UBTKJ6MG.js +0 -4
- package/dist/bundle/chunks/chunk-Y3DGIAIG.js +0 -21
- package/dist/bundle/chunks/undici-HCLAUJT3.js +0 -140
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-
|
|
2
|
+
import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-XJWBSZIU.js";import{b as V,d as Qe}from"./chunk-5GI2HJYO.js";import{d as Ge,f as Xe,g as oe}from"./chunk-FIMO5HLX.js";import{a as Z}from"./chunk-KVG5FR5F.js";import{b as Ye}from"./chunk-CHHWTPDH.js";import{a as q}from"./chunk-4X2R47I5.js";import{a as W,c as se,d as re}from"./chunk-AH7VTVWU.js";import{l as E}from"./chunk-EFORKKSH.js";import{a as K,d as Y}from"./chunk-GN6CQ3J4.js";import{a as J,b as ne}from"./chunk-QAYAQNCG.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
|
|
3
3
|
`||t==="\r")this.pos++;else if(t==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
4
4
|
`;)this.pos++;else break}}nextToken(){let t=this.pos,n=this.input[this.pos];if(n>="0"&&n<="9")return this.readNumber();if(n==='"'||n==="'"||n==="`")return this.readString(n);if(n==="b"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==='"'||o==="'"||o==="`")return this.pos++,this.readString(o)}if(n==="/"){let o=this.tokens[this.tokens.length-1];return o&&(o.type==="int"||o.type==="float"||o.type==="string"||o.type==="ident"||o.type===")"||o.type==="]")?this.input[this.pos+1]==="/"?(this.pos+=2,{type:"//",value:"//",pos:t}):(this.pos++,{type:"/",value:"/",pos:t}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:t};if(this.match("=>"))return{type:"=>",value:"=>",pos:t};if(this.match("**"))return{type:"**",value:"**",pos:t};if(this.match("++"))return{type:"++",value:"++",pos:t};if(this.match("//"))return{type:"//",value:"//",pos:t};if(this.match("=="))return{type:"==",value:"==",pos:t};if(this.match("!="))return{type:"!=",value:"!=",pos:t};if(this.match("<="))return{type:"<=",value:"<=",pos:t};if(this.match(">="))return{type:">=",value:">=",pos:t};if(this.match("&&"))return{type:"&&",value:"&&",pos:t};if(this.match("||"))return{type:"||",value:"||",pos:t};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(n);if(r!==void 0)return this.pos++,{type:r,value:n,pos:t};if(this.isIdentStart(n))return this.readIdentifier();throw new Error(`Unexpected character '${n}' at position ${this.pos}`)}match(t){if(this.input.slice(this.pos,this.pos+t.length)===t){if(/^[a-zA-Z]/.test(t)){let n=this.input[this.pos+t.length];if(n&&this.isIdentChar(n))return!1}return this.pos+=t.length,!0}return!1}isIdentStart(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"}isIdentChar(t){return this.isIdentStart(t)||t>="0"&&t<="9"}readNumber(){let t=this.pos,n=!1,s=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(o>="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!n&&!s)n=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,n=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]==="+"||this.input[this.pos]==="-")&&this.pos++;else break}let r=this.input.slice(t,this.pos).replace(/_/g,"");return{type:n?"float":"int",value:r,pos:t}}readString(t){let n=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===t)return this.pos++,{type:"string",value:s,pos:n};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
|
|
5
5
|
`;break;case"r":s+="\r";break;case"t":s+=" ";break;case"\\":s+="\\";break;case'"':s+='"';break;case"'":s+="'";break;case"`":s+="`";break;case"0":s+="\0";break;default:s+=o}this.pos++}}else s+=r,this.pos++}throw new Error(`Unterminated string starting at position ${n}`)}readRegex(){let t=this.pos;this.pos++;let n="",s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r==="/"){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]==="i";)s+=this.input[this.pos],this.pos++;return{type:"regex",value:n+(s?`/${s}`:""),pos:t}}r==="\\"?(n+=r,this.pos++,this.pos<this.input.length&&(n+=this.input[this.pos],this.pos++)):(n+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${t}`)}readIdentifier(){let t=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let n=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(n=!0,this.pos++);let s=this.input.slice(t,n?this.pos-1:this.pos);n&&(s+="?");let r=new Map([["true","true"],["false","false"],["null","null"],["and","and"],["or","or"],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["in","in"],["as","as"],["_","_"]]),o=s.replace(/\?$/,""),i=r.get(o);return i!==void 0&&!n?{type:i,value:o,pos:t}:{type:"ident",value:s,pos:t}}};function z(e){return{maxSourceLength:e.limits.maxStringLength,maxTokens:e.limits.maxQueryTokens,maxAstNodes:e.limits.maxQueryElements,maxOperations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth}}var D={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},ee=class{pos=0;tokens;depth=0;operations=0;astNodes=0;limits;constructor(t,n={}){this.tokens=t,this.limits={maxSourceLength:n.maxSourceLength??1024*1024,maxTokens:n.maxTokens??1e5,maxDepth:n.maxDepth??100,maxOperations:n.maxOperations??1e5,maxAstNodes:n.maxAstNodes??1e5};let s=0;for(let r of t)this.useOperation(),r.type==="("||r.type==="["||r.type==="{"?(s++,s>this.limits.maxDepth&&this.throwDepthLimit()):(r.type===")"||r.type==="]"||r.type==="}")&&(s=Math.max(0,s-1))}parse(){let t=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return t}parseExpr(t){return this.withDepth(()=>this.parseExprInner(t))}parseExprInner(t){let n=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<t)break;n=this.parseInfix(n,r)}return n}useOperation(t=1){if(t>this.limits.maxOperations-this.operations)throw new E(`xan: expression parser operation limit exceeded (${this.limits.maxOperations})`,"iterations");this.operations+=t}withDepth(t){this.depth>=this.limits.maxDepth&&this.throwDepthLimit(),this.depth++;try{return t()}finally{this.depth--}}throwDepthLimit(){throw new E(`xan: expression parser depth limit exceeded (${this.limits.maxDepth})`,"recursion")}addAstNode(){if(this.astNodes>=this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements");this.astNodes++}parsePrefix(){let t=this.peek();switch(t.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(t.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(t.value)};case"string":return this.advance(),{type:"string",value:t.value};case"regex":{this.advance();let n=t.value.split("/"),s=n.length>1?n[n.length-1]:"";return{type:"regex",pattern:n.slice(0,-1).join("/")||t.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let n=t.value,s=n.endsWith("?"),r=s?n.slice(0,-1):n;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let n=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let i=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:i},r)}this.pos=n}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let n=this.parseExpr(D.UNARY);return n.type==="int"?{type:"int",value:-n.value}:n.type==="float"?{type:"float",value:-n.value}:{type:"func",name:"neg",args:[{expr:n}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(D.UNARY)}]};default:throw new Error(`Unexpected token: ${t.type} (${t.value})`)}}parseFunctionCall(t){this.expect("(");let n=[];if(this.peek().type!==")")do{n.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,i=this.pos+1;i<this.tokens.length&&this.tokens[i].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);n.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:t.toLowerCase(),args:n}}parseList(){this.expect("[");let t=[];if(this.peek().type!=="]")do t.length>0&&this.peek().type===","&&this.advance(),t.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:t}}parseMap(){this.expect("{");let t=[];if(this.peek().type!=="}")do{t.length>0&&this.peek().type===","&&this.advance();let n;if(this.peek().type==="ident")n=this.peek().value,this.advance();else if(this.peek().type==="string")n=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);t.push({key:n,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:t}}parseInfix(t,n){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let i=this.parseExpr(n+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:t},{expr:i}]}}if(s.type==="|"){this.advance();let i=this.parseExpr(n);return this.handlePipe(t,i)}if(s.type===".")return this.advance(),this.handleDot(t);if(s.type==="[")return this.advance(),this.handleIndexing(t);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(t,n){if(n.type==="identifier")return{type:"func",name:n.name,args:[{expr:t}]};if(n.type==="func"){let s=this.countUnderscores(n);return s===0?n:s===1?this.fillUnderscore(n,t):{type:"pipeline",exprs:[t,n]}}return this.countUnderscores(n)===1?this.fillUnderscore(n,t):n}handleDot(t){let n=this.peek();if(n.type==="ident"){let s=n.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:t}),r}return{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}if(n.type==="int"){let s=Number.parseInt(n.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"int",value:s}}]}}if(n.type==="string"){let s=n.value;return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${n.type}`)}handleIndexing(t){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:{type:"int",value:0}},{expr:s}]}}let n=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t},{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:n},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:t},{expr:n}]}}countUnderscores(t){let n=[t],s=0;for(;n.length>0;){this.useOperation();let r=n.pop();if(!r)break;if(r.type==="underscore")s++;else if(r.type==="func")for(let o of r.args)n.push(o.expr);else if(r.type==="list")n.push(...r.elements);else if(r.type==="map")for(let o of r.entries)n.push(o.value);if(n.length>this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements")}return s}fillUnderscore(t,n){return this.withDepth(()=>this.fillUnderscoreInner(t,n))}fillUnderscoreInner(t,n){return this.useOperation(),t.type==="underscore"?n:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.fillUnderscore(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.fillUnderscore(s.value,n)}))}:t}bindLambdaArgs(t,n){return{...t,body:this.bindLambdaArgsInExpr(t.body,n)}}bindLambdaArgsInExpr(t,n){return this.withDepth(()=>this.bindLambdaArgsInExprInner(t,n))}bindLambdaArgsInExprInner(t,n){return this.useOperation(),t.type==="identifier"&&n.includes(t.name)?{type:"lambdaBinding",name:t.name}:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.bindLambdaArgsInExpr(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,n)}))}:t}getInfixPrec(t){switch(t){case"|":return D.PIPE;case"||":case"or":return D.OR;case"&&":case"and":return D.AND;case"==":case"!=":case"eq":case"ne":return D.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return D.COMPARISON;case"+":case"-":case"++":return D.ADDITIVE;case"*":case"/":case"//":case"%":return D.MULTIPLICATIVE;case"**":return D.POWER;case".":case"[":return D.POSTFIX;default:return-1}}isRightAssoc(t){return t==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(t){return this.tokens[this.pos+t]||{type:"eof",value:"",pos:0}}advance(){return this.useOperation(),this.addAstNode(),this.tokens[this.pos++]}expect(t){let n=this.peek();if(n.type!==t)throw new Error(`Expected ${t}, got ${n.type}`);return this.advance()}};function X(e,t={}){let n=[],r=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize(),o=0,i=()=>r[o]||{type:"eof",value:"",pos:0},p=()=>r[o++];for(;i().type!=="eof";){if(i().type===","&&n.length>0){p();continue}let h=[],m=0,c=o;for(;i().type!=="eof";){let l=i();if((l.type===","||l.type==="as")&&m===0)break;(l.type==="("||l.type==="["||l.type==="{")&&m++,(l.type===")"||l.type==="]"||l.type==="}")&&m--,h.push(p())}h.push({type:"eof",value:"",pos:0});let d=new ee(h,t).parse(),u;if(i().type==="as")if(p(),i().type==="("){p();let l=[];for(;i().type!==")"&&i().type!=="eof";)if((i().type==="ident"||i().type==="string")&&(l.push(i().value),p()),i().type===",")p();else if(i().type!==")"&&i().type!=="eof")throw new Error(`Expected tuple alias, got ${i().type}`);if(i().type!==")")throw new Error("Expected ')' after tuple alias");p(),u=l}else if(i().type==="ident"||i().type==="string")u=i().value,p();else throw new Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(r[c].pos,r[o-1]?.pos||e.length).trim(),d.type==="identifier"&&(u=d.name);n.push({expr:d,name:u})}return n}function B(e,t={}){let s=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize();return new ee(s,t).parse()}function R(e,t){return t.length===0?O(e,[]):t.length===1?{type:"Pipe",left:t[0],right:O(e,[])}:{type:"Pipe",left:t[0],right:O(e,t.slice(1))}}var le={add:e=>L("+",e[0],e[1]),sub:e=>L("-",e[0],e[1]),mul:e=>L("*",e[0],e[1]),div:e=>L("/",e[0],e[1]),mod:e=>L("%",e[0],e[1]),idiv:e=>O("floor",[L("/",e[0],e[1])]),pow:e=>R("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>L("==",e[0],e[1]),"!=":e=>L("!=",e[0],e[1]),"<":e=>L("<",e[0],e[1]),"<=":e=>L("<=",e[0],e[1]),">":e=>L(">",e[0],e[1]),">=":e=>L(">=",e[0],e[1]),eq:e=>L("==",M(e[0]),M(e[1])),ne:e=>L("!=",M(e[0]),M(e[1])),lt:e=>L("<",M(e[0]),M(e[1])),le:e=>L("<=",M(e[0]),M(e[1])),gt:e=>L(">",M(e[0]),M(e[1])),ge:e=>L(">=",M(e[0]),M(e[1])),and:e=>L("and",e[0],e[1]),or:e=>L("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>R("length",e),length:e=>R("length",e),upper:e=>R("ascii_upcase",e),lower:e=>R("ascii_downcase",e),trim:e=>R("trim",e),ltrim:e=>e.length===0?O("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?O("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("rtrimstr",[{type:"Literal",value:" "}])},split:e=>R("split",e),join:e=>e.length===1?O("join",[{type:"Literal",value:""}]):R("join",e),concat:e=>L("+",e[0],e[1]),startswith:e=>R("startswith",e),endswith:e=>R("endswith",e),contains:e=>R("contains",e),replace:e=>R("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:L("+",e[1],e[2])},abs:e=>R("fabs",e),floor:e=>R("floor",e),ceil:e=>R("ceil",e),round:e=>R("round",e),sqrt:e=>R("sqrt",e),log:e=>R("log",e),log10:e=>R("log10",e),log2:e=>R("log2",e),exp:e=>R("exp",e),sin:e=>R("sin",e),cos:e=>R("cos",e),tan:e=>R("tan",e),asin:e=>R("asin",e),acos:e=>R("acos",e),atan:e=>R("atan",e),min:e=>R("min",e),max:e=>R("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>O("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>O("select",e),empty:()=>O("empty",[]),count:()=>O("length",[]),sum:e=>e.length===0?O("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:O("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},type:"type",isnull:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:null}):L("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:""}):L("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?O("tonumber",[]):O("tonumber",e),tostring:e=>e.length===0?O("tostring",[]):O("tostring",e),if:e=>st(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let t=e[e.length-1];for(let n=e.length-2;n>=0;n--){let s=e[n],r=L("and",L("!=",s,{type:"Literal",value:null}),L("!=",s,{type:"Literal",value:""}));t=st(r,s,t)}return t},index:()=>({type:"Field",name:"_row_index"}),now:()=>O("now",[]),fmt:e=>O("tostring",e),format:e=>O("tostring",e)};Object.setPrototypeOf(le,null);function L(e,t,n){return{type:"BinaryOp",op:e,left:t,right:n}}function O(e,t){return{type:"Call",name:e,args:t}}var mt="then";function st(e,t,n){let s=Xe({type:"Cond",cond:e,elifs:[],else:n||{type:"Literal",value:null}});return s[mt]=t,s}function M(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function U(e,t=!0,n={}){let s={nodes:0,operations:0,maxNodes:n.maxAstNodes??1e5,maxOperations:n.maxOperations??1e5,maxDepth:n.maxDepth??100};return rt(e,t,s,0)}function rt(e,t,n,s){if(s>=n.maxDepth)throw new E(`xan: expression conversion depth limit exceeded (${n.maxDepth})`,"recursion");if(++n.nodes>n.maxNodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(++n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations");let r=o=>rt(o,t,n,s+1);switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return t?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{if(e.args.length>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");let o=e.args.map(p=>r(p.expr));if(e.name==="coalesce"){let p=Math.max(0,o.length-1)*7;if(p>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(n.nodes+=p,n.operations+=o.length,n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations")}let i=Object.hasOwn(le,e.name)?le[e.name]:void 0;return typeof i=="function"?i(o):O(typeof i=="string"?i:e.name,o)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((o,i,p)=>{let h=r(i);return p===0?h:{type:"Comma",left:o,right:h}},null)};case"map":return{type:"Object",entries:e.entries.map(o=>({key:o.key,value:r(o.value)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?r(e.start):void 0,end:e.end?r(e.end):void 0};case"lambda":return r(e.body);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function Q(e){return e<2?0:Math.ceil(e*Math.log2(e))}function ue(e,t={}){let n=t.maxArrayElements??1e5,s=t.maxStringLength??10*1024*1024,r=t.maxIterations??1e5,o=t.maxDepth??100;if(K(e)>s)throw new E(`xan: aggregation expression length limit exceeded (${s} bytes)`,"string_length");let i=[],p=0,h=0,m=()=>{if(t.consumeWork?.(),++h>r)throw new E(`xan: aggregation parser operation limit exceeded (${r})`,"iterations")};for(;p<e.length;){for(m();p<e.length&&(e[p]===" "||e[p]===",");)p++;if(p>=e.length)break;let c=p;for(;p<e.length&&/\w/.test(e[p]);)p++;let a=e.slice(c,p);for(;p<e.length&&e[p]===" ";)p++;if(e[p]!=="(")break;p++;let d=1,u=p;for(;p<e.length&&d>0;){if(m(),e[p]==="("?d++:e[p]===")"&&d--,d>o)throw new E(`xan: aggregation parser depth limit exceeded (${o})`,"recursion");d>0&&p++}let l=e.slice(u,p).trim();for(p++;p<e.length&&e[p]===" ";)p++;let f="";if(e.slice(p,p+3).toLowerCase()==="as "){for(p+=3;p<e.length&&e[p]===" ";)p++;let x=p;for(;p<e.length&&/\w/.test(e[p]);)p++;f=e.slice(x,p)}if(f||(f=l?`${a}(${l})`:`${a}()`),i.length>=n)throw new E(`xan: aggregation specification limit exceeded (${n})`,"array_elements");i.push({func:a,expr:l,alias:f})}return i}function ft(e){return/^\w+$/.test(e)}function ht(e,t,n){let s=V(e,t,n);return s.length>0?s[0]:null}function ce(e,t,n={},s={}){let{func:r,expr:o}=t,i=s.maxArrayElements??1e5,p=s.maxStringLength??10*1024*1024,h=s.maxIterations??1e5,m={maxSourceLength:p,maxTokens:i,maxAstNodes:i,maxOperations:h,maxDepth:s.maxDepth??100};if(e.length>i)throw new E(`xan: aggregation input limit exceeded (${i})`,"array_elements");if(r==="count"&&!o)return e.length;let c=ft(o),a=c?null:U(B(o,m),!0,m),d;if(c)d=f=>f[o];else{if(a===null)throw new Error("xan: missing compiled aggregation expression");d=f=>ht(f,a,n)}if(r==="all"||r==="any"){let f=0;for(let x of e){if(s.consumeWork?.(),++f>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let g=!!d(x);if(r==="all"&&!g)return!1;if(r==="any"&&g)return!0}return r==="all"}let u=[],l=0;for(let f of e){if(s.consumeWork?.(),++l>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let x=d(f);if(x!=null){if(u.length>=i)throw new E(`xan: aggregation value limit exceeded (${i})`,"array_elements");u.push(x)}}switch(r){case"count":{if(c)return u.length;let f=0;for(let x of u)s.consumeWork?.(),x&&f++;return f}case"sum":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return f}case"mean":case"avg":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return u.length>0?f/u.length:0}case"min":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.min(f,g)}return f}case"max":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.max(f,g)}return f}case"first":return u.length>0?u[0]:null;case"last":return u.length>0?u[u.length-1]:null;case"median":{let f=[];for(let g of u){s.consumeWork?.();let y=typeof g=="number"?g:Number.parseFloat(String(g));Number.isNaN(y)||f.push(y)}if(s.consumeWork?.(Q(f.length)),f.sort((g,y)=>g-y),f.length===0)return null;let x=Math.floor(f.length/2);return f.length%2===0?(f[x-1]+f[x])/2:f[x]}case"mode":{let f=new Map;for(let y of u){s.consumeWork?.();let w=String(y);f.set(w,(f.get(w)||0)+1)}let x=0,g=null;for(let[y,w]of f)s.consumeWork?.(),w>x&&(x=w,g=y);return g}case"cardinality":{let f=new Set;for(let x of u)s.consumeWork?.(),f.add(String(x));return f.size}case"values":return ot(u,!1,p,s);case"distinct_values":return ot(u,!0,p,s);default:return null}}function it(e,t,n={},s={}){let r=F();for(let o of t)b(r,o.alias,ce(e,o,n,s));return r}function ot(e,t,n,s){let r=[],o=t?new Set:null,i=0;for(let p of e){s.consumeWork?.();let h=String(p);if(o?.has(h))continue;o?.add(h);let m=K(h)+(r.length>0?1:0);if(m>n-i)throw new E(`xan: aggregation string limit exceeded (${n} bytes)`,"string_length");r.push(h),i+=m}return t&&(s.consumeWork?.(Q(r.length)),r.sort()),r.join("|")}function lt(e,t){return{maxArrayElements:e.limits.maxArrayElements,maxStringLength:e.limits.maxStringLength,maxIterations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth,consumeWork:(n=1)=>t.consumeWork(n)}}function at(e,t,n){let s=e.size-(t&&e.has("")?1:0);return n>0?Math.min(s,n):s}async function pe(e,t){let n="",s=[];for(let d of e)d.startsWith("-")||(n?s.push(d):n=d);if(!n)return{stdout:"",stderr:`xan agg: no aggregation expression
|
|
@@ -61,7 +61,7 @@ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k
|
|
|
61
61
|
`,exitCode:1};i=o[0].headers}let m=[];for(let{headers:c,data:a}of o)for(let d of a){let u=F();for(let l of i)b(u,l,c.includes(l)?d[l]:"");m.push(u)}return{stdout:C(i,m,t),stderr:"",exitCode:0}}async function Be(e,t){let n="",s=[],r=!1,o=!1,i=[];for(let u=0;u<e.length;u++){let l=e[u];(l==="-s"||l==="--select")&&u+1<e.length?s=e[++u].split(","):l==="-v"||l==="--invert"?r=!0:l==="-i"||l==="--ignore-case"?o=!0:l==="-r"||l==="--regex"||l.startsWith("-")||(n?i.push(l):n=l)}if(!n)return{stdout:"",stderr:`xan search: no pattern specified
|
|
62
62
|
`,exitCode:1};let{headers:p,data:h,error:m}=await k(i,t);if(m)return m;let c=s.length>0?s:p,a;try{a=Z(n,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${n}'
|
|
63
63
|
`,exitCode:1}}let d=h.filter(u=>{let l=c.some(f=>{let x=u[f];return x!=null&&a.test(String(x))});return r?!l:l});return{stdout:C(p,d,t),stderr:"",exitCode:0}}async function He(e,t){let n="",s=[];for(let l of e)l.startsWith("-")||(n?s.push(l):n=l);if(!n)return{stdout:"",stderr:`xan flatmap: no expression specified
|
|
64
|
-
`,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-
|
|
64
|
+
`,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-MDMZTFFI.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...dt]),pt={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
|
|
65
65
|
It provides a simple, ergonomic interface for common data operations.
|
|
66
66
|
|
|
67
67
|
COMMANDS:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as w}from"./chunk-WZQNMEQW.js";import{a as m}from"./chunk-
|
|
2
|
+
import{a as w}from"./chunk-WZQNMEQW.js";import{a as m}from"./chunk-4X2R47I5.js";import{d as v}from"./chunk-AH7VTVWU.js";import{e as B}from"./chunk-IBRT3OJS.js";import{l as z}from"./chunk-EFORKKSH.js";import{a as L}from"./chunk-QIQMJJZ4.js";import{a as F,b as E}from"./chunk-QAYAQNCG.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
|
|
3
3
|
|
|
4
4
|
When no FILE is given, or when FILE is -, read from standard input.
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as E}from"./chunk-
|
|
2
|
+
import{a as E}from"./chunk-4X2R47I5.js";import{a as h}from"./chunk-IBRT3OJS.js";import{l as $}from"./chunk-EFORKKSH.js";import{a as k}from"./chunk-GN6CQ3J4.js";import{a as C,b as L,c as F}from"./chunk-QAYAQNCG.js";var A={name:"split",summary:"split a file into pieces",usage:"split [OPTION]... [FILE [PREFIX]]",description:"Output pieces of FILE to PREFIXaa, PREFIXab, ...; default size is 1000 lines, and default PREFIX is 'x'.",options:["-l N Put N lines per output file","-b SIZE Put SIZE bytes per output file (K, M, G suffixes)","-n CHUNKS Split into CHUNKS equal-sized files","-d Use numeric suffixes (00, 01, ...) instead of alphabetic","-a LENGTH Use suffixes of length LENGTH (default: 2)","--additional-suffix=SUFFIX Append SUFFIX to file names"],examples:["split -l 100 file.txt # Split into 100-line chunks","split -b 1M file.bin # Split into 1MB chunks","split -n 5 file.txt # Split into 5 equal parts","split -d file.txt part_ # part_00, part_01, ...","split -a 3 -d file.txt x # x000, x001, ..."]},S=1e5,_=0;function U(e){return Uint8Array.from(e,t=>t.charCodeAt(0))}function N(e){let t=e.match(/^(\d+)([KMGTPEZY]?)([B]?)$/i);if(!t)return null;let i=Number(t[1]);if(!Number.isSafeInteger(i)||i<1)return null;let u=(t[2]||"").toUpperCase(),a=new Map([["",1],["K",1024],["M",1024*1024],["G",1024*1024*1024],["T",1024*1024*1024*1024],["P",1024*1024*1024*1024*1024]]).get(u);return a===void 0||i>Math.floor(Number.MAX_SAFE_INTEGER/a)?null:i*a}function x(e){if(!/^[0-9]+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)&&t>=1?t:null}function H(e,t,i){if(t)return e.toString().padStart(i,"0");let u="abcdefghijklmnopqrstuvwxyz",n=new Array(i),a=e;for(let o=i-1;o>=0;o--)n[o]=u[a%26],a=Math.floor(a/26);return n.join("")}function B(e,t){let i=[],u=0,n=0;for(let a=0;a<e.length;a++)e[a]===10&&(n++,n===t&&(i.push(e.subarray(u,a+1)),u=a+1,n=0));return u<e.length&&i.push(e.subarray(u)),i}function T(e,t){let i=[];for(let u=0;u<e.length;u+=t)i.push(e.subarray(u,u+t));return i}function X(e,t){let i=[],u=Math.ceil(e.length/t);for(let n=0;n<t;n++){let a=n*u,o=Math.min(a+u,e.length);a<o&&i.push(e.subarray(a,o))}return i}function z(e,t){let i=e?10**t:26**t;return Number.isSafeInteger(i)?i:Number.MAX_SAFE_INTEGER}function G(e){if(e.existence!=="unknown")return e.existence==="existing"?e.stableIdentity:e.canonicalPath===void 0?void 0:`missing:${e.canonicalPath}`}function I(e,t){return e.existence!==t.existence||e.existence==="unknown"||t.existence==="unknown"?!1:e.existence==="missing"&&t.existence==="missing"?e.canonicalPath===t.canonicalPath:e.existence==="existing"&&t.existence==="existing"?e.stableIdentity!==void 0&&e.stableIdentity===t.stableIdentity:!1}async function M(e,t,i){let u=t.lastIndexOf("/"),n=u<=0?"/":t.slice(0,u),a=t.slice(u+1);for(let o=0;o<100;o++){let d=_++,c=e.fs.resolvePath(n,`.${a}.just-bash-split-${i}-${d}`),p=await h(e.fs,c);if(p.existence==="missing")return c;if(p.existence==="unknown")break}throw new Error("unable to allocate transaction path")}var Z={name:"split",execute:async(e,t)=>{if(L(e))return C(A);let i={mode:"lines",lines:1e3,bytes:0,chunks:0,useNumericSuffix:!1,suffixLength:2,additionalSuffix:""},u=[],n=0;for(;n<e.length;){let s=e[n];if(s==="-l"&&n+1<e.length){let l=x(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${e[n+1]}'
|
|
3
3
|
`};i.mode="lines",i.lines=l,n+=2}else if(s.match(/^-l\d+$/)){let l=x(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of lines: '${s.slice(2)}'
|
|
4
4
|
`};i.mode="lines",i.lines=l,n++}else if(s==="-b"&&n+1<e.length){let l=N(e[n+1]);if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${e[n+1]}'
|
|
5
5
|
`};i.mode="bytes",i.bytes=l,n+=2}else if(s.match(/^-b.+$/)){let l=N(s.slice(2));if(l===null)return{exitCode:1,stdout:"",stderr:`split: invalid number of bytes: '${s.slice(2)}'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as _}from"./chunk-CHHWTPDH.js";import{a as p}from"./chunk-
|
|
2
|
+
import{a as _}from"./chunk-CHHWTPDH.js";import{a as p}from"./chunk-4X2R47I5.js";import{l as g}from"./chunk-EFORKKSH.js";import{a as L}from"./chunk-QIQMJJZ4.js";import{a as S,b as C}from"./chunk-QAYAQNCG.js";var E={name:"base64",summary:"base64 encode/decode data and print to standard output",usage:"base64 [OPTION]... [FILE]",options:["-d, --decode decode data","-w, --wrap=COLS wrap encoded lines after COLS character (default 76, 0 to disable)"," --help display this help and exit"]},F={decode:{short:"d",long:"decode",type:"boolean"},wrap:{short:"w",long:"wrap",type:"number",default:76}};function a(t,e,u,i){if(t>e)throw new g(`base64: ${u} limit exceeded (${e} bytes)`,i)}function k(t){let e=[];for(let i=0;i<t.length;i+=32768)e.push(String.fromCharCode(...t.subarray(i,i+32768)));return e.join("")}function B(t){if(t.length===0)return 0;let e=t.endsWith("==")?2:t.endsWith("=")?1:0;return Math.max(0,Math.ceil(t.length/4)*3-e)}async function x(t,e,u){let i=Math.min(t.limits.maxInputBytes,t.limits.maxStringLength),o=t.stdin;if(e.length===0||e.length===1&&e[0]==="-")return a(o.length,i,"input size","string_length"),{ok:!0,data:Uint8Array.from(o,n=>n.charCodeAt(0))};let c=[],s=0;for(let n of e){if(n==="-"){a(s+o.length,i,"input size","string_length"),c.push(Uint8Array.from(o,r=>r.charCodeAt(0))),s+=o.length;continue}try{let r=t.fs.resolvePath(t.cwd,n),l=await t.fs.stat(r);a(s+l.size,i,"input size","string_length");let f=await t.fs.readFileBuffer(r);a(s+f.length,i,"input size","string_length"),_(t,f.length,u),c.push(f),s+=f.length}catch(r){return p(r),{ok:!1,error:{stdout:"",stderr:`${u}: ${n}: No such file or directory
|
|
3
3
|
`,exitCode:1}}}}let d=new Uint8Array(s),h=0;for(let n of c)d.set(n,h),h+=n.length;return{ok:!0,data:d}}var T={name:"base64",async execute(t,e){if(C(t))return S(E);let u=L("base64",t,F);if(!u.ok)return u.error;let i=u.result.flags.decode,o=u.result.flags.wrap,c=u.result.positional;if(!Number.isSafeInteger(o)||o<0)return{stdout:"",stderr:`base64: invalid wrap size
|
|
4
4
|
`,exitCode:1};try{if(i){let r=await x(e,c,"base64");if(!r.ok)return r.error;if(typeof Buffer<"u"){let y=Buffer.from(r.data).toString("utf8").replace(/\s/g,""),z=B(y);a(z,e.limits.maxStringLength,"decoded size","string_length"),a(z,e.limits.maxOutputSize,"output size","output_size");let w=Buffer.from(y,"base64");return a(w.length,e.limits.maxOutputSize,"output size","output_size"),{stdout:w.toString("latin1"),stderr:"",exitCode:0,stdoutEncoding:"binary"}}let f=k(r.data).replace(/\s/g,""),m=B(f);a(m,e.limits.maxStringLength,"decoded size","string_length"),a(m,e.limits.maxOutputSize,"output size","output_size");let b=atob(f);return a(b.length,e.limits.maxOutputSize,"output size","output_size"),{stdout:b,stderr:"",exitCode:0,stdoutEncoding:"binary"}}let s=await x(e,c,"base64");if(!s.ok)return s.error;let d=Math.ceil(s.data.length/3)*4,h=o>0&&d>0?Math.ceil(d/o):0;if(h>e.limits.maxArrayElements)throw new g(`base64: wrapped line limit exceeded (${e.limits.maxArrayElements})`,"array_elements");a(d,e.limits.maxStringLength,"encoded size","string_length"),a(d+h,e.limits.maxOutputSize,"output size","output_size");let n;if(typeof Buffer<"u"?n=Buffer.from(s.data).toString("base64"):n=btoa(k(s.data)),o>0){let r=[];for(let l=0;l<n.length;l+=o)r.push(n.slice(l,l+o));n=r.join(`
|
|
5
5
|
`)+(n.length>0?`
|
|
@@ -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-XZZSXYTK.js";import{c as $}from"./chunk-QKQP2SCP.js";import{b as C}from"./chunk-RT7ROXPF.js";import{a as V}from"./chunk-IBRT3OJS.js";import{d as I}from"./chunk-GN6CQ3J4.js";import{a as B,b}from"./chunk-FOCWZZDE.js";import{a as x}from"./chunk-W5DWRFSU.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(`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as Ie}from"./chunk-DLL7UR66.js";import{a as B,b as U}from"./chunk-
|
|
2
|
+
import{a as Ie}from"./chunk-DLL7UR66.js";import{a as B,b as U}from"./chunk-QKQP2SCP.js";import{a as O,b as X}from"./chunk-KVG5FR5F.js";import{a as z}from"./chunk-4X2R47I5.js";import{a as $}from"./chunk-RT7ROXPF.js";import{d as ve}from"./chunk-AH7VTVWU.js";import{l as w}from"./chunk-EFORKKSH.js";import{a as V,d as ee}from"./chunk-GN6CQ3J4.js";import{a as Re,b as Ae,c as pe}from"./chunk-QAYAQNCG.js";var Qe=1e4,Ze=100,Ye=new X(/\s+/);function fe(e={}){let{fieldSep:t=Ye,maxIterations:n=Qe,maxRecursionDepth:r=Ze,maxOutputSize:s=0,maxArrayElements:a=1e5,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}=e;return{FS:" ",OFS:" ",ORS:`
|
|
3
3
|
`,OFMT:"%.6g",NR:0,NF:0,FNR:0,FILENAME:"",RSTART:0,RLENGTH:-1,SUBSEP:"",fields:[],line:"",vars:Object.create(null),arrays:Object.create(null),arrayAliases:new Map,ARGC:0,ARGV:Object.create(null),ENVIRON:Object.create(null),functions:new Map,getlineCommandStreams:new Map,getlineFileStreams:new Map,fieldSep:t,maxIterations:n,maxRecursionDepth:r,maxOutputSize:s,maxArrayElements:a,arrayElementCount:0,recordsProcessed:0,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:"",openedFiles:new Set,fs:o,cwd:l,exec:c,coverage:u,requireDefenseContext:f}}function ke(e,t,n){switch(n){case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return t!==0?e/t:0;case"%":return t!==0?e%t:0;case"^":case"**":return e**t;default:return 0}}function F(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function L(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}var be=10*1024*1024;function Ee(e){return new ve(e,"awk string",()=>new w(`string size limit exceeded (${e} bytes)`,"string_length"))}function _(e){return e.maxOutputSize>0?e.maxOutputSize:be}function te(e,t,n,r,s){let a=Ee(s),o=0,l=0,c=0;for(let u of t.matchAll(e)){let f=u.index??0;l++,a.append(e.slice(o,f)),n(l)?(a.append(r(u)),c++):a.append(u[0]),o=f+u[0].length}return a.append(e.slice(o)),{value:a.build(),replacements:c}}async function ne(e,t){if(e.type==="regex")return e.pattern;let n=L(await t.evalExpr(e));return n.startsWith("/")&&n.endsWith("/")&&(n=n.slice(1,-1)),n}async function Oe(e,t){return e?e.type==="variable"?e.name:e.type==="field"?`$${Math.floor(F(await t.evalExpr(e.index)))}`:"$0":"$0"}function Le(e,t){if(e==="$0")return t.line;if(e.startsWith("$")){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||""}return L(t.vars[e]??"")}function Te(e,t,n){if(e==="$0")n.line=t,n.fields=n.FS===" "?t.trim().split(/\s+/).filter(Boolean):n.fieldSep.split(t),n.NF=n.fields.length;else if(e.startsWith("$")){let r=parseInt(e.slice(1),10)-1;for(;n.fields.length<=r;)n.fields.push("");n.fields[r]=t,n.NF=n.fields.length,n.line=n.fields.join(n.OFS)}else n.vars[e]=t}async function Je(e,t,n){return e.length===0?t.line.length:L(await n.evalExpr(e[0])).length}async function et(e,t,n){if(e.length<2)return"";let r=L(await n.evalExpr(e[0])),s=Math.floor(F(await n.evalExpr(e[1])))-1;if(e.length>=3){let a=Math.floor(F(await n.evalExpr(e[2])));return r.substr(Math.max(0,s),a)}return r.substr(Math.max(0,s))}async function tt(e,t,n){if(e.length<2)return 0;let r=L(await n.evalExpr(e[0])),s=L(await n.evalExpr(e[1])),a=r.indexOf(s);return a===-1?0:a+1}async function nt(e,t,n){if(e.length<2)return 0;let r=L(await n.evalExpr(e[0])),s=e[1];if(s.type!=="variable")return 0;let a=s.name,o=t.FS;if(e.length>=3){let f=e[2];if(f.type==="regex")o=O(f.pattern);else{let k=L(await n.evalExpr(f));o=k===" "?O("\\s+"):k}}else t.FS===" "&&(o=O("\\s+"));let l=Object.keys(t.arrays[a]??{}).length,c=t.maxArrayElements-t.arrayElementCount+l,u=typeof o=="string"?r.split(o,c+1):o.split(r,c+1);if(u.length>c)throw new w(`array element limit exceeded (${t.maxArrayElements})`,"array_elements");t.arrays[a]=Object.create(null);for(let f=0;f<u.length;f++)t.arrays[a][String(f+1)]=u[f];return t.arrayElementCount+=u.length-l,u.length}async function it(e,t,n){if(e.length<2)return 0;let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=await Oe(e[2],n),o=Le(a,t);try{let l=O(r,"g"),c=te(o,l,u=>u===1,u=>Pe(s,u[0],_(t)),_(t));return Te(a,c.value,t),c.replacements}catch(l){return z(l),0}}async function rt(e,t,n){if(e.length<2)return 0;let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=await Oe(e[2],n),o=Le(a,t);try{let l=O(r,"g"),c=te(o,l,()=>!0,u=>Pe(s,u[0],_(t)),_(t));return Te(a,c.value,t),c.replacements}catch(l){return z(l),0}}function Pe(e,t,n){let r=Ee(n),s=0;for(;s<e.length;)if(e[s]==="\\"&&s+1<e.length){let a=e[s+1];a==="&"?(r.append("&"),s+=2):a==="\\"?(r.append("\\"),s+=2):(r.append(e[s+1]),s+=2)}else e[s]==="&"?(r.append(t),s++):(r.append(e[s]),s++);return r.build()}async function st(e,t,n){if(e.length<2)return t.RSTART=0,t.RLENGTH=-1,0;let r=L(await n.evalExpr(e[0])),s=await ne(e[1],n);try{let o=O(s).exec(r);if(o)return t.RSTART=o.index+1,t.RLENGTH=o[0].length,t.RSTART}catch{}return t.RSTART=0,t.RLENGTH=-1,0}async function at(e,t,n){if(e.length<3)return"";let r=await ne(e[0],n),s=L(await n.evalExpr(e[1])),a=L(await n.evalExpr(e[2])),o=e.length>=4?L(await n.evalExpr(e[3])):t.line;try{let l=a.toLowerCase()==="g",c=l?0:parseInt(a,10)||1;if(l){let u=O(r,"g");return te(o,u,()=>!0,f=>Ce(s,f[0],f.slice(1),_(t)),_(t)).value}else{let u=O(r,"g");return te(o,u,f=>f===c,f=>Ce(s,f[0],f.slice(1),_(t)),_(t)).value}}catch(l){return z(l),o}}function Ce(e,t,n,r){let s=Ee(r),a=0;for(;a<e.length;)if(e[a]==="\\"&&a+1<e.length){let o=e[a+1];if(o==="&")s.append("&"),a+=2;else if(o==="0")s.append(t),a+=2;else if(o>="1"&&o<="9"){let l=parseInt(o,10)-1;s.append(n[l]||""),a+=2}else o==="n"?(s.append(`
|
|
4
4
|
`),a+=2):o==="t"?(s.append(" "),a+=2):(s.append(o),a+=2)}else e[a]==="&"?(s.append(t),a++):(s.append(e[a]),a++);return s.build()}async function ot(e,t,n){return e.length===0?"":L(await n.evalExpr(e[0])).toLowerCase()}async function lt(e,t,n){return e.length===0?"":L(await n.evalExpr(e[0])).toUpperCase()}async function ut(e,t,n){if(e.length===0)return"";let r=L(await n.evalExpr(e[0])),s=[];for(let a=1;a<e.length;a++)s.push(await n.evalExpr(e[a]));return ie(r,s,_(t))}async function ct(e,t,n){return e.length===0?0:Math.floor(F(await n.evalExpr(e[0])))}async function ht(e,t,n){return e.length===0?0:Math.sqrt(F(await n.evalExpr(e[0])))}async function pt(e,t,n){return e.length===0?0:Math.sin(F(await n.evalExpr(e[0])))}async function ft(e,t,n){return e.length===0?0:Math.cos(F(await n.evalExpr(e[0])))}async function dt(e,t,n){let r=e.length>0?F(await n.evalExpr(e[0])):0,s=e.length>1?F(await n.evalExpr(e[1])):0;return Math.atan2(r,s)}async function Et(e,t,n){return e.length===0?0:Math.log(F(await n.evalExpr(e[0])))}async function mt(e,t,n){return e.length===0?1:Math.exp(F(await n.evalExpr(e[0])))}function Nt(e,t,n){return t.random?t.random():Math.random()}async function yt(e,t,n){let r=e.length>0?F(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=r,r}function wt(e,t){return()=>{throw new Error(`${e}() is not supported - ${t}`)}}function de(e){return()=>{throw new Error(`function '${e}()' is not implemented`)}}var gt=1e4;function ie(e,t,n=be){let r=0,s="",a=0,o=0,l=Math.min(gt,n),c=u=>{let f=V(u);if(f>n-a)throw new w(`formatted string size limit exceeded (${n} bytes)`,"string_length");s+=u,a+=f};for(;o<e.length;)if(e[o]==="%"&&o+1<e.length){let u=o+1,f="",k="",C="",A,T=u;for(;u<e.length&&/\d/.test(e[u]);)u++;u>T&&e[u]==="$"?(A=parseInt(e.substring(T,u),10)-1,u++):u=T;let he=()=>{if(u<e.length){if(u+1<e.length&&(e[u]==="h"&&e[u+1]==="h"||e[u]==="l"&&e[u+1]==="l")){u+=2;return}/[lzjh]/.test(e[u])&&u++}};for(;u<e.length&&/[-+ #0]/.test(e[u]);)f+=e[u++];if(e[u]==="*"){let p=t[r++],N=p!==void 0?Math.floor(Number(p)):0;if(!Number.isFinite(N)||!Number.isSafeInteger(N))throw new w(`printf width limit exceeded (${l} bytes)`,"string_length");N<0?(f+="-",k=String(-N)):k=String(N),u++}else for(;u<e.length&&/\d/.test(e[u]);)k+=e[u++];if(k&&parseInt(k,10)>l)throw new w(`printf width limit exceeded (${l} bytes)`,"string_length");if(e[u]==="."){if(u++,e[u]==="*"){let p=t[r++],N=p!==void 0?Math.floor(Number(p)):0;if(!Number.isFinite(N)||!Number.isSafeInteger(N))throw new w(`printf precision limit exceeded (${l} bytes)`,"string_length");C=N<0?"":String(N),u++}else for(;u<e.length&&/\d/.test(e[u]);)C+=e[u++];if(C&&parseInt(C,10)>l)throw new w(`printf precision limit exceeded (${l} bytes)`,"string_length")}he();let W=e[u],y=t[A!==void 0?A:r];switch(W){case"s":{let p=y!==void 0?String(y):"";if(C&&(p=p.substring(0,parseInt(C,10))),k){let N=parseInt(k,10);f.includes("-")?p=p.padEnd(N):p=p.padStart(N)}c(p),A===void 0&&r++;break}case"d":case"i":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=p<0,g=Math.abs(p).toString();if(C){let x=parseInt(C,10);g=g.padStart(x,"0")}let d="";N?d="-":f.includes("+")?d="+":f.includes(" ")&&(d=" ");let I=d+g;if(k){let x=parseInt(k,10);f.includes("-")?I=I.padEnd(x):f.includes("0")&&!C?I=d+g.padStart(x-d.length,"0"):I=I.padStart(x)}c(I),A===void 0&&r++;break}case"f":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p.toFixed(N);if(k){let d=parseInt(k,10);f.includes("-")?g=g.padEnd(d):g=g.padStart(d)}c(g),A===void 0&&r++;break}case"e":case"E":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p.toExponential(N);if(W==="E"&&(g=g.toUpperCase()),k){let d=parseInt(k,10);f.includes("-")?g=g.padEnd(d):g=g.padStart(d)}c(g),A===void 0&&r++;break}case"g":case"G":{let p=y!==void 0?Number(y):0;Number.isNaN(p)&&(p=0);let N=C?parseInt(C,10):6;if(N>100)throw new w("printf floating-point precision limit exceeded (100 digits)","string_length");let g=p!==0?Math.floor(Math.log10(Math.abs(p))):0,d;if(p===0?d="0":g<-4||g>=N?(d=p.toExponential(N-1),W==="G"&&(d=d.toUpperCase())):d=p.toPrecision(N),d.includes(".")&&(d=d.replace(/\.?0+$/,"").replace(/\.?0+e/,"e")),d.includes("e")&&(d=d.replace(/\.?0+e/,"e")),k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"x":case"X":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=Math.abs(p).toString(16);if(W==="X"&&(N=N.toUpperCase()),C){let I=parseInt(C,10);N=N.padStart(I,"0")}let g=p<0?"-":"",d=g+N;if(k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):f.includes("0")&&!C?d=g+N.padStart(I-g.length,"0"):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"o":{let p=y!==void 0?Math.floor(Number(y)):0;Number.isNaN(p)&&(p=0);let N=Math.abs(p).toString(8);if(C){let I=parseInt(C,10);N=N.padStart(I,"0")}let g=p<0?"-":"",d=g+N;if(k){let I=parseInt(k,10);f.includes("-")?d=d.padEnd(I):f.includes("0")&&!C?d=g+N.padStart(I-g.length,"0"):d=d.padStart(I)}c(d),A===void 0&&r++;break}case"c":{c(typeof y=="number"?String.fromCharCode(y):String(y??"").charAt(0)||""),A===void 0&&r++;break}case"%":c("%");break;default:c(e.substring(o,u+1))}o=u+1}else if(e[o]==="\\"&&o+1<e.length){let u=e[o+1];switch(u){case"n":c(`
|
|
5
5
|
`);break;case"t":c(" ");break;case"r":c("\r");break;case"\\":c("\\");break;default:c(u)}o+=2}else c(e[o++]);return s}var Me=new Map([["length",Je],["substr",et],["index",tt],["split",nt],["sub",it],["gsub",rt],["match",st],["gensub",at],["tolower",ot],["toupper",lt],["sprintf",ut],["int",ct],["sqrt",ht],["sin",pt],["cos",ft],["atan2",dt],["log",Et],["exp",mt],["rand",Nt],["srand",yt],["system",wt("system","shell execution not allowed in sandboxed environment")],["close",()=>0],["fflush",()=>0],["systime",de("systime")],["mktime",de("mktime")],["strftime",de("strftime")]]);function P(e){return typeof e=="number"?e!==0:!(e===""||e==="0")}function b(e){if(typeof e=="number")return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function v(e){return typeof e=="string"?e:(Number.isInteger(e),String(e))}function me(e){if(typeof e=="number")return!0;let t=String(e).trim();return t===""?!1:!Number.isNaN(Number(t))}function Z(e,t){try{return O(e).test(t)}catch{return!1}}function Fe(e,t){return t===""?[]:e.FS===" "?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function re(e,t){return t===0?e.line:t<0||t>e.fields.length?"":e.fields[t-1]??""}function Ne(e,t,n){if(t===0)e.line=v(n),e.fields=Fe(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push("");e.fields[t-1]=v(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function K(e,t){e.line=t,e.fields=Fe(e,t),e.NF=e.fields.length}function De(e,t){if(e.FS=t,t===" ")e.fieldSep=new X(/\s+/);else try{e.fieldSep=O(t)}catch{e.fieldSep=O(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))}}function se(e,t){switch(t){case"FS":return e.FS;case"OFS":return e.OFS;case"ORS":return e.ORS;case"OFMT":return e.OFMT;case"NR":return e.NR;case"NF":return e.NF;case"FNR":return e.FNR;case"FILENAME":return e.FILENAME;case"RSTART":return e.RSTART;case"RLENGTH":return e.RLENGTH;case"SUBSEP":return e.SUBSEP;case"ARGC":return e.ARGC}return e.vars[t]??""}function j(e,t,n){switch(t){case"FS":De(e,v(n));return;case"OFS":e.OFS=v(n);return;case"ORS":e.ORS=v(n);return;case"OFMT":e.OFMT=v(n);return;case"NR":e.NR=Math.floor(b(n));return;case"NF":{let r=Math.floor(b(n));if(r<e.NF)e.fields=e.fields.slice(0,r),e.line=e.fields.join(e.OFS);else if(r>e.NF){for(;e.fields.length<r;)e.fields.push("");e.line=e.fields.join(e.OFS)}e.NF=r;return}case"FNR":e.FNR=Math.floor(b(n));return;case"FILENAME":e.FILENAME=v(n);return;case"RSTART":e.RSTART=Math.floor(b(n));return;case"RLENGTH":e.RLENGTH=Math.floor(b(n));return;case"SUBSEP":e.SUBSEP=v(n);return}e.vars[t]=n}function Y(e,t){let n=t,r=new Set,s=e.arrayAliases.get(n);for(;s!==void 0&&!r.has(n);)r.add(n),n=s,s=e.arrayAliases.get(n);return n}function ae(e,t,n){if(t==="ARGV")return e.ARGV[n]??"";if(t==="ENVIRON")return e.ENVIRON[n]??"";let r=Y(e,t);return e.arrays[r]?.[n]??""}function ye(e,t,n,r){let s=Y(e,t);if(e.arrays[s]||(e.arrays[s]=Object.create(null)),!(n in e.arrays[s])){if(e.arrayElementCount>=e.maxArrayElements)throw new w(`array element limit exceeded (${e.maxArrayElements})`,"array_elements");e.arrayElementCount++}e.arrays[s][n]=r}function xe(e,t,n){if(t==="ARGV")return e.ARGV[n]!==void 0;if(t==="ENVIRON")return e.ENVIRON[n]!==void 0;let r=Y(e,t);return e.arrays[r]?.[n]!==void 0}function _e(e,t,n){let r=Y(e,t);e.arrays[r]&&(n in e.arrays[r]&&e.arrayElementCount--,delete e.arrays[r][n])}function Ge(e,t){let n=Y(e,t);e.arrayElementCount-=Object.keys(e.arrays[n]??{}).length,delete e.arrays[n]}var Be=null;function Ue(e){Be=e}function M(e,t){B(e.requireDefenseContext,"awk",t)}function R(e,t,n){return U(e.requireDefenseContext,"awk",t,n)}async function E(e,t){switch(M(e,"expression evaluation"),e.coverage?.hit(`awk:expr:${t.type}`),t.type){case"number":return t.value;case"string":return t.value;case"regex":return Z(t.pattern,e.line)?1:0;case"field":return St(e,t);case"variable":return se(e,t.name);case"array_access":return Rt(e,t);case"binary":return At(e,t);case"unary":return kt(e,t);case"ternary":return P(await R(e,"ternary condition evaluation",()=>E(e,t.condition)))?await R(e,"ternary consequent evaluation",()=>E(e,t.consequent)):await R(e,"ternary alternate evaluation",()=>E(e,t.alternate));case"call":return Ct(e,t.name,t.args);case"assignment":return Ot(e,t);case"pre_increment":return Lt(e,t.operand);case"pre_decrement":return Tt(e,t.operand);case"post_increment":return Pt(e,t.operand);case"post_decrement":return Mt(e,t.operand);case"in":return Ft(e,t.key,t.array);case"getline":return Dt(e,t.variable,t.file,t.command);case"tuple":return Gt(e,t.elements);default:return""}}async function St(e,t){M(e,"field reference evaluation");let n=Math.floor(b(await R(e,"field index evaluation",()=>E(e,t.index))));return re(e,n)}async function Rt(e,t){M(e,"array access evaluation");let n=v(await R(e,"array key evaluation",()=>E(e,t.key)));return ae(e,t.array,n)}async function At(e,t){M(e,"binary expression evaluation");let n=t.operator;if(n==="||")return P(await R(e,"logical-or left evaluation",()=>E(e,t.left)))||P(await R(e,"logical-or right evaluation",()=>E(e,t.right)))?1:0;if(n==="&&")return P(await R(e,"logical-and left evaluation",()=>E(e,t.left)))&&P(await R(e,"logical-and right evaluation",()=>E(e,t.right)))?1:0;if(n==="~"){let l=await R(e,"regex left evaluation",()=>E(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let c=t.right.type==="regex"?t.right.pattern:v(await R(e,"regex right evaluation",()=>E(e,t.right)));try{return O(c).test(v(l))?1:0}catch{return 0}}if(n==="!~"){let l=await R(e,"negated-regex left evaluation",()=>E(e,t.left));t.right.type==="regex"&&e.coverage?.hit("awk:expr:regex");let c=t.right.type==="regex"?t.right.pattern:v(await R(e,"negated-regex right evaluation",()=>E(e,t.right)));try{return O(c).test(v(l))?0:1}catch{return 1}}let r=await R(e,"binary left evaluation",()=>E(e,t.left)),s=await R(e,"binary right evaluation",()=>E(e,t.right));if(n===" "){let l=v(r)+v(s);if(e.maxOutputSize>0&&l.length>e.maxOutputSize)throw new w(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,"string_length",e.output);return l}if(vt(n))return It(r,s,n);let a=b(r),o=b(s);return ke(a,o,n)}function vt(e){return["<","<=",">",">=","==","!="].includes(e)}function It(e,t,n){let r=me(e),s=me(t);if(r&&s){let l=b(e),c=b(t);switch(n){case"<":return l<c?1:0;case"<=":return l<=c?1:0;case">":return l>c?1:0;case">=":return l>=c?1:0;case"==":return l===c?1:0;case"!=":return l!==c?1:0}}let a=v(e),o=v(t);switch(n){case"<":return a<o?1:0;case"<=":return a<=o?1:0;case">":return a>o?1:0;case">=":return a>=o?1:0;case"==":return a===o?1:0;case"!=":return a!==o?1:0}return 0}async function kt(e,t){M(e,"unary expression evaluation");let n=await R(e,"unary operand evaluation",()=>E(e,t.operand));switch(t.operator){case"!":return P(n)?0:1;case"-":return-b(n);case"+":return+b(n);default:return n}}async function Ct(e,t,n){M(e,"function call evaluation");let r=Me.get(t);if(r)return r(n,e,{evalExpr:a=>E(e,a)});let s=e.functions.get(t);return s?bt(e,s,n):""}async function bt(e,t,n){if(M(e,"user function call"),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new w(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,"recursion",e.output);let r=Object.create(null);for(let l of t.params)r[l]=e.vars[l];let s=[];for(let l=0;l<t.params.length;l++){let c=t.params[l];if(l<n.length){let u=n[l];u.type==="variable"&&(e.arrayAliases.set(c,u.name),s.push(c));let f=await R(e,"user function argument evaluation",()=>E(e,u));e.vars[c]=f}else e.vars[c]=""}e.hasReturn=!1,e.returnValue=void 0;let a=Be;a&&await R(e,"user function body execution",()=>a(e,t.body.statements));let o=e.returnValue??"";for(let l of t.params)r[l]!==void 0?e.vars[l]=r[l]:delete e.vars[l];for(let l of s)e.arrayAliases.delete(l);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,o}async function Ot(e,t){M(e,"assignment evaluation");let n=await R(e,"assignment value evaluation",()=>E(e,t.value)),r=t.target,s=t.operator,a;if(s==="=")a=n;else{let o;if(r.type==="field"){let u=Math.floor(b(await R(e,"assignment field index",()=>E(e,r.index))));o=re(e,u)}else if(r.type==="variable")o=se(e,r.name);else{let u=v(await R(e,"assignment array key",()=>E(e,r.key)));o=ae(e,r.array,u)}let l=b(o),c=b(n);switch(s){case"+=":a=l+c;break;case"-=":a=l-c;break;case"*=":a=l*c;break;case"/=":a=c!==0?l/c:0;break;case"%=":a=c!==0?l%c:0;break;case"^=":a=l**c;break;default:a=n}}if(r.type==="field"){let o=Math.floor(b(await R(e,"assignment target field index",()=>E(e,r.index))));Ne(e,o,a)}else if(r.type==="variable")j(e,r.name,a);else{let o=v(await R(e,"assignment target array key",()=>E(e,r.key)));ye(e,r.array,o,a)}return a}async function oe(e,t,n,r){M(e,"inc/dec evaluation");let s;if(t.type==="field"){let a=Math.floor(b(await R(e,"inc/dec field index",()=>E(e,t.index))));s=b(re(e,a)),Ne(e,a,s+n)}else if(t.type==="variable")s=b(se(e,t.name)),j(e,t.name,s+n);else{let a=v(await R(e,"inc/dec array key",()=>E(e,t.key)));s=b(ae(e,t.array,a)),ye(e,t.array,a,s+n)}return r?s+n:s}async function Lt(e,t){return oe(e,t,1,!0)}async function Tt(e,t){return oe(e,t,-1,!0)}async function Pt(e,t){return oe(e,t,1,!1)}async function Mt(e,t){return oe(e,t,-1,!1)}async function Ft(e,t,n){M(e,"in-expression evaluation");let r;if(t.type==="tuple"){e.coverage?.hit("awk:expr:tuple");let s=[];for(let a of t.elements)s.push(v(await R(e,"tuple key element evaluation",()=>E(e,a))));r=s.join(e.SUBSEP)}else r=v(await R(e,"in-expression key evaluation",()=>E(e,t)));return xe(e,n,r)?1:0}async function Dt(e,t,n,r){if(M(e,"getline evaluation"),r)return xt(e,t,r);if(n)return _t(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let s=e.lineIndex+1;if(s>=e.lines.length)return 0;let a=e.lines[s];return t?j(e,t,a):K(e,a),e.NR++,e.lineIndex=s,1}async function xt(e,t,n){let r=e.exec;if(!r)return-1;M(e,"getline command source");let s=v(await R(e,"getline command expression",()=>E(e,n))),a=e.getlineCommandStreams.get(s);if(!a)try{let c=await R(e,"getline command exec",()=>r(s)),f=ee(c.stdout).split(`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as we}from"./chunk-TDD4NFYE.js";import{a as Y}from"./chunk-
|
|
2
|
+
import{a as we}from"./chunk-TDD4NFYE.js";import{a as Y}from"./chunk-4HMWZAP7.js";import{a as be}from"./chunk-J2OBOJ64.js";import{a as le}from"./chunk-L2UW7DWF.js";import{a as ae}from"./chunk-KVG5FR5F.js";import{b as ue,c as de,d as he}from"./chunk-6D3WD6YU.js";import{d as ge}from"./chunk-IBRT3OJS.js";import{l as ie}from"./chunk-EFORKKSH.js";import{a as re}from"./chunk-GN6CQ3J4.js";import{a as me,b as ye}from"./chunk-QAYAQNCG.js";function z(e,t){switch(e.type){case"name":{let n=e.pattern,s=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(s){let a=s[1],o=t.name;if(e.ignoreCase){if(!o.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!o.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,s=t.relativePath,a=n.split("/");for(let u=0;u<a.length-1;u++){let r=a[u];if(r&&r!=="."&&r!==".."&&!r.includes("*")&&!r.includes("?")&&!r.includes("[")){let i=`/${r}/`;if(e.ignoreCase){if(!s.toLowerCase().includes(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!s.includes(i))return{matches:!1,pruned:!1,printed:!1}}}let o=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(o){let u=o[1];if(e.ignoreCase){if(!s.toLowerCase().endsWith(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!s.endsWith(u))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(s,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:ae(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let s=(Date.now()-t.mtime)/(1e3*60*60*24),a;return e.comparison==="more"?a=s>e.days:e.comparison==="less"?a=s<e.days:a=Math.floor(s)===e.days,{matches:a,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let s;return e.comparison==="more"?s=t.size>n:e.comparison==="less"?s=t.size<n:e.unit==="b"?s=Math.ceil(t.size/512)===e.value:s=t.size===n,{matches:s,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,s=e.mode&511,a;return e.matchType==="exact"?a=n===s:e.matchType==="all"?a=(n&s)===s:a=(n&s)!==0,{matches:a,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"action":return{matches:!0,pruned:!1,printed:!1,actions:[e.action]};case"not":{let n=z(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1,actions:n.actions}}case"and":{let n=z(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1,actions:n.actions};let s=z(e.right,t);return{matches:s.matches,pruned:n.pruned||s.pruned,printed:n.printed||s.printed,actions:[...n.actions??[],...s.actions??[]]}}case"or":{let n=z(e.left,t);if(n.matches)return n;let s=z(e.right,t);return{matches:s.matches,pruned:n.pruned||s.pruned,printed:s.printed,actions:[...n.actions??[],...s.actions??[]]}}}}function Z(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!1;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return Z(e.expr);case"and":case"or":return Z(e.left)||Z(e.right)}}function J(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return J(e.expr);case"and":case"or":return J(e.left)||J(e.right);default:return!1}}function Se(e){let t=[],n=s=>{s&&(s.type==="newer"?t.push(s.refPath):s.type==="not"?n(s.expr):(s.type==="and"||s.type==="or")&&(n(s.left),n(s.right)))};return n(e),t}function V(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!0;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return V(e.expr);case"and":case"or":return V(e.left)&&V(e.right)}}function B(e,t,n,s,a){switch(e.type){case"name":{let o=e.pattern,u=o.match(/^\*(\.[a-zA-Z0-9]+)$/);if(u){let r=u[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(r.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(r))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Y(t,o,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let o=e.pattern,u=o.split("/");for(let i=0;i<u.length-1;i++){let l=u[i];if(l&&l!=="."&&l!==".."&&!l.includes("*")&&!l.includes("?")&&!l.includes("[")){let p=`/${l}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(p.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(p))return{matches:!1,pruned:!1,printed:!1}}}let r=o.match(/\*(\.[a-zA-Z0-9]+)$/);if(r){let i=r[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:Y(n,o,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let o=e.ignoreCase?"i":"";return{matches:ae(e.pattern,o).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:s,pruned:!1,printed:!1}:e.fileType==="d"?{matches:a,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"action":return{matches:!0,pruned:!1,printed:!1,actions:[e.action]};case"not":{let o=B(e.expr,t,n,s,a);return{matches:!o.matches,pruned:o.pruned,printed:!1,actions:o.actions}}case"and":{let o=B(e.left,t,n,s,a);if(!o.matches)return{matches:!1,pruned:o.pruned,printed:!1,actions:o.actions};let u=B(e.right,t,n,s,a);return{matches:u.matches,pruned:o.pruned||u.pruned,printed:o.printed||u.printed,actions:[...o.actions??[],...u.actions??[]]}}case"or":{let o=B(e.left,t,n,s,a);if(o.matches)return o;let u=B(e.right,t,n,s,a);return{matches:u.matches,pruned:o.pruned||u.pruned,printed:u.printed,actions:[...o.actions??[],...u.actions??[]]}}default:return{matches:!1,pruned:!1,printed:!1}}}function _(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return _(e.expr);case"and":case"or":return _(e.left)||_(e.right);default:return!1}}function L(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!0;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return L(e.expr);case"and":case"or":return L(e.left)&&L(e.right)}}function Te(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!L(e))return oe(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:z(e,n).pruned}}function oe(e,t){switch(e.type){case"or":{if(L(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(z(e.left,n).pruned)return{shouldPrune:!0}}return oe(e.right,t)}case"and":{if(L(e.left)&&L(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:z(e,n).pruned}}if(L(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return z(e.left,n).matches?oe(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function Ce(e,t){let n=[],s=t,a=r=>({expr:null,pathIndex:s,error:`find: missing argument to \`${r}'
|
|
3
3
|
`}),o=(r,i)=>({expr:null,pathIndex:s,error:`find: invalid argument \`${i}' to \`${r}'
|
|
4
4
|
`});for(;s<e.length;){let r=e[s];if(r==="("||r==="\\("){n.push({type:"lparen"}),s++;continue}if(r===")"||r==="\\)"){n.push({type:"rparen"}),s++;continue}if(r==="-name"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"name",pattern:e[++s]}})}else if(r==="-iname"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}})}else if(r==="-path"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"path",pattern:e[++s]}})}else if(r==="-ipath"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}})}else if(r==="-regex"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}})}else if(r==="-iregex"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}})}else if(r==="-type"){if(s+1>=e.length)return a(r);let i=e[++s];if(i==="f"||i==="d")n.push({type:"expr",expr:{type:"type",fileType:i}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${i}
|
|
5
5
|
`}}else if(r==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(r==="-mtime"){if(s+1>=e.length)return a(r);let i=e[++s],l="exact",p=i;if(i.startsWith("+")?(l="more",p=i.slice(1)):i.startsWith("-")&&(l="less",p=i.slice(1)),!/^\d+$/.test(p))return o(r,i);let I=Number(p);if(!Number.isSafeInteger(I))return o(r,i);n.push({type:"expr",expr:{type:"mtime",days:I,comparison:l}})}else if(r==="-newer"){if(s+1>=e.length)return a(r);let i=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:i}})}else if(r==="-size"){if(s+1>=e.length)return a(r);let i=e[++s],l="exact",p=i;i.startsWith("+")?(l="more",p=i.slice(1)):i.startsWith("-")&&(l="less",p=i.slice(1));let I=p.match(/^(\d+)([ckMGb])?$/);if(!I)return o(r,i);let N=Number(I[1]);if(!Number.isSafeInteger(N))return o(r,i);let P=I[2]||"b",j=P==="G"?1024**3:P==="M"?1024**2:P==="k"?1024:P==="b"?512:1;if(!Number.isSafeInteger(N*j))return o(r,i);n.push({type:"expr",expr:{type:"size",value:N,unit:P,comparison:l}})}else if(r==="-perm"){if(s+1>=e.length)return a(r);let i=e[++s],l="exact",p=i;if(i.startsWith("-")?(l="all",p=i.slice(1)):i.startsWith("/")&&(l="any",p=i.slice(1)),!/^[0-7]{1,4}$/.test(p))return o(r,i);let I=Number.parseInt(p,8);n.push({type:"expr",expr:{type:"perm",mode:I,matchType:l}})}else if(r==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(r==="-not"||r==="!")n.push({type:"not"});else if(r==="-o"||r==="-or")n.push({type:"op",op:"or"});else if(r==="-a"||r==="-and")n.push({type:"op",op:"and"});else if(r==="-maxdepth"||r==="-mindepth"){if(s+1>=e.length)return a(r);s++}else if(r!=="-depth")if(r==="-exec"){let i=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)i.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n"};if(i.length===0)return a("-exec");let l=e[s]==="+";if(l&&(i.at(-1)!=="{}"||i.filter(p=>p==="{}").length!==1))return o("-exec","+");n.push({type:"expr",expr:{type:"action",action:{type:"exec",command:i,batchMode:l}}})}else if(r==="-print")n.push({type:"expr",expr:{type:"action",action:{type:"print"}}});else if(r==="-print0")n.push({type:"expr",expr:{type:"action",action:{type:"print0"}}});else if(r==="-printf"){if(s+1>=e.length)return a(r);let i=e[++s];n.push({type:"expr",expr:{type:"action",action:{type:"printf",format:i}}})}else if(r==="-delete")n.push({type:"expr",expr:{type:"action",action:{type:"delete"}}});else return r.startsWith("-")?{expr:null,pathIndex:s,error:`find: unknown predicate '${r}'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{b as D}from"./chunk-WNH3HOQA.js";import{a as A,b as h}from"./chunk-KIGPB52X.js";import{c as F,d as g}from"./chunk-
|
|
2
|
+
import{b as D}from"./chunk-WNH3HOQA.js";import{a as A,b as h}from"./chunk-KIGPB52X.js";import{c as F,d as g}from"./chunk-QXYDKHGI.js";import{a as O}from"./chunk-L2UW7DWF.js";import{b as T}from"./chunk-RT7ROXPF.js";import{a as m,b as w}from"./chunk-FOCWZZDE.js";var n={NOOP:0,READ_FILE:1,WRITE_FILE:2,STAT:3,READDIR:4,MKDIR:5,RM:6,EXISTS:7,APPEND_FILE:8,SYMLINK:9,READLINK:10,LSTAT:11,CHMOD:12,REALPATH:13,RENAME:14,COPY_FILE:15,WRITE_STDOUT:100,WRITE_STDERR:101,EXIT:102,HTTP_REQUEST:200,EXEC_COMMAND:300,INVOKE_TOOL:400},r={PENDING:0,READY:1,SUCCESS:2,ERROR:3},l={NONE:0,NOT_FOUND:1,IS_DIRECTORY:2,NOT_DIRECTORY:3,EXISTS:4,PERMISSION_DENIED:5,INVALID_PATH:6,IO_ERROR:7,TIMEOUT:8,NETWORK_ERROR:9,NETWORK_NOT_CONFIGURED:10},o={OP_CODE:0,STATUS:4,PATH_LENGTH:8,DATA_LENGTH:12,RESULT_LENGTH:16,ERROR_CODE:20,FLAGS:24,MODE:28,PATH_BUFFER:32,DATA_BUFFER:4128},p={CONTROL_REGION:32,PATH_BUFFER:4096,DATA_BUFFER:8388608,TOTAL:8392736},S={NONE:0,RECURSIVE:1,FORCE:2,MKDIR_RECURSIVE:1},u={IS_FILE:0,IS_DIRECTORY:1,IS_SYMLINK:2,MODE:4,SIZE:8,MTIME:16,TOTAL:24};function x(){return new A(p.TOTAL)}var R=class{int32View;uint8View;dataView;constructor(t){this.int32View=new Int32Array(t),this.uint8View=new Uint8Array(t),this.dataView=new DataView(t)}getOpCode(){return h.load(this.int32View,o.OP_CODE/4)}setOpCode(t){h.store(this.int32View,o.OP_CODE/4,t)}getStatus(){return h.load(this.int32View,o.STATUS/4)}setStatus(t){h.store(this.int32View,o.STATUS/4,t)}getPathLength(){return h.load(this.int32View,o.PATH_LENGTH/4)}setPathLength(t){h.store(this.int32View,o.PATH_LENGTH/4,t)}getDataLength(){return h.load(this.int32View,o.DATA_LENGTH/4)}setDataLength(t){h.store(this.int32View,o.DATA_LENGTH/4,t)}getResultLength(){return h.load(this.int32View,o.RESULT_LENGTH/4)}setResultLength(t){h.store(this.int32View,o.RESULT_LENGTH/4,t)}getErrorCode(){return h.load(this.int32View,o.ERROR_CODE/4)}setErrorCode(t){h.store(this.int32View,o.ERROR_CODE/4,t)}getFlags(){return h.load(this.int32View,o.FLAGS/4)}setFlags(t){h.store(this.int32View,o.FLAGS/4,t)}getMode(){return h.load(this.int32View,o.MODE/4)}setMode(t){h.store(this.int32View,o.MODE/4,t)}getPath(){let t=this.getPathLength(),e=this.uint8View.slice(o.PATH_BUFFER,o.PATH_BUFFER+t);return new TextDecoder().decode(e)}setPath(t){let e=new TextEncoder().encode(t);if(e.length>p.PATH_BUFFER)throw new Error(`Path too long: ${e.length} > ${p.PATH_BUFFER}`);this.uint8View.set(e,o.PATH_BUFFER),this.setPathLength(e.length)}getData(){let t=this.getDataLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setData(t){if(t.length>p.DATA_BUFFER)throw new Error(`Data too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setDataLength(t.length)}getDataAsString(){let t=this.getData();return new TextDecoder().decode(t)}setDataFromString(t){let e=new TextEncoder().encode(t);this.setData(e)}getResult(){let t=this.getResultLength();return this.uint8View.slice(o.DATA_BUFFER,o.DATA_BUFFER+t)}setResult(t){if(t.length>p.DATA_BUFFER)throw new Error(`Result too large: ${t.length} > ${p.DATA_BUFFER}`);this.uint8View.set(t,o.DATA_BUFFER),this.setResultLength(t.length)}getResultAsString(){let t=this.getResult();return new TextDecoder().decode(t)}setResultFromString(t){let e=new TextEncoder().encode(t);this.setResult(e)}encodeStat(t){this.uint8View[o.DATA_BUFFER+u.IS_FILE]=t.isFile?1:0,this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]=t.isDirectory?1:0,this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]=t.isSymbolicLink?1:0,this.dataView.setInt32(o.DATA_BUFFER+u.MODE,t.mode,!0);let e=Math.min(t.size,Number.MAX_SAFE_INTEGER);this.dataView.setFloat64(o.DATA_BUFFER+u.SIZE,e,!0),this.dataView.setFloat64(o.DATA_BUFFER+u.MTIME,t.mtime.getTime(),!0),this.setResultLength(u.TOTAL)}decodeStat(){return{isFile:this.uint8View[o.DATA_BUFFER+u.IS_FILE]===1,isDirectory:this.uint8View[o.DATA_BUFFER+u.IS_DIRECTORY]===1,isSymbolicLink:this.uint8View[o.DATA_BUFFER+u.IS_SYMLINK]===1,mode:this.dataView.getInt32(o.DATA_BUFFER+u.MODE,!0),size:this.dataView.getFloat64(o.DATA_BUFFER+u.SIZE,!0),mtime:new Date(this.dataView.getFloat64(o.DATA_BUFFER+u.MTIME,!0))}}waitForReady(t){return h.wait(this.int32View,o.STATUS/4,r.PENDING,t)}waitForReadyAsync(t){return h.waitAsync(this.int32View,o.STATUS/4,r.PENDING,t)}async waitUntilReady(t){let e=Date.now();for(;;){let a=this.getStatus();if(a===r.READY)return!0;let s=Date.now()-e;if(s>=t)return!1;let i=t-s,c=h.waitAsync(this.int32View,o.STATUS/4,a,i);if(c.async&&await c.value==="timed-out")return!1}}waitForResult(t){return h.wait(this.int32View,o.STATUS/4,r.READY,t)}notify(){return h.notify(this.int32View,o.STATUS/4)}reset(){this.setOpCode(n.NOOP),this.setStatus(r.PENDING),this.setPathLength(0),this.setDataLength(0),this.setResultLength(0),this.setErrorCode(l.NONE),this.setFlags(S.NONE),this.setMode(0)}};var C=class{fs;cwd;commandName;secureFetch;maxOutputSize;exec;invokeTool;protocol;running=!1;output={stdout:"",stderr:"",exitCode:0};outputLimitExceeded=!1;startTime=0;timeoutMs=0;constructor(t,e,a,s,i=void 0,c=0,d=void 0,E=void 0){this.fs=e,this.cwd=a,this.commandName=s,this.secureFetch=i,this.maxOutputSize=c,this.exec=d,this.invokeTool=E,this.protocol=new R(t)}remainingMs(){return Math.max(0,this.timeoutMs-(Date.now()-this.startTime))}raceDeadline(t){let e=this.remainingMs();if(e<=0)return this.running=!1,this.output.exitCode=124,this.output.stderr+=`
|
|
3
3
|
${this.commandName}: execution timeout exceeded
|
|
4
4
|
`,Promise.reject(new Error("Operation timed out"));let a=t();return e===Number.POSITIVE_INFINITY?a:new Promise((s,i)=>{let c=F(()=>{this.running=!1,this.output.exitCode=124,this.output.stderr+=`
|
|
5
5
|
${this.commandName}: execution timeout exceeded
|