@inkeep/open-knowledge 0.5.0-beta.3 → 0.5.0-beta.31
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/dist/THIRD_PARTY_NOTICES.md +1 -0
- package/dist/alias-JE7RI5QX-Bia4gLMF.mjs +1 -0
- package/dist/assets/skills/open-knowledge/SKILL.md +75 -16
- package/dist/awk2-POPGKRAI-DDrFV-7v.mjs +1 -0
- package/dist/{banner-8cQrR88n.mjs → banner-COfNQySC.mjs} +1 -1
- package/dist/base64-4YMZCVJ5-DDKKOjMm.mjs +1 -0
- package/dist/basename-AA2KJYZQ-BK5zVs3W.mjs +1 -0
- package/dist/bash-IJWYRKFO-B9r1a0X9.mjs +1 -0
- package/dist/build-B4ZT2GMK.mjs +1 -0
- package/dist/{build-fAc55Z_L.mjs → build-BZeImWox.mjs} +1 -1
- package/dist/cat-RDUMLXKC-CeNrSElK.mjs +1 -0
- package/dist/chmod-SYMGL4JA-DFJ4ylQU.mjs +1 -0
- package/dist/{chokidar-DnkSPA-1.mjs → chokidar-CxU7f6JW.mjs} +1 -1
- package/dist/{chunk-24IMIIXA-_PX4ITYZ.mjs → chunk-24IMIIXA-B6yIPkk2.mjs} +2 -2
- package/dist/{chunk-3THT3N7L-DrzOuTpA.mjs → chunk-3THT3N7L-DztAF386.mjs} +1 -1
- package/dist/{chunk-3ZUFRYJ4-BUqSdAvt.mjs → chunk-3ZUFRYJ4-qsYuZX7b.mjs} +1 -1
- package/dist/{chunk-44UOCSGV-BbZqjKvt.mjs → chunk-44UOCSGV-CaFxJDHm.mjs} +1 -1
- package/dist/{chunk-4GTNDTRF-C7Bk89yc.mjs → chunk-4GTNDTRF-PuLVuVJW.mjs} +2 -2
- package/dist/{chunk-4HHKTUW3-DaxBqSRO.mjs → chunk-4HHKTUW3-CQ53AiA_.mjs} +1 -1
- package/dist/{chunk-4Q4SM6WR-CQ3yG3KJ.mjs → chunk-4Q4SM6WR-BlQvqCag.mjs} +2 -2
- package/dist/{chunk-55VFSPNA-o6aQtPTI.mjs → chunk-55VFSPNA-DLwfww5b.mjs} +2 -2
- package/dist/{chunk-5QMZ5MUS-SLhNX8t9.mjs → chunk-5QMZ5MUS-CAp625aG.mjs} +2 -2
- package/dist/{chunk-5QVNJEHU-Besgjasu.mjs → chunk-5QVNJEHU-dbrKfPGl.mjs} +2 -2
- package/dist/{chunk-5V6VZH6T-1WdUUj8r.mjs → chunk-5V6VZH6T-DMPvCPbn.mjs} +2 -2
- package/dist/{chunk-62RKD26F-BbNaH0fp.mjs → chunk-62RKD26F-B9la0pfD.mjs} +2 -2
- package/dist/{chunk-64BAICW3-CQTRuYnm.mjs → chunk-64BAICW3-D92CLSK-.mjs} +2 -2
- package/dist/{chunk-74CEPOFO-CLQh_oXv.mjs → chunk-74CEPOFO-BcZUJMO1.mjs} +1 -1
- package/dist/{chunk-7L36YK2X-VJvKq7OX.mjs → chunk-7L36YK2X-D7Z_Qw_C.mjs} +1 -1
- package/dist/{chunk-7TSDKFEO-D7K8a1nI.mjs → chunk-7TSDKFEO-DUQhJkDy.mjs} +1 -1
- package/dist/{chunk-A4HU7SVR-SqitiwTc.mjs → chunk-A4HU7SVR-DKLaJeys.mjs} +1 -1
- package/dist/{chunk-A4JSPFCI-BzZWBgeR.mjs → chunk-A4JSPFCI-CEm2r8SB.mjs} +2 -2
- package/dist/{chunk-A5O5YHGN-DQP-O5US.mjs → chunk-A5O5YHGN-DvJz5Cpw.mjs} +2 -2
- package/dist/{chunk-A65PWWJC-C9G7KuCV.mjs → chunk-A65PWWJC-DV6RO_es.mjs} +2 -2
- package/dist/{chunk-A7A2DBEE-CWXz1JTo.mjs → chunk-A7A2DBEE-dTNL-45u.mjs} +1 -1
- package/dist/{chunk-A7ICOL4V-k5RTBWOL.mjs → chunk-A7ICOL4V-BvXPAaHu.mjs} +2 -2
- package/dist/{chunk-ALLTKNUZ-SyOkRvXW.mjs → chunk-ALLTKNUZ-Cu6JFoC4.mjs} +2 -2
- package/dist/{chunk-APT7OOP2-CriAmyUL.mjs → chunk-APT7OOP2-DmUrFuRy.mjs} +2 -2
- package/dist/{chunk-BBXLRYSX-dCISWeRn.mjs → chunk-BBXLRYSX-K758HlCs.mjs} +2 -2
- package/dist/{chunk-BRGMQKJV-Dnv0H02a.mjs → chunk-BRGMQKJV-BXc-9Cgj.mjs} +3 -3
- package/dist/{chunk-CR5AFCPT-BS9vrR_k.mjs → chunk-CR5AFCPT-DxNsgM0M.mjs} +2 -2
- package/dist/{chunk-CWQS3NFK-BQ5SUtd7.mjs → chunk-CWQS3NFK-Co4ALolT.mjs} +1 -1
- package/dist/{chunk-D4J545R4-T2J_By_d.mjs → chunk-D4J545R4-DkHLjHX6.mjs} +2 -2
- package/dist/{chunk-D6CWQ5DW-0uvJGnRG.mjs → chunk-D6CWQ5DW-7lvT8dGP.mjs} +2 -2
- package/dist/{chunk-D7MEQ3VN-CSN8BGNX.mjs → chunk-D7MEQ3VN-D8jJZr4A.mjs} +2 -2
- package/dist/{chunk-DCAAORBQ-BgX2K5fq.mjs → chunk-DCAAORBQ-C3s1D8OY.mjs} +2 -2
- package/dist/{chunk-DXB73IDG-DfmyzFzL.mjs → chunk-DXB73IDG-DIKSLkPq.mjs} +1 -1
- package/dist/{chunk-EEXR5ZDP-DUXT2_T-.mjs → chunk-EEXR5ZDP-CETL3_Uw.mjs} +1 -1
- package/dist/{chunk-EIZGF4BS-BMblx_pb.mjs → chunk-EIZGF4BS-DOoQW9jQ.mjs} +2 -2
- package/dist/{chunk-F23WWYKW-B0xoXfw7.mjs → chunk-F23WWYKW-BK2tpXPf.mjs} +2 -2
- package/dist/{chunk-F55TLFGB-CekdCv-K.mjs → chunk-F55TLFGB-Vy5RU2P3.mjs} +2 -2
- package/dist/{chunk-FEIOJCZD-Vm1q1kLH.mjs → chunk-FEIOJCZD-C25Und0M.mjs} +2 -2
- package/dist/{chunk-GCTKCWKD-ByezaQ15.mjs → chunk-GCTKCWKD-Di-RB9Qt.mjs} +1 -1
- package/dist/{chunk-GFQRA5P5-CkMj9l7f.mjs → chunk-GFQRA5P5-DnjwTqP3.mjs} +1 -1
- package/dist/{chunk-GOV5EKKI-B4qGAgcI.mjs → chunk-GOV5EKKI-CKV9jOGv.mjs} +2 -2
- package/dist/{chunk-GXVXFKBA-CQs4HBko.mjs → chunk-GXVXFKBA-CUKDClxt.mjs} +2 -2
- package/dist/{chunk-HDQ56CKY-DnAJDKCm.mjs → chunk-HDQ56CKY-MTQ75a8z.mjs} +2 -2
- package/dist/{chunk-HJQJAYMS-lEGf1x1q.mjs → chunk-HJQJAYMS-D-8Vc6Zb.mjs} +1 -1
- package/dist/{chunk-HJWBQKYG-lmVh-ZXn.mjs → chunk-HJWBQKYG-XrOcsn2f.mjs} +2 -2
- package/dist/{chunk-HWBSOZZR-CdcHflPt.mjs → chunk-HWBSOZZR-BZF8XsyZ.mjs} +2 -2
- package/dist/{chunk-HWKDQ44K-cV6V5ZgY.mjs → chunk-HWKDQ44K-wgmyck2O.mjs} +2 -2
- package/dist/{chunk-I57KEIP3-Cr5Okw7t.mjs → chunk-I57KEIP3-DipCOPKf.mjs} +2 -2
- package/dist/{chunk-IPJHKYVM-orb6vjJ1.mjs → chunk-IPJHKYVM-C3IodQq7.mjs} +1 -1
- package/dist/{chunk-J642UCRS-DfKEFKiV.mjs → chunk-J642UCRS-YiNealfn.mjs} +2 -2
- package/dist/{chunk-JVPRLUMK-Bf9V_Gv7.mjs → chunk-JVPRLUMK-VMFWXimu.mjs} +2 -2
- package/dist/{chunk-KMEYNNUA-Caoc9sHa.mjs → chunk-KMEYNNUA-pRogdye4.mjs} +2 -2
- package/dist/{chunk-LL3S3NLB-GadY6GUd.mjs → chunk-LL3S3NLB-ByBS5IDP.mjs} +2 -2
- package/dist/{chunk-LPQPILI2-DDrAB1na.mjs → chunk-LPQPILI2-FRQB9gt5.mjs} +2 -2
- package/dist/{chunk-LTZRCH7N-DsWqztAp.mjs → chunk-LTZRCH7N-46S7WKw8.mjs} +2 -2
- package/dist/{chunk-LWEGUNWT-DQ_TsrhS.mjs → chunk-LWEGUNWT-DdGmM3wr.mjs} +2 -2
- package/dist/{chunk-MDDMCKUK-Cnfznbkf.mjs → chunk-MDDMCKUK-CuRdI1Uv.mjs} +2 -2
- package/dist/{chunk-MDLLFABN-C_2lIHFT.mjs → chunk-MDLLFABN-Wd1iVjXi.mjs} +2 -2
- package/dist/{chunk-MHTUABJP-7AQ2Pv6q.mjs → chunk-MHTUABJP-BWrqic3t.mjs} +1 -1
- package/dist/{chunk-MIZPJHVH-BB7Is338.mjs → chunk-MIZPJHVH-DWdPvcYR.mjs} +2 -2
- package/dist/{chunk-MLXIYONF-BI0CC1Dm.mjs → chunk-MLXIYONF-CiCzoeGt.mjs} +2 -2
- package/dist/{chunk-MYE6AGBJ-DWNp4Fd-.mjs → chunk-MYE6AGBJ-DJo74dVC.mjs} +2 -2
- package/dist/{chunk-NAERJDUW-D3VeMMYB.mjs → chunk-NAERJDUW-CIHrNgJB.mjs} +2 -2
- package/dist/{chunk-NCNPKYJZ-BBZ5fJNa.mjs → chunk-NCNPKYJZ-BVljycUZ.mjs} +2 -2
- package/dist/{chunk-NUYSJFDK-5tRwRhY2.mjs → chunk-NUYSJFDK-BTseBdxv.mjs} +2 -2
- package/dist/{chunk-NYQYO467-Blr3IMkQ.mjs → chunk-NYQYO467-BgXuDHUQ.mjs} +2 -2
- package/dist/{chunk-OARHFVLG-Irp_vfLa.mjs → chunk-OARHFVLG-Cr0x3Si_.mjs} +2 -2
- package/dist/{chunk-OCLXQMOG-DKBkjIbk.mjs → chunk-OCLXQMOG-BW6rwyzS.mjs} +2 -2
- package/dist/{chunk-OCS6LSEM-C2EAQI0w.mjs → chunk-OCS6LSEM-D7VAOziZ.mjs} +2 -2
- package/dist/{chunk-OJDRYQWQ-D4lSWh0K.mjs → chunk-OJDRYQWQ-ikvLWpfV.mjs} +1 -1
- package/dist/{chunk-OL3S66CO-BSC-nhbc.mjs → chunk-OL3S66CO-CQnF8cPH.mjs} +2 -2
- package/dist/{chunk-PBXLG62G-9wkRpzkO.mjs → chunk-PBXLG62G-CgbPJTiw.mjs} +2 -2
- package/dist/{chunk-PP6PSHAB-BkN6oaqq.mjs → chunk-PP6PSHAB-CO4MYU__.mjs} +1 -1
- package/dist/{chunk-PYSFUGCK-C-zBGrN0.mjs → chunk-PYSFUGCK-DsRn64Ef.mjs} +2 -2
- package/dist/{chunk-QCDB2VPH-BUg_3i-W.mjs → chunk-QCDB2VPH-BUMOhlW7.mjs} +2 -2
- package/dist/{chunk-QJ7O6ZN3-h8P6Rj5g.mjs → chunk-QJ7O6ZN3-F0_rcDPM.mjs} +2 -2
- package/dist/{chunk-R6QSAL5T-CBXSpChE.mjs → chunk-R6QSAL5T-CeW6f7-x.mjs} +1 -1
- package/dist/{chunk-R6VWJ2ZL-DSqbA7Rj.mjs → chunk-R6VWJ2ZL-FwG_Za20.mjs} +1 -1
- package/dist/{chunk-RPNGRAAP-BVzuWIcl.mjs → chunk-RPNGRAAP-BmkapBPD.mjs} +2 -2
- package/dist/{chunk-SDNKECQQ-CQaGD8tt.mjs → chunk-SDNKECQQ-DkebEzkd.mjs} +2 -2
- package/dist/{chunk-SYMJJMQ4-C3GxJv_z.mjs → chunk-SYMJJMQ4-DOZMaECk.mjs} +2 -2
- package/dist/{chunk-T56QNPHK-DLf9xkTG.mjs → chunk-T56QNPHK-DPXaSSfC.mjs} +2 -2
- package/dist/{chunk-TLSUDHID-BHtR3boD.mjs → chunk-TLSUDHID-Ckw-B5Ug.mjs} +2 -2
- package/dist/{chunk-TOMNU26N-DerX6zSM.mjs → chunk-TOMNU26N-AAglMy4J.mjs} +2 -2
- package/dist/{chunk-TXBZCHCQ-CAbfX7on.mjs → chunk-TXBZCHCQ-WeVWfqYv.mjs} +2 -2
- package/dist/{chunk-UNYNJIFU-Bd2svF5l.mjs → chunk-UNYNJIFU-CqGlXAg7.mjs} +3 -3
- package/dist/{chunk-V7TAPXDL-BUbPC-Wn.mjs → chunk-V7TAPXDL-DQgGPvBY.mjs} +2 -2
- package/dist/{chunk-VJFXDYWH-B5EkAwKK.mjs → chunk-VJFXDYWH-DIo0Ia0_.mjs} +2 -2
- package/dist/{chunk-VLGZJRPG-C9UlHcZa.mjs → chunk-VLGZJRPG-DymOu90-.mjs} +2 -2
- package/dist/{chunk-VOBGTVA6-BbJdoZlr.mjs → chunk-VOBGTVA6-Bfa1NTzt.mjs} +2 -2
- package/dist/{chunk-VYOJP4TV-B4Ua-c0F.mjs → chunk-VYOJP4TV-PBsHe2md.mjs} +2 -2
- package/dist/{chunk-WKFATFPP-DWw-N9hi.mjs → chunk-WKFATFPP-KO2zkfs2.mjs} +2 -2
- package/dist/{chunk-X2AJGDEF-BosVr67X.mjs → chunk-X2AJGDEF-D5w6wtaX.mjs} +1 -1
- package/dist/{chunk-XHM67O4N-Cd7Fiqsb.mjs → chunk-XHM67O4N-akBjDPaR.mjs} +1 -1
- package/dist/{chunk-XKQRETAK-ud_FNcYV.mjs → chunk-XKQRETAK-RHzVmuiF.mjs} +2 -2
- package/dist/{chunk-XORM457F-B_0Xbzib.mjs → chunk-XORM457F-wr_DBBnV.mjs} +2 -2
- package/dist/{chunk-XVDPCNWR-DNk_0jVb.mjs → chunk-XVDPCNWR-DxaG1FfA.mjs} +2 -2
- package/dist/{chunk-YCFVLTST-0XsXjpJU.mjs → chunk-YCFVLTST-Dzwevuc3.mjs} +2 -2
- package/dist/{chunk-YFG2CMIF-BwW9XX2A.mjs → chunk-YFG2CMIF-BoZQym0L.mjs} +2 -2
- package/dist/{chunk-YNYSPYQ5-Dq-BWW-f.mjs → chunk-YNYSPYQ5-DesxOVHh.mjs} +1 -1
- package/dist/{chunk-YS3AZT3J-CLwj1P0Z.mjs → chunk-YS3AZT3J-CBc9LHIy.mjs} +2 -2
- package/dist/{chunk-YTNYSM6T-TIb8x1lA.mjs → chunk-YTNYSM6T-WMIf3AF8.mjs} +2 -2
- package/dist/{chunk-Z6LRHWXI-VE8VWpH9.mjs → chunk-Z6LRHWXI-DGTVoTuf.mjs} +2 -2
- package/dist/{chunk-Z7JVV2SM-BAsPuUWb.mjs → chunk-Z7JVV2SM-Cb4YKOCM.mjs} +2 -2
- package/dist/clear-5CZ5X4YR-CadVxKrq.mjs +1 -0
- package/dist/cli.mjs +47 -42
- package/dist/column-WLPMMSTS-6o4DDsDk.mjs +1 -0
- package/dist/comm-5SLSESQG-C2GatHU6.mjs +1 -0
- package/dist/constants-C23ReeDn.mjs +2 -0
- package/dist/cp-XOYR4ABJ-DmS6dER-.mjs +1 -0
- package/dist/{curl-47BFPSFW-BzVtpc-O.mjs → curl-47BFPSFW-C2kRcGkX.mjs} +2 -2
- package/dist/cut-OPC3VAGB-s4tQWhL5.mjs +1 -0
- package/dist/date-DD7FVA2V-Dubgjr6a.mjs +1 -0
- package/dist/diff-HJF2MPDN-wUotW5Vg.mjs +1 -0
- package/dist/dirname-LEMTZZFS-B477CImE.mjs +1 -0
- package/dist/dist-DWcefRnU.mjs +1 -0
- package/dist/dist-skpW64GN.mjs +3266 -0
- package/dist/du-WO2ENHXQ-C4c5wweW.mjs +1 -0
- package/dist/echo-O45JWWI2-TudodhHR.mjs +1 -0
- package/dist/env-5EPCWSXR-CTcNEMpy.mjs +1 -0
- package/dist/{execAsync-Bpfn4nfY.mjs → execAsync-CulVJBMN.mjs} +1 -1
- package/dist/{execAsync-D93HRpVy.mjs → execAsync-CzW9fUYQ.mjs} +1 -1
- package/dist/{execAsync-DMx5TUjh.mjs → execAsync-DuQoqWaW.mjs} +1 -1
- package/dist/expand-DTNXU4LQ-BT6M2Tdc.mjs +1 -0
- package/dist/expansion-ENLSRCXJ-Cy7j--Iy.mjs +1 -0
- package/dist/expr-5T3UU5KE-D2Kr5nuJ.mjs +1 -0
- package/dist/file-ZIGAJ4YS-BH3jYcuM.mjs +1 -0
- package/dist/find-TPUOAIUQ-RFxkUcGN.mjs +1 -0
- package/dist/flag-coverage-QT4N2Z44-D6C8h97H.mjs +2 -0
- package/dist/fold-LDSORVYE-CfKQmrJ1.mjs +1 -0
- package/dist/{getMachineId-bsd-B3nMvpKd.mjs → getMachineId-bsd-DAmB-Ym0.mjs} +2 -2
- package/dist/{getMachineId-bsd-CbGsKq4x.mjs → getMachineId-bsd-FYDP9w5Q.mjs} +2 -2
- package/dist/{getMachineId-bsd-Cbosky3N.mjs → getMachineId-bsd-mPrX3ckm.mjs} +2 -2
- package/dist/{getMachineId-darwin-BNex6tJ8.mjs → getMachineId-darwin-B0Qw-MTj.mjs} +2 -2
- package/dist/{getMachineId-darwin-BnJVzhVS.mjs → getMachineId-darwin-C79HtyON.mjs} +2 -2
- package/dist/{getMachineId-darwin-UUooObuL.mjs → getMachineId-darwin-Co8Jnu5v.mjs} +2 -2
- package/dist/{getMachineId-linux-Bo4OhbSY.mjs → getMachineId-linux-BBORs2cS.mjs} +1 -1
- package/dist/{getMachineId-linux-D4ybKI-D.mjs → getMachineId-linux-BizmCjYq.mjs} +1 -1
- package/dist/{getMachineId-linux-BCV7VFT0.mjs → getMachineId-linux-BvLCCmKQ.mjs} +1 -1
- package/dist/{getMachineId-unsupported-DKWpTC9E.mjs → getMachineId-unsupported-Bgp-Es9j.mjs} +1 -1
- package/dist/{getMachineId-unsupported-DYYMUAWj.mjs → getMachineId-unsupported-CbR45h2D.mjs} +1 -1
- package/dist/{getMachineId-unsupported-4i2apDO3.mjs → getMachineId-unsupported-DbGFOAw1.mjs} +1 -1
- package/dist/{getMachineId-win-E9RqBHbs.mjs → getMachineId-win-CT_Y5i_4.mjs} +2 -2
- package/dist/{getMachineId-win-W9lSyLKl.mjs → getMachineId-win-Cy0XHq4X.mjs} +2 -2
- package/dist/{getMachineId-win-CHxnm_JZ.mjs → getMachineId-win-D5gDnBHa.mjs} +2 -2
- package/dist/grep-3AIAIJVR-DgQJLmW0.mjs +1 -0
- package/dist/gzip-AQXSGOVS-yXjpnIVd.mjs +1 -0
- package/dist/head-HT2B6D2J-BR4RHRTk.mjs +1 -0
- package/dist/help-VVWX7SA5-M6C6klSC.mjs +1 -0
- package/dist/history-J4QRNGRO-C1r7-kvT.mjs +1 -0
- package/dist/hostname-BK6HG2DE-BBBcRrtV.mjs +1 -0
- package/dist/html-to-markdown-TFCECAGV-B9oYuMVf.mjs +1 -0
- package/dist/index.d.mts +41 -2
- package/dist/index.mjs +1 -1
- package/dist/init-B3J_-zTb.mjs +1 -0
- package/dist/init-DzXCTK5n.mjs +408 -0
- package/dist/join-GG2LDHE5-xeTE0Mi4.mjs +1 -0
- package/dist/jq-ODXZBPLY-C5v6qNu_.mjs +1 -0
- package/dist/{js-exec-M6UR76J5-2jDKLOtz.mjs → js-exec-M6UR76J5-IyD-lpzv.mjs} +2 -2
- package/dist/{lib-CxZz7HCo.mjs → lib-BOCdCkg7.mjs} +1 -1
- package/dist/{libesm-YL3Bqolr.mjs → libesm-Cfo1LhlX.mjs} +1 -1
- package/dist/ln-4TRFBYAT-4XMTO1OQ.mjs +1 -0
- package/dist/loader-B87welgS.mjs +1 -0
- package/dist/loader-C7g79CJa.mjs +4 -0
- package/dist/ls-KSXFZCWH-Bw_Cf-VY.mjs +1 -0
- package/dist/{lzma-noRZ7I73.mjs → lzma-vr8hBkhz.mjs} +1 -1
- package/dist/md5sum-INMIK4DX-CAIH4ZVI.mjs +1 -0
- package/dist/mkdir-TDEMSB6C-D1oUG8Jf.mjs +1 -0
- package/dist/mv-Z6MORUFL-CN471qcL.mjs +1 -0
- package/dist/nl-U5YJDM32-CFzXKze3.mjs +1 -0
- package/dist/od-VJEF2UR5-C2R4Accu.mjs +1 -0
- package/dist/{open-browser-BOeCxs2W.mjs → open-browser-Be-7qaQ9.mjs} +1 -1
- package/dist/paste-7N6AFSDS-bUl2Dwz3.mjs +1 -0
- package/dist/{preview-D4TVVGvQ.mjs → preview-CKL6eBTV.mjs} +2 -2
- package/dist/preview-DxTiuMxx.mjs +1 -0
- package/dist/printf-CX64KX2P-Ce--gWAq.mjs +1 -0
- package/dist/public/assets/ActivityModeContent-BjhURGym.js +2 -0
- package/dist/public/assets/{ConsentDialogBody-zb1TKG9i.js → ConsentDialogBody-vyrObxKh.js} +1 -1
- package/dist/public/assets/DocumentContext-rbQfeAUg.js +52 -0
- package/dist/public/assets/{GraphPanel-5-zTeMY1.js → GraphPanel-D8ocu4BS.js} +3 -3
- package/dist/public/assets/{McpConsentDialogBody-C8ewMYVI.js → McpConsentDialogBody-D6COAaWG.js} +1 -1
- package/dist/public/assets/SettingsDialog-hh3u6NJH.js +11 -0
- package/dist/public/assets/SourceEditor-BzSBfvHJ.js +2 -0
- package/dist/public/assets/{agent-presence-BrTlNKmt.js → agent-presence-C9zIlaSm.js} +1 -1
- package/dist/public/assets/button-jHkzz0kg.js +1 -0
- package/dist/public/assets/config-validation-events-BUFsk60P.js +10 -0
- package/dist/public/assets/dialog-aTGC_OHs.js +45 -0
- package/dist/public/assets/{dist-Bej94Urx.js → dist-BpKSkQFf.js} +1 -1
- package/dist/public/assets/{dist-Cg-Qaqw_.js → dist-CcCHwIMj.js} +1 -1
- package/dist/public/assets/doc-hash--ONYdqgv.js +423 -0
- package/dist/public/assets/index-C6xVScJ4.css +1 -0
- package/dist/public/assets/index-CWC1rKJT.js +1853 -0
- package/dist/public/assets/{input-hZk8Tm0e.js → input-_NgekzP6.js} +1 -1
- package/dist/public/assets/{label-Dv_9VZWz.js → label-D3fsVWmW.js} +1 -1
- package/dist/public/assets/mcp-consent-store-Cf5AdDXf.js +1 -0
- package/dist/public/assets/{panel-8fydlQgn.js → panel-DfWmoeYO.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-COKjYFzE.js → target-navigation-intent-DG20dIBx.js} +1 -1
- package/dist/public/assets/{telemetry-impl-C6x9yckj.js → telemetry-impl-IWNN1g1D.js} +1 -1
- package/dist/public/assets/{textarea-gXd-JXvQ.js → textarea-BSSBCXzx.js} +1 -1
- package/dist/public/assets/toggle-group-dO-SybwD.js +1 -0
- package/dist/public/assets/tooltip-BKfwjO9N.js +1 -0
- package/dist/public/assets/{typing-burst-detector-wbnGbURk.js → typing-burst-detector-DaUu9BH7.js} +2 -2
- package/dist/public/index.html +19 -19
- package/dist/pwd-D4OZ7N27-C18XewhV.mjs +1 -0
- package/dist/{python3-AUFTPCU6-C74hXpFG.mjs → python3-AUFTPCU6-BaJugIdp.mjs} +2 -2
- package/dist/readlink-MI4GCHJF-CHvs7DDT.mjs +1 -0
- package/dist/repair-launch-json-B7_IxnmC.mjs +2 -0
- package/dist/repair-mcp-configs-BDZS3pY1.mjs +2 -0
- package/dist/rev-XOSYPP45-2mnFFZWW.mjs +1 -0
- package/dist/rg-FOQSCCX3-BJahNfSe.mjs +1 -0
- package/dist/rm-RTZG23RL-D9-0WGRY.mjs +1 -0
- package/dist/rmdir-XTQXT7RK-Br7eH9kL.mjs +1 -0
- package/dist/sed-VFTTATXJ-mYhAmixc.mjs +1 -0
- package/dist/seq-RN5ZUASB-CKf5MNNO.mjs +1 -0
- package/dist/sha1sum-VJPNLNU6-DuOHap1X.mjs +1 -0
- package/dist/sha256sum-PI32XWXY-D9fEipQ7.mjs +1 -0
- package/dist/sleep-VZFPZFWA-B1fSoYuO.mjs +1 -0
- package/dist/sort-DCNRDA7U-DDCY4JZu.mjs +1 -0
- package/dist/split-SITCSYCZ-b9hfEJw7.mjs +1 -0
- package/dist/sqlite3-56UMWEY3-BQEx5i3P.mjs +1 -0
- package/dist/src-D49TwBTr.mjs +2 -0
- package/dist/start-BhVtI9A5.mjs +3 -0
- package/dist/start-DltZqbet.mjs +1 -0
- package/dist/stat-BT5A227F-Dzp4sgau.mjs +1 -0
- package/dist/strings-7PLOGTPD-DT41jX9d.mjs +1 -0
- package/dist/tac-SJGXQ4T2-BpdVoP8b.mjs +1 -0
- package/dist/tail-S5ULNTJU-0-sYrYik.mjs +1 -0
- package/dist/tar-ANUBEFJY-Wh3na_NU.mjs +1 -0
- package/dist/tee-O7VXZDCO-CwnGG0go.mjs +1 -0
- package/dist/time-DEUO3QV2-DzkqaQ1k.mjs +1 -0
- package/dist/timeout-VRKMCG72-BtPBpIRq.mjs +1 -0
- package/dist/touch-DX2IJOQ4-KW0Ui-lB.mjs +1 -0
- package/dist/tr-2HXZRDSW-C6Kf0M8T.mjs +1 -0
- package/dist/tree-LYXBS7DC-BN1FBqvM.mjs +1 -0
- package/dist/true-WHJNXCHG-DxCMVdqj.mjs +1 -0
- package/dist/unexpand-RGTMIGZM-DZ4Kf6Xq.mjs +1 -0
- package/dist/uniq-SUNANL47-Ceg51JdA.mjs +1 -0
- package/dist/wc-TQB3VNOX-BzWNq0MY.mjs +1 -0
- package/dist/which-XZHEH76L-DH_U2-Cj.mjs +1 -0
- package/dist/whoami-DGKU3D2X-BholYNPM.mjs +1 -0
- package/dist/xan-BXDXYEIB-b1eAtgch.mjs +1 -0
- package/dist/xan-view-ECQUO7AJ-DWDC57b_.mjs +1 -0
- package/dist/xargs-I6EZUCYF-Cov-i7kW.mjs +1 -0
- package/dist/yq-MJMAR36V-1r29nH4p.mjs +1 -0
- package/package.json +3 -3
- package/dist/alias-JE7RI5QX-BCGl9_yw.mjs +0 -1
- package/dist/awk2-POPGKRAI-CGGIG9fD.mjs +0 -1
- package/dist/base64-4YMZCVJ5-DQZX3-n8.mjs +0 -1
- package/dist/basename-AA2KJYZQ-BxQSdX4k.mjs +0 -1
- package/dist/bash-IJWYRKFO-BitzNsGT.mjs +0 -1
- package/dist/build-GAD37AZK.mjs +0 -1
- package/dist/cat-RDUMLXKC-DT-A9snL.mjs +0 -1
- package/dist/chmod-SYMGL4JA-DjEw7qQb.mjs +0 -1
- package/dist/clear-5CZ5X4YR-ph4db-bT.mjs +0 -1
- package/dist/column-WLPMMSTS-BCX6Q17n.mjs +0 -1
- package/dist/comm-5SLSESQG-C7AhH0K0.mjs +0 -1
- package/dist/constants-CdfqNseZ.mjs +0 -2
- package/dist/cp-XOYR4ABJ-CQdiaiBl.mjs +0 -1
- package/dist/cut-OPC3VAGB-oTKBumd9.mjs +0 -1
- package/dist/date-DD7FVA2V-BrmKZaC_.mjs +0 -1
- package/dist/diff-HJF2MPDN-BNIGqrz6.mjs +0 -1
- package/dist/dirname-LEMTZZFS-BwH_Sy4c.mjs +0 -1
- package/dist/dist-B57jcfo9.mjs +0 -2584
- package/dist/dist-BGL0ZAep.mjs +0 -360
- package/dist/dist-CitXaW0V.mjs +0 -1
- package/dist/du-WO2ENHXQ-CaFJHtt9.mjs +0 -1
- package/dist/echo-O45JWWI2-BVUJjhWK.mjs +0 -1
- package/dist/env-5EPCWSXR-DH5CCl6V.mjs +0 -1
- package/dist/expand-DTNXU4LQ-eK5V8PVi.mjs +0 -1
- package/dist/expansion-ENLSRCXJ-DJReNXZq.mjs +0 -1
- package/dist/expr-5T3UU5KE-DTdq14FE.mjs +0 -1
- package/dist/file-ZIGAJ4YS-WHJtEeVR.mjs +0 -1
- package/dist/find-TPUOAIUQ-Dk362bwv.mjs +0 -1
- package/dist/flag-coverage-QT4N2Z44-C5s46vwi.mjs +0 -2
- package/dist/fold-LDSORVYE-CkRa6rpW.mjs +0 -1
- package/dist/grep-3AIAIJVR-9FFpNxXg.mjs +0 -1
- package/dist/gzip-AQXSGOVS-B69jDA3r.mjs +0 -1
- package/dist/head-HT2B6D2J-LVz3MZgn.mjs +0 -1
- package/dist/help-VVWX7SA5-NiesqNE9.mjs +0 -1
- package/dist/history-J4QRNGRO-CJ6sdqLF.mjs +0 -1
- package/dist/hostname-BK6HG2DE-BTiQGLXj.mjs +0 -1
- package/dist/html-to-markdown-TFCECAGV-gA9lIhli.mjs +0 -1
- package/dist/init-CYRb_5EB.mjs +0 -1
- package/dist/init-WxyC-q6H.mjs +0 -408
- package/dist/join-GG2LDHE5-DP2t9Lzd.mjs +0 -1
- package/dist/jq-ODXZBPLY-DIh5TTSi.mjs +0 -1
- package/dist/ln-4TRFBYAT-CcfWdebC.mjs +0 -1
- package/dist/loader-49cQC73v.mjs +0 -4
- package/dist/loader-CcNPgKn1.mjs +0 -1
- package/dist/ls-KSXFZCWH-Ck3u5K5M.mjs +0 -1
- package/dist/md5sum-INMIK4DX-B5BLDgGd.mjs +0 -1
- package/dist/mkdir-TDEMSB6C-BHFCS7vA.mjs +0 -1
- package/dist/mv-Z6MORUFL-CmLWSH1J.mjs +0 -1
- package/dist/nl-U5YJDM32-Cn7q_PFe.mjs +0 -1
- package/dist/od-VJEF2UR5-BMxC8c-2.mjs +0 -1
- package/dist/paste-7N6AFSDS-C9XyEur2.mjs +0 -1
- package/dist/preview-gwaAyRK2.mjs +0 -1
- package/dist/printf-CX64KX2P-Hzp-xme8.mjs +0 -1
- package/dist/public/assets/ActivityModeContent-CDvwQiJl.js +0 -2
- package/dist/public/assets/DocumentContext-DsG0dRJh.js +0 -41
- package/dist/public/assets/SettingsDialog-CzUxAbsW.js +0 -11
- package/dist/public/assets/SourceEditor-Bc46I85k.js +0 -2
- package/dist/public/assets/button-C1nwPVFQ.js +0 -1
- package/dist/public/assets/config-validation-events-kuYsS9Uy.js +0 -10
- package/dist/public/assets/dialog-CY2eQd6O.js +0 -45
- package/dist/public/assets/doc-hash-CaKfwYBW.js +0 -422
- package/dist/public/assets/index-DThsdx9L.js +0 -1853
- package/dist/public/assets/index-wYiupFbR.css +0 -1
- package/dist/public/assets/mcp-consent-store-DZ1pCmhN.js +0 -1
- package/dist/public/assets/toggle-group-zxAmL7AG.js +0 -1
- package/dist/public/assets/tooltip-DfmK7iDN.js +0 -1
- package/dist/pwd-D4OZ7N27-CxX1ETVW.mjs +0 -1
- package/dist/readlink-MI4GCHJF-DeD4E7nz.mjs +0 -1
- package/dist/rev-XOSYPP45-BnymxcnA.mjs +0 -1
- package/dist/rg-FOQSCCX3-BiJSKli9.mjs +0 -1
- package/dist/rm-RTZG23RL-Djvo3nEY.mjs +0 -1
- package/dist/rmdir-XTQXT7RK-OI_3n90A.mjs +0 -1
- package/dist/sed-VFTTATXJ-Tyu5G4I6.mjs +0 -1
- package/dist/seq-RN5ZUASB-CG-hfPIu.mjs +0 -1
- package/dist/sha1sum-VJPNLNU6-CEXqRxvP.mjs +0 -1
- package/dist/sha256sum-PI32XWXY-Bxzw_ykX.mjs +0 -1
- package/dist/sleep-VZFPZFWA-WRTGZhTn.mjs +0 -1
- package/dist/sort-DCNRDA7U-CuSJrCSQ.mjs +0 -1
- package/dist/split-SITCSYCZ-DqKN3r-A.mjs +0 -1
- package/dist/sqlite3-56UMWEY3-C6G8A9IC.mjs +0 -1
- package/dist/src-D8dkz5py.mjs +0 -2
- package/dist/start-C2EAqlEk.mjs +0 -1
- package/dist/start-GpGsUB8n.mjs +0 -3
- package/dist/stat-BT5A227F-D3-4IZjb.mjs +0 -1
- package/dist/strings-7PLOGTPD-DoJhZcXP.mjs +0 -1
- package/dist/tac-SJGXQ4T2-CGNEtOiG.mjs +0 -1
- package/dist/tail-S5ULNTJU-17nfIM0G.mjs +0 -1
- package/dist/tar-ANUBEFJY-C-eZUMPO.mjs +0 -1
- package/dist/tee-O7VXZDCO-D4C0E2s8.mjs +0 -1
- package/dist/time-DEUO3QV2-Wc9ZVUVu.mjs +0 -1
- package/dist/timeout-VRKMCG72-2MptSPRD.mjs +0 -1
- package/dist/touch-DX2IJOQ4-DOTz2-NU.mjs +0 -1
- package/dist/tr-2HXZRDSW-5aOBfN_I.mjs +0 -1
- package/dist/tree-LYXBS7DC-BVyeg_3R.mjs +0 -1
- package/dist/true-WHJNXCHG-QiTH9f1Z.mjs +0 -1
- package/dist/unexpand-RGTMIGZM-m3YwxdOg.mjs +0 -1
- package/dist/uniq-SUNANL47-CuhWyTTO.mjs +0 -1
- package/dist/wc-TQB3VNOX-CaEqXvYd.mjs +0 -1
- package/dist/which-XZHEH76L-DA_Bm_KM.mjs +0 -1
- package/dist/whoami-DGKU3D2X-Bdt58SNY.mjs +0 -1
- package/dist/xan-BXDXYEIB-CWBZ1rgf.mjs +0 -1
- package/dist/xan-view-ECQUO7AJ-eo_owVyX.mjs +0 -1
- package/dist/xargs-I6EZUCYF-VBH5v0oN.mjs +0 -1
- package/dist/yq-MJMAR36V-eZBfA9vJ.mjs +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-74CEPOFO-
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var n={name:`history`,summary:`display command history`,usage:`history [n]`,options:[`-c clear the history list`,` --help display this help and exit`]},r=`BASH_HISTORY`,i={name:`history`,async execute(i,a){if(t(i))return e(n);let o=a.env.get(r)||`[]`,s;try{s=JSON.parse(o)}catch{s=[]}if(i[0]===`-c`)return a.env.set(r,`[]`),{stdout:``,stderr:``,exitCode:0};let c=s.length;i[0]&&/^\d+$/.test(i[0])&&(c=Math.min(parseInt(i[0],10),s.length));let l=s.length-c,u=``;for(let e=l;e<s.length;e++){let t=(e+1).toString().padStart(5,` `);u+=`${t} ${s[e]}
|
|
2
2
|
`}return{stdout:u,stderr:``,exitCode:0}}},a={name:`history`,flags:[{flag:`-c`,type:`boolean`}]};export{a as n,i as t};
|
|
3
|
-
//# sourceMappingURL=chunk-NCNPKYJZ-
|
|
3
|
+
//# sourceMappingURL=chunk-NCNPKYJZ-BVljycUZ.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{t as e}from"./chunk-44UOCSGV-
|
|
1
|
+
import{t as e}from"./chunk-44UOCSGV-CaFxJDHm.mjs";import{r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as r}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var i={name:`cp`,summary:`copy files and directories`,usage:`cp [OPTION]... SOURCE... DEST`,options:[`-r, -R, --recursive copy directories recursively`,`-n, --no-clobber do not overwrite an existing file`,`-p, --preserve preserve file attributes`,`-v, --verbose explain what is being done`,` --help display this help and exit`]},a={recursive:{short:`r`,long:`recursive`,type:`boolean`},recursiveUpper:{short:`R`,type:`boolean`},noClobber:{short:`n`,long:`no-clobber`,type:`boolean`},preserve:{short:`p`,long:`preserve`,type:`boolean`},verbose:{short:`v`,long:`verbose`,type:`boolean`}},o={name:`cp`,async execute(o,s){if(n(o))return t(i);let c=r(`cp`,o,a);if(!c.ok)return c.error;let l=c.result.flags.recursive||c.result.flags.recursiveUpper,u=c.result.flags.noClobber;c.result.flags.preserve;let d=c.result.flags.verbose,f=c.result.positional;if(f.length<2)return{stdout:``,stderr:`cp: missing destination file operand
|
|
2
2
|
`,exitCode:1};let p=f.pop()??``,m=f,h=s.fs.resolvePath(s.cwd,p),g=``,_=``,v=0,y=!1;try{y=(await s.fs.stat(h)).isDirectory}catch{}if(m.length>1&&!y)return{stdout:``,stderr:`cp: target '${p}' is not a directory
|
|
3
3
|
`,exitCode:1};for(let t of m)try{let e=s.fs.resolvePath(s.cwd,t),n=await s.fs.stat(e),r=h;if(y){let e=t.split(`/`).pop()||t;r=h===`/`?`/${e}`:`${h}/${e}`}if(n.isDirectory&&!l){_+=`cp: -r not specified; omitting directory '${t}'
|
|
4
4
|
`,v=1;continue}if(u)try{await s.fs.stat(r);continue}catch{}await s.fs.cp(e,r,{recursive:l}),d&&(g+=`'${t}' -> '${r}'
|
|
5
5
|
`)}catch(n){let r=e(n);r.includes(`ENOENT`)||r.includes(`no such file`)?_+=`cp: cannot stat '${t}': No such file or directory
|
|
6
6
|
`:_+=`cp: cannot copy '${t}': ${r}
|
|
7
7
|
`,v=1}return{stdout:g,stderr:_,exitCode:v}}},s={name:`cp`,flags:[{flag:`-r`,type:`boolean`},{flag:`-R`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-p`,type:`boolean`},{flag:`-v`,type:`boolean`}],needsArgs:!0,minArgs:2};export{s as n,o as t};
|
|
8
|
-
//# sourceMappingURL=chunk-NUYSJFDK-
|
|
8
|
+
//# sourceMappingURL=chunk-NUYSJFDK-BTseBdxv.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-YNYSPYQ5-
|
|
1
|
+
import{t as e}from"./chunk-YNYSPYQ5-DesxOVHh.mjs";import{t}from"./chunk-IPJHKYVM-C3IodQq7.mjs";import{n,r,t as i}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{s as a}from"./chunk-7TSDKFEO-DUQhJkDy.mjs";import{n as o,r as s,t as c}from"./chunk-VLGZJRPG-DymOu90-.mjs";import{gunzipSync as l}from"node:zlib";var u=a({js:{extensions:[`.js`,`.mjs`,`.cjs`,`.jsx`],globs:[]},ts:{extensions:[`.ts`,`.tsx`,`.mts`,`.cts`],globs:[]},html:{extensions:[`.html`,`.htm`,`.xhtml`],globs:[]},css:{extensions:[`.css`,`.scss`,`.sass`,`.less`],globs:[]},json:{extensions:[`.json`,`.jsonc`,`.json5`],globs:[]},xml:{extensions:[`.xml`,`.xsl`,`.xslt`],globs:[]},c:{extensions:[`.c`,`.h`],globs:[]},cpp:{extensions:[`.cpp`,`.cc`,`.cxx`,`.hpp`,`.hh`,`.hxx`,`.h`],globs:[]},rust:{extensions:[`.rs`],globs:[]},go:{extensions:[`.go`],globs:[]},zig:{extensions:[`.zig`],globs:[]},java:{extensions:[`.java`],globs:[]},kotlin:{extensions:[`.kt`,`.kts`],globs:[]},scala:{extensions:[`.scala`,`.sc`],globs:[]},clojure:{extensions:[`.clj`,`.cljc`,`.cljs`,`.edn`],globs:[]},py:{extensions:[`.py`,`.pyi`,`.pyw`],globs:[]},rb:{extensions:[`.rb`,`.rake`,`.gemspec`],globs:[`Rakefile`,`Gemfile`]},php:{extensions:[`.php`,`.phtml`,`.php3`,`.php4`,`.php5`],globs:[]},perl:{extensions:[`.pl`,`.pm`,`.pod`,`.t`],globs:[]},lua:{extensions:[`.lua`],globs:[]},sh:{extensions:[`.sh`,`.bash`,`.zsh`,`.fish`],globs:[`.bashrc`,`.zshrc`,`.profile`]},bat:{extensions:[`.bat`,`.cmd`],globs:[]},ps:{extensions:[`.ps1`,`.psm1`,`.psd1`],globs:[]},yaml:{extensions:[`.yaml`,`.yml`],globs:[]},toml:{extensions:[`.toml`],globs:[`Cargo.toml`,`pyproject.toml`]},ini:{extensions:[`.ini`,`.cfg`,`.conf`],globs:[]},csv:{extensions:[`.csv`,`.tsv`],globs:[]},md:{extensions:[`.md`,`.mdx`,`.markdown`,`.mdown`,`.mkd`],globs:[]},markdown:{extensions:[`.md`,`.mdx`,`.markdown`,`.mdown`,`.mkd`],globs:[]},rst:{extensions:[`.rst`],globs:[]},txt:{extensions:[`.txt`,`.text`],globs:[]},tex:{extensions:[`.tex`,`.ltx`,`.sty`,`.cls`],globs:[]},sql:{extensions:[`.sql`],globs:[]},graphql:{extensions:[`.graphql`,`.gql`],globs:[]},proto:{extensions:[`.proto`],globs:[]},make:{extensions:[`.mk`,`.mak`],globs:[`Makefile`,`GNUmakefile`,`makefile`]},docker:{extensions:[],globs:[`Dockerfile`,`Dockerfile.*`,`*.dockerfile`]},tf:{extensions:[`.tf`,`.tfvars`],globs:[]}}),d=class{types;constructor(){this.types=new Map(Object.entries(u).map(([e,t])=>[e,{extensions:[...t.extensions],globs:[...t.globs]}]))}addType(e){let t=e.indexOf(`:`);if(t===-1)return;let n=e.slice(0,t),r=e.slice(t+1);if(r.startsWith(`include:`)){let e=r.slice(8),t=this.types.get(e);if(t){let e=this.types.get(n)||{extensions:[],globs:[]};e.extensions.push(...t.extensions),e.globs.push(...t.globs),this.types.set(n,e)}}else{let e=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith(`*.`)&&!r.slice(2).includes(`*`)){let t=r.slice(1);e.extensions.includes(t)||e.extensions.push(t)}else e.globs.includes(r)||e.globs.push(r);this.types.set(n,e)}}clearType(e){let t=this.types.get(e);t&&(t.extensions=[],t.globs=[])}getType(e){return this.types.get(e)}getAllTypes(){return this.types}matchesType(t,n){let r=t.toLowerCase();for(let i of n){if(i===`all`){if(this.matchesAnyType(t))return!0;continue}let n=this.types.get(i);if(n){for(let e of n.extensions)if(r.endsWith(e))return!0;for(let i of n.globs)if(i.includes(`*`)){if(e(`^${i.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`,`i`).test(t))return!0}else if(r===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let r of this.types.values()){for(let e of r.extensions)if(n.endsWith(e))return!0;for(let i of r.globs)if(i.includes(`*`)){if(e(`^${i.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`,`i`).test(t))return!0}else if(n===i.toLowerCase())return!0}return!1}};function f(){let e=[];for(let[t,n]of Object.entries(u).sort()){let r=[];for(let e of n.extensions)r.push(`*${e}`);for(let e of n.globs)r.push(e);e.push(`${t}: ${r.join(`, `)}`)}return`${e.join(`
|
|
2
2
|
`)}
|
|
3
3
|
`}function p(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:`--`,quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:`path`,json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function m(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||``).toUpperCase()){case`K`:return n*1024;case`M`:return n*1024*1024;case`G`:return n*1024*1024*1024;default:return n}}function h(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:``,stderr:`rg: invalid --max-filesize value: ${e}
|
|
4
4
|
`,exitCode:1}}function g(e){return null}var _=[{short:`g`,long:`glob`,target:`globs`,multi:!0},{long:`iglob`,target:`iglobs`,multi:!0},{short:`t`,long:`type`,target:`types`,multi:!0,validate:g},{short:`T`,long:`type-not`,target:`typesNot`,multi:!0,validate:g},{long:`type-add`,target:`typeAdd`,multi:!0},{long:`type-clear`,target:`typeClear`,multi:!0},{short:`m`,long:`max-count`,target:`maxCount`,parse:parseInt},{short:`e`,long:`regexp`,target:`patterns`,multi:!0},{short:`f`,long:`file`,target:`patternFiles`,multi:!0},{short:`r`,long:`replace`,target:`replace`},{short:`d`,long:`max-depth`,target:`maxDepth`,parse:parseInt},{long:`max-filesize`,target:`maxFilesize`,parse:m,validate:h},{long:`context-separator`,target:`contextSeparator`},{short:`j`,long:`threads`,target:`maxDepth`,parse:()=>1/0},{long:`ignore-file`,target:`ignoreFiles`,multi:!0},{long:`pre`,target:`preprocessor`},{long:`pre-glob`,target:`preprocessorGlobs`,multi:!0}],v=new Map([[`i`,e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],[`--ignore-case`,e=>{e.ignoreCase=!0,e.caseSensitive=!1,e.smartCase=!1}],[`s`,e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],[`--case-sensitive`,e=>{e.caseSensitive=!0,e.ignoreCase=!1,e.smartCase=!1}],[`S`,e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],[`--smart-case`,e=>{e.smartCase=!0,e.ignoreCase=!1,e.caseSensitive=!1}],[`F`,e=>{e.fixedStrings=!0}],[`--fixed-strings`,e=>{e.fixedStrings=!0}],[`w`,e=>{e.wordRegexp=!0}],[`--word-regexp`,e=>{e.wordRegexp=!0}],[`x`,e=>{e.lineRegexp=!0}],[`--line-regexp`,e=>{e.lineRegexp=!0}],[`v`,e=>{e.invertMatch=!0}],[`--invert-match`,e=>{e.invertMatch=!0}],[`U`,e=>{e.multiline=!0}],[`--multiline`,e=>{e.multiline=!0}],[`--multiline-dotall`,e=>{e.multilineDotall=!0,e.multiline=!0}],[`c`,e=>{e.count=!0}],[`--count`,e=>{e.count=!0}],[`--count-matches`,e=>{e.countMatches=!0}],[`l`,e=>{e.filesWithMatches=!0}],[`--files`,e=>{e.files=!0}],[`--files-with-matches`,e=>{e.filesWithMatches=!0}],[`--files-without-match`,e=>{e.filesWithoutMatch=!0}],[`--stats`,e=>{e.stats=!0}],[`o`,e=>{e.onlyMatching=!0}],[`--only-matching`,e=>{e.onlyMatching=!0}],[`q`,e=>{e.quiet=!0}],[`--quiet`,e=>{e.quiet=!0}],[`N`,e=>{e.lineNumber=!1}],[`--no-line-number`,e=>{e.lineNumber=!1}],[`H`,e=>{e.withFilename=!0}],[`--with-filename`,e=>{e.withFilename=!0}],[`I`,e=>{e.noFilename=!0}],[`--no-filename`,e=>{e.noFilename=!0}],[`0`,e=>{e.nullSeparator=!0}],[`--null`,e=>{e.nullSeparator=!0}],[`b`,e=>{e.byteOffset=!0}],[`--byte-offset`,e=>{e.byteOffset=!0}],[`--column`,e=>{e.column=!0,e.lineNumber=!0}],[`--no-column`,e=>{e.column=!1}],[`--vimgrep`,e=>{e.vimgrep=!0,e.column=!0,e.lineNumber=!0}],[`--json`,e=>{e.json=!0}],[`--hidden`,e=>{e.hidden=!0}],[`--no-ignore`,e=>{e.noIgnore=!0}],[`--no-ignore-dot`,e=>{e.noIgnoreDot=!0}],[`--no-ignore-vcs`,e=>{e.noIgnoreVcs=!0}],[`L`,e=>{e.followSymlinks=!0}],[`--follow`,e=>{e.followSymlinks=!0}],[`z`,e=>{e.searchZip=!0}],[`--search-zip`,e=>{e.searchZip=!0}],[`a`,e=>{e.searchBinary=!0}],[`--text`,e=>{e.searchBinary=!0}],[`--heading`,e=>{e.heading=!0}],[`--passthru`,e=>{e.passthru=!0}],[`--include-zero`,e=>{e.includeZero=!0}],[`--glob-case-insensitive`,e=>{e.globCaseInsensitive=!0}]]),y=new Set([`n`,`--line-number`]);function b(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function x(e,t,n){let r=e[t];for(let i of _){if(r.startsWith(`--${i.long}=`)){let e=C(n,i,r.slice(`--${i.long}=`.length));return e?{newIndex:t,error:e}:{newIndex:t}}if(i.short&&r.startsWith(`-${i.short}`)&&r.length>2){let e=C(n,i,r.slice(2));return e?{newIndex:t,error:e}:{newIndex:t}}if(i.short&&r===`-${i.short}`||r===`--${i.long}`){if(t+1>=e.length)return null;let r=e[t+1],a=C(n,i,r);return a?{newIndex:t+1,error:a}:{newIndex:t+1}}}return null}function S(e){return _.find(t=>t.short===e)}function C(e,t,n){if(t.validate){let e=t.validate(n);if(e)return e}let r=t.parse?t.parse(n):n;t.multi?e[t.target].push(r):e[t.target]=r}function w(e,t){let n=e[t];if(n===`--sort`&&t+1<e.length){let n=e[t+1];if(n===`path`||n===`none`)return{value:n,newIndex:t+1}}if(n.startsWith(`--sort=`)){let e=n.slice(7);if(e===`path`||e===`none`)return{value:e,newIndex:t}}return null}function T(e,t){let n=e[t],r=n.match(/^-([ABC])(\d+)$/);return r?{flag:r[1],value:parseInt(r[2],10),newIndex:t}:(n===`-A`||n===`-B`||n===`-C`)&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function E(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function D(e){let t=p(),r=null,i=[],a=-1,o=-1,s=-1,c=!1;for(let l=0;l<e.length;l++){let u=e[l];if(u.startsWith(`-`)&&u!==`-`){let r=T(e,l);if(r){let{flag:e,value:t,newIndex:n}=r;e===`A`?a=Math.max(a,t):e===`B`?o=Math.max(o,t):s=t,l=n;continue}let i=E(u);if(i!==null){t.maxCount=i;continue}let d=x(e,l,t);if(d){if(d.error)return{success:!1,error:d.error};l=d.newIndex;continue}let f=w(e,l);if(f){t.sort=f.value,l=f.newIndex;continue}let p=u.startsWith(`--`)?[u]:u.slice(1).split(``);for(let r of p){if(y.has(r)){t.lineNumber=!0,c=!0;continue}if(r===`u`||r===`--unrestricted`){b(t);continue}if(r===`P`||r===`--pcre2`)return{success:!1,error:{stdout:``,stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
@@ -30,4 +30,4 @@ EXAMPLES:
|
|
|
30
30
|
rg -g '*.ts' foo Search files matching glob
|
|
31
31
|
rg --hidden foo Include hidden files
|
|
32
32
|
rg -l foo List files with matches only`,options:[`-e, --regexp PATTERN search for PATTERN (can be used multiple times)`,`-f, --file FILE read patterns from FILE, one per line`,`-i, --ignore-case case-insensitive search`,`-s, --case-sensitive case-sensitive search (overrides smart-case)`,`-S, --smart-case smart case (default: case-insensitive unless pattern has uppercase)`,`-F, --fixed-strings treat pattern as literal string`,`-w, --word-regexp match whole words only`,`-x, --line-regexp match whole lines only`,`-v, --invert-match select non-matching lines`,`-r, --replace TEXT replace matches with TEXT`,`-c, --count print count of matching lines per file`,` --count-matches print count of individual matches per file`,`-l, --files-with-matches print only file names with matches`,` --files-without-match print file names without matches`,` --files list files that would be searched`,`-o, --only-matching print only matching parts`,`-m, --max-count NUM stop after NUM matches per file`,`-q, --quiet suppress output, exit 0 on match`,` --stats print search statistics`,`-n, --line-number print line numbers (default: on)`,`-N, --no-line-number do not print line numbers`,`-I, --no-filename suppress the prefixing of file names`,`-0, --null use NUL as filename separator`,`-b, --byte-offset show byte offset of each match`,` --column show column number of first match`,` --vimgrep show results in vimgrep format`,` --json show results in JSON Lines format`,`-A NUM print NUM lines after each match`,`-B NUM print NUM lines before each match`,`-C NUM print NUM lines before and after each match`,` --context-separator SEP separator for context groups (default: --)`,`-U, --multiline match patterns across lines`,`-z, --search-zip search in compressed files (gzip only)`,`-g, --glob GLOB include files matching GLOB`,`-t, --type TYPE only search files of TYPE (e.g., js, py, ts)`,`-T, --type-not TYPE exclude files of TYPE`,`-L, --follow follow symbolic links`,`-u, --unrestricted reduce filtering (-u: no ignore, -uu: +hidden, -uuu: +binary)`,`-a, --text search binary files as text`,` --hidden search hidden files and directories`,` --no-ignore don't respect .gitignore/.ignore files`,`-d, --max-depth NUM maximum search depth`,` --sort TYPE sort files (path, none)`,` --heading show file path above matches`,` --passthru print all lines (non-matches use - separator)`,` --include-zero include files with 0 matches in count output`,` --type-list list all available file types`,` --help display this help and exit`]},G={name:`rg`,async execute(e,t){if(i(e))return r(W);if(e.includes(`--type-list`))return{stdout:f(),stderr:``,exitCode:0};let n=D(e);return n.success?N({ctx:t,options:n.options,paths:n.paths,explicitLineNumbers:n.explicitLineNumbers}):n.error}},K={name:`rg`,flags:[{flag:`-i`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-S`,type:`boolean`},{flag:`-F`,type:`boolean`},{flag:`-w`,type:`boolean`},{flag:`-x`,type:`boolean`},{flag:`-v`,type:`boolean`},{flag:`-c`,type:`boolean`},{flag:`-l`,type:`boolean`},{flag:`-o`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-N`,type:`boolean`},{flag:`--hidden`,type:`boolean`},{flag:`--no-ignore`,type:`boolean`},{flag:`-m`,type:`value`,valueHint:`number`},{flag:`-A`,type:`value`,valueHint:`number`},{flag:`-B`,type:`value`,valueHint:`number`},{flag:`-C`,type:`value`,valueHint:`number`},{flag:`-g`,type:`value`,valueHint:`pattern`},{flag:`-t`,type:`value`,valueHint:`string`},{flag:`-T`,type:`value`,valueHint:`string`}],needsArgs:!0};export{K as n,G as t};
|
|
33
|
-
//# sourceMappingURL=chunk-NYQYO467-
|
|
33
|
+
//# sourceMappingURL=chunk-NYQYO467-BgXuDHUQ.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./chunk-YNYSPYQ5-
|
|
1
|
+
import{n as e,t}from"./chunk-YNYSPYQ5-DesxOVHh.mjs";import{i as n}from"./chunk-GFQRA5P5-DnjwTqP3.mjs";import{n as r}from"./chunk-5QMZ5MUS-CAp625aG.mjs";import{r as i}from"./chunk-OJDRYQWQ-ikvLWpfV.mjs";import{r as a,t as o}from"./chunk-24IMIIXA-B6yIPkk2.mjs";import{n as s,r as c,t as l}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var u=1e4,d=100,f=new e(/\s+/);function p(e={}){let{fieldSep:t=f,maxIterations:n=u,maxRecursionDepth:r=d,maxOutputSize:i=0,fs:a,cwd:o,exec:s,coverage:c,requireDefenseContext:l}=e;return{FS:` `,OFS:` `,ORS:`
|
|
2
2
|
`,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,fieldSep:t,maxIterations:n,maxRecursionDepth:r,maxOutputSize:i,currentRecursionDepth:0,exitCode:0,shouldExit:!1,shouldNext:!1,shouldNextFile:!1,loopBreak:!1,loopContinue:!1,hasReturn:!1,inEndBlock:!1,output:``,openedFiles:new Set,fs:a,cwd:o,exec:s,coverage:c,requireDefenseContext:l}}function m(e,t,n){switch(n){case`+`:return e+t;case`-`:return e-t;case`*`:return e*t;case`/`:return t===0?0:e/t;case`%`:return t===0?0:e%t;case`^`:case`**`:return e**t;default:return 0}}function h(e){if(typeof e==`number`)return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function g(e){return typeof e==`string`?e:String(e)}async function _(e,t){if(e.type===`regex`)return e.pattern;let n=g(await t.evalExpr(e));return n.startsWith(`/`)&&n.endsWith(`/`)&&(n=n.slice(1,-1)),n}async function v(e,t){return e?e.type===`variable`?e.name:e.type===`field`?`$${Math.floor(h(await t.evalExpr(e.index)))}`:`$0`:`$0`}function y(e,t){if(e===`$0`)return t.line;if(e.startsWith(`$`)){let n=parseInt(e.slice(1),10)-1;return t.fields[n]||``}return g(t.vars[e]??``)}function b(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 ee(e,t,n){return e.length===0?t.line.length:g(await n.evalExpr(e[0])).length}async function x(e,t,n){if(e.length<2)return``;let r=g(await n.evalExpr(e[0])),i=Math.floor(h(await n.evalExpr(e[1])))-1;if(e.length>=3){let t=Math.floor(h(await n.evalExpr(e[2])));return r.substr(Math.max(0,i),t)}return r.substr(Math.max(0,i))}async function S(e,t,n){if(e.length<2)return 0;let r=g(await n.evalExpr(e[0])),i=g(await n.evalExpr(e[1])),a=r.indexOf(i);return a===-1?0:a+1}async function C(e,n,r){if(e.length<2)return 0;let i=g(await r.evalExpr(e[0])),a=e[1];if(a.type!==`variable`)return 0;let o=a.name,s=n.FS;if(e.length>=3){let n=e[2];if(n.type===`regex`)s=t(n.pattern);else{let e=g(await r.evalExpr(n));s=e===` `?t(`\\s+`):e}}else n.FS===` `&&(s=t(`\\s+`));let c=typeof s==`string`?i.split(s):s.split(i);n.arrays[o]=Object.create(null);for(let e=0;e<c.length;e++)n.arrays[o][String(e+1)]=c[e];return c.length}async function te(e,n,r){if(e.length<2)return 0;let i=await _(e[0],r),a=g(await r.evalExpr(e[1])),o=await v(e[2],r),s=y(o,n);try{let e=t(i).replace(s,re(a)),r=e===s?0:1;return b(o,e,n),r}catch{return 0}}async function ne(e,n,r){if(e.length<2)return 0;let i=await _(e[0],r),a=g(await r.evalExpr(e[1])),o=await v(e[2],r),s=y(o,n);try{let e=t(i,`g`),r=e.match(s),c=r?r.length:0;return b(o,e.replace(s,re(a)),n),c}catch{return 0}}function re(e){return t=>{let n=``,r=0;for(;r<e.length;)if(e[r]===`\\`&&r+1<e.length){let t=e[r+1];t===`&`?(n+=`&`,r+=2):t===`\\`?(n+=`\\`,r+=2):(n+=e[r+1],r+=2)}else e[r]===`&`?(n+=t,r++):(n+=e[r],r++);return n}}async function ie(e,n,r){if(e.length<2)return n.RSTART=0,n.RLENGTH=-1,0;let i=g(await r.evalExpr(e[0])),a=await _(e[1],r);try{let e=t(a).exec(i);if(e)return n.RSTART=e.index+1,n.RLENGTH=e[0].length,n.RSTART}catch{}return n.RSTART=0,n.RLENGTH=-1,0}async function ae(e,n,r){if(e.length<3)return``;let i=await _(e[0],r),a=g(await r.evalExpr(e[1])),o=g(await r.evalExpr(e[2])),s=e.length>=4?g(await r.evalExpr(e[3])):n.line;try{let e=o.toLowerCase()===`g`,n=e?0:parseInt(o,10)||1;if(e)return t(i,`g`).replace(s,(e,...t)=>oe(a,e,t.slice(0,-2)));{let e=0;return t(i,`g`).replace(s,(t,...r)=>(e++,e===n?oe(a,t,r.slice(0,-2)):t))}}catch{return s}}function oe(e,t,n){let r=``,i=0;for(;i<e.length;)if(e[i]===`\\`&&i+1<e.length){let a=e[i+1];if(a===`&`)r+=`&`,i+=2;else if(a===`0`)r+=t,i+=2;else if(a>=`1`&&a<=`9`){let e=parseInt(a,10)-1;r+=n[e]||``,i+=2}else a===`n`?(r+=`
|
|
3
3
|
`,i+=2):a===`t`?(r+=` `,i+=2):(r+=a,i+=2)}else e[i]===`&`?(r+=t,i++):(r+=e[i],i++);return r}async function se(e,t,n){return e.length===0?``:g(await n.evalExpr(e[0])).toLowerCase()}async function ce(e,t,n){return e.length===0?``:g(await n.evalExpr(e[0])).toUpperCase()}async function le(e,t,n){if(e.length===0)return``;let r=g(await n.evalExpr(e[0])),i=[];for(let t=1;t<e.length;t++)i.push(await n.evalExpr(e[t]));return E(r,i)}async function ue(e,t,n){return e.length===0?0:Math.floor(h(await n.evalExpr(e[0])))}async function de(e,t,n){return e.length===0?0:Math.sqrt(h(await n.evalExpr(e[0])))}async function fe(e,t,n){return e.length===0?0:Math.sin(h(await n.evalExpr(e[0])))}async function pe(e,t,n){return e.length===0?0:Math.cos(h(await n.evalExpr(e[0])))}async function me(e,t,n){let r=e.length>0?h(await n.evalExpr(e[0])):0,i=e.length>1?h(await n.evalExpr(e[1])):0;return Math.atan2(r,i)}async function he(e,t,n){return e.length===0?0:Math.log(h(await n.evalExpr(e[0])))}async function ge(e,t,n){return e.length===0?1:Math.exp(h(await n.evalExpr(e[0])))}function _e(e,t,n){return t.random?t.random():Math.random()}async function ve(e,t,n){let r=e.length>0?h(await n.evalExpr(e[0])):Date.now();return t.vars._srand_seed=r,r}function ye(e,t){return()=>{throw Error(`${e}() is not supported - ${t}`)}}function w(e){return()=>{throw Error(`function '${e}()' is not implemented`)}}var T=1e4;function E(e,t){let n=0,r=``,i=0;for(;i<e.length;)if(e[i]===`%`&&i+1<e.length){let a=i+1,o=``,s=``,c=``,l,u=a;for(;a<e.length&&/\d/.test(e[a]);)a++;a>u&&e[a]===`$`?(l=parseInt(e.substring(u,a),10)-1,a++):a=u;let d=()=>{if(a<e.length){if(a+1<e.length&&(e[a]===`h`&&e[a+1]===`h`||e[a]===`l`&&e[a+1]===`l`)){a+=2;return}/[lzjh]/.test(e[a])&&a++}};for(;a<e.length&&/[-+ #0]/.test(e[a]);)o+=e[a++];if(e[a]===`*`){let e=t[n++],r=e===void 0?0:Math.floor(Number(e));r<0?(o+=`-`,s=String(Math.min(-r,T))):s=String(Math.min(r,T)),a++}else for(;a<e.length&&/\d/.test(e[a]);)s+=e[a++];if(s&&parseInt(s,10)>T&&(s=String(T)),e[a]===`.`){if(a++,e[a]===`*`){let e=t[n++];c=String(Math.min(e===void 0?0:Math.floor(Number(e)),T)),a++}else for(;a<e.length&&/\d/.test(e[a]);)c+=e[a++];c&&parseInt(c,10)>T&&(c=String(T))}d();let f=e[a],p=t[l===void 0?n:l];switch(f){case`s`:{let e=p===void 0?``:String(p);if(c&&(e=e.substring(0,parseInt(c,10))),s){let t=parseInt(s,10);e=o.includes(`-`)?e.padEnd(t):e.padStart(t)}r+=e,l===void 0&&n++;break}case`d`:case`i`:{let e=p===void 0?0:Math.floor(Number(p));Number.isNaN(e)&&(e=0);let t=e<0,i=Math.abs(e).toString();if(c){let e=parseInt(c,10);i=i.padStart(e,`0`)}let a=``;t?a=`-`:o.includes(`+`)?a=`+`:o.includes(` `)&&(a=` `);let u=a+i;if(s){let e=parseInt(s,10);u=o.includes(`-`)?u.padEnd(e):o.includes(`0`)&&!c?a+i.padStart(e-a.length,`0`):u.padStart(e)}r+=u,l===void 0&&n++;break}case`f`:{let e=p===void 0?0:Number(p);Number.isNaN(e)&&(e=0);let t=c?parseInt(c,10):6,i=e.toFixed(t);if(s){let e=parseInt(s,10);i=o.includes(`-`)?i.padEnd(e):i.padStart(e)}r+=i,l===void 0&&n++;break}case`e`:case`E`:{let e=p===void 0?0:Number(p);Number.isNaN(e)&&(e=0);let t=c?parseInt(c,10):6,i=e.toExponential(t);if(f===`E`&&(i=i.toUpperCase()),s){let e=parseInt(s,10);i=o.includes(`-`)?i.padEnd(e):i.padStart(e)}r+=i,l===void 0&&n++;break}case`g`:case`G`:{let e=p===void 0?0:Number(p);Number.isNaN(e)&&(e=0);let t=c?parseInt(c,10):6,i=e===0?0:Math.floor(Math.log10(Math.abs(e))),a;if(e===0?a=`0`:i<-4||i>=t?(a=e.toExponential(t-1),f===`G`&&(a=a.toUpperCase())):a=e.toPrecision(t),a.includes(`.`)&&(a=a.replace(/\.?0+$/,``).replace(/\.?0+e/,`e`)),a.includes(`e`)&&(a=a.replace(/\.?0+e/,`e`)),s){let e=parseInt(s,10);a=o.includes(`-`)?a.padEnd(e):a.padStart(e)}r+=a,l===void 0&&n++;break}case`x`:case`X`:{let e=p===void 0?0:Math.floor(Number(p));Number.isNaN(e)&&(e=0);let t=Math.abs(e).toString(16);if(f===`X`&&(t=t.toUpperCase()),c){let e=parseInt(c,10);t=t.padStart(e,`0`)}let i=e<0?`-`:``,a=i+t;if(s){let e=parseInt(s,10);a=o.includes(`-`)?a.padEnd(e):o.includes(`0`)&&!c?i+t.padStart(e-i.length,`0`):a.padStart(e)}r+=a,l===void 0&&n++;break}case`o`:{let e=p===void 0?0:Math.floor(Number(p));Number.isNaN(e)&&(e=0);let t=Math.abs(e).toString(8);if(c){let e=parseInt(c,10);t=t.padStart(e,`0`)}let i=e<0?`-`:``,a=i+t;if(s){let e=parseInt(s,10);a=o.includes(`-`)?a.padEnd(e):o.includes(`0`)&&!c?i+t.padStart(e-i.length,`0`):a.padStart(e)}r+=a,l===void 0&&n++;break}case`c`:typeof p==`number`?r+=String.fromCharCode(p):r+=String(p??``).charAt(0)||``,l===void 0&&n++;break;case`%`:r+=`%`;break;default:r+=e.substring(i,a+1)}i=a+1}else if(e[i]===`\\`&&i+1<e.length){let t=e[i+1];switch(t){case`n`:r+=`
|
|
4
4
|
`;break;case`t`:r+=` `;break;case`r`:r+=`\r`;break;case`\\`:r+=`\\`;break;default:r+=t}i+=2}else r+=e[i++];return r}var be=new Map([[`length`,ee],[`substr`,x],[`index`,S],[`split`,C],[`sub`,te],[`gsub`,ne],[`match`,ie],[`gensub`,ae],[`tolower`,se],[`toupper`,ce],[`sprintf`,le],[`int`,ue],[`sqrt`,de],[`sin`,fe],[`cos`,pe],[`atan2`,me],[`log`,he],[`exp`,ge],[`rand`,_e],[`srand`,ve],[`system`,ye(`system`,`shell execution not allowed in sandboxed environment`)],[`close`,()=>0],[`fflush`,()=>0],[`systime`,w(`systime`)],[`mktime`,w(`mktime`)],[`strftime`,w(`strftime`)]]);function D(e){return typeof e==`number`?e!==0:!(e===``||e===`0`)}function O(e){if(typeof e==`number`)return e;let t=parseFloat(e);return Number.isNaN(t)?0:t}function k(e){return typeof e==`string`?e:String(e)}function xe(e){if(typeof e==`number`)return!0;let t=String(e).trim();return t===``?!1:!Number.isNaN(Number(t))}function A(e,n){try{return t(e).test(n)}catch{return!1}}function j(e,t){return t===``?[]:e.FS===` `?t.trim().split(/\s+/).filter(Boolean):e.fieldSep.split(t)}function M(e,t){return t===0?e.line:t<0||t>e.fields.length?``:e.fields[t-1]??``}function N(e,t,n){if(t===0)e.line=k(n),e.fields=j(e,e.line),e.NF=e.fields.length;else if(t>0){for(;e.fields.length<t;)e.fields.push(``);e.fields[t-1]=k(n),e.NF=e.fields.length,e.line=e.fields.join(e.OFS)}}function P(e,t){e.line=t,e.fields=j(e,t),e.NF=e.fields.length}function Se(n,r){if(n.FS=r,r===` `)n.fieldSep=new e(/\s+/);else try{n.fieldSep=t(r)}catch{n.fieldSep=t(r.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`))}}function F(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 I(e,t,n){switch(t){case`FS`:Se(e,k(n));return;case`OFS`:e.OFS=k(n);return;case`ORS`:e.ORS=k(n);return;case`OFMT`:e.OFMT=k(n);return;case`NR`:e.NR=Math.floor(O(n));return;case`NF`:{let t=Math.floor(O(n));if(t<e.NF)e.fields=e.fields.slice(0,t),e.line=e.fields.join(e.OFS);else if(t>e.NF){for(;e.fields.length<t;)e.fields.push(``);e.line=e.fields.join(e.OFS)}e.NF=t;return}case`FNR`:e.FNR=Math.floor(O(n));return;case`FILENAME`:e.FILENAME=k(n);return;case`RSTART`:e.RSTART=Math.floor(O(n));return;case`RLENGTH`:e.RLENGTH=Math.floor(O(n));return;case`SUBSEP`:e.SUBSEP=k(n);return}e.vars[t]=n}function L(e,t){let n=t,r=new Set,i=e.arrayAliases.get(n);for(;i!==void 0&&!r.has(n);)r.add(n),n=i,i=e.arrayAliases.get(n);return n}function R(e,t,n){if(t===`ARGV`)return e.ARGV[n]??``;if(t===`ENVIRON`)return e.ENVIRON[n]??``;let r=L(e,t);return e.arrays[r]?.[n]??``}function Ce(e,t,n,r){let i=L(e,t);e.arrays[i]||(e.arrays[i]=Object.create(null)),e.arrays[i][n]=r}function we(e,t,n){if(t===`ARGV`)return e.ARGV[n]!==void 0;if(t===`ENVIRON`)return e.ENVIRON[n]!==void 0;let r=L(e,t);return e.arrays[r]?.[n]!==void 0}function Te(e,t,n){let r=L(e,t);e.arrays[r]&&delete e.arrays[r][n]}function Ee(e,t){let n=L(e,t);delete e.arrays[n]}var De=null;function Oe(e){De=e}function z(e,t){o(e.requireDefenseContext,`awk`,t)}function B(e,t,n){return a(e.requireDefenseContext,`awk`,t,n)}async function V(e,t){switch(z(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 A(t.pattern,e.line)?1:0;case`field`:return ke(e,t);case`variable`:return F(e,t.name);case`array_access`:return Ae(e,t);case`binary`:return je(e,t);case`unary`:return Pe(e,t);case`ternary`:return D(await B(e,`ternary condition evaluation`,()=>V(e,t.condition)))?await B(e,`ternary consequent evaluation`,()=>V(e,t.consequent)):await B(e,`ternary alternate evaluation`,()=>V(e,t.alternate));case`call`:return Fe(e,t.name,t.args);case`assignment`:return Le(e,t);case`pre_increment`:return Re(e,t.operand);case`pre_decrement`:return ze(e,t.operand);case`post_increment`:return Be(e,t.operand);case`post_decrement`:return Ve(e,t.operand);case`in`:return He(e,t.key,t.array);case`getline`:return Ue(e,t.variable,t.file,t.command);case`tuple`:return Ke(e,t.elements);default:return``}}async function ke(e,t){return z(e,`field reference evaluation`),M(e,Math.floor(O(await B(e,`field index evaluation`,()=>V(e,t.index)))))}async function Ae(e,t){z(e,`array access evaluation`);let n=k(await B(e,`array key evaluation`,()=>V(e,t.key)));return R(e,t.array,n)}async function je(e,r){z(e,`binary expression evaluation`);let i=r.operator;if(i===`||`)return D(await B(e,`logical-or left evaluation`,()=>V(e,r.left)))||D(await B(e,`logical-or right evaluation`,()=>V(e,r.right)))?1:0;if(i===`&&`)return D(await B(e,`logical-and left evaluation`,()=>V(e,r.left)))&&D(await B(e,`logical-and right evaluation`,()=>V(e,r.right)))?1:0;if(i===`~`){let n=await B(e,`regex left evaluation`,()=>V(e,r.left));r.right.type===`regex`&&e.coverage?.hit(`awk:expr:regex`);let i=r.right.type===`regex`?r.right.pattern:k(await B(e,`regex right evaluation`,()=>V(e,r.right)));try{return t(i).test(k(n))?1:0}catch{return 0}}if(i===`!~`){let n=await B(e,`negated-regex left evaluation`,()=>V(e,r.left));r.right.type===`regex`&&e.coverage?.hit(`awk:expr:regex`);let i=r.right.type===`regex`?r.right.pattern:k(await B(e,`negated-regex right evaluation`,()=>V(e,r.right)));try{return t(i).test(k(n))?0:1}catch{return 1}}let a=await B(e,`binary left evaluation`,()=>V(e,r.left)),o=await B(e,`binary right evaluation`,()=>V(e,r.right));if(i===` `){let t=k(a)+k(o);if(e.maxOutputSize>0&&t.length>e.maxOutputSize)throw new n(`awk: string concatenation size limit exceeded (${e.maxOutputSize} bytes)`,`string_length`,e.output);return t}return Me(i)?Ne(a,o,i):m(O(a),O(o),i)}function Me(e){return[`<`,`<=`,`>`,`>=`,`==`,`!=`].includes(e)}function Ne(e,t,n){let r=xe(e),i=xe(t);if(r&&i){let r=O(e),i=O(t);switch(n){case`<`:return r<i?1:0;case`<=`:return r<=i?1:0;case`>`:return r>i?1:0;case`>=`:return r>=i?1:0;case`==`:return r===i?1:0;case`!=`:return r===i?0:1}}let a=k(e),o=k(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?0:1}return 0}async function Pe(e,t){z(e,`unary expression evaluation`);let n=await B(e,`unary operand evaluation`,()=>V(e,t.operand));switch(t.operator){case`!`:return D(n)?0:1;case`-`:return-O(n);case`+`:return+O(n);default:return n}}async function Fe(e,t,n){z(e,`function call evaluation`);let r=be.get(t);if(r)return r(n,e,{evalExpr:t=>V(e,t)});let i=e.functions.get(t);return i?Ie(e,i,n):``}async function Ie(e,t,r){if(z(e,`user function call`),e.currentRecursionDepth++,e.currentRecursionDepth>e.maxRecursionDepth)throw e.currentRecursionDepth--,new n(`awk: recursion depth exceeded maximum (${e.maxRecursionDepth})`,`recursion`,e.output);let i=Object.create(null);for(let n of t.params)i[n]=e.vars[n];let a=[];for(let n=0;n<t.params.length;n++){let i=t.params[n];if(n<r.length){let t=r[n];t.type===`variable`&&(e.arrayAliases.set(i,t.name),a.push(i));let o=await B(e,`user function argument evaluation`,()=>V(e,t));e.vars[i]=o}else e.vars[i]=``}e.hasReturn=!1,e.returnValue=void 0;let o=De;o&&await B(e,`user function body execution`,()=>o(e,t.body.statements));let s=e.returnValue??``;for(let n of t.params)i[n]===void 0?delete e.vars[n]:e.vars[n]=i[n];for(let t of a)e.arrayAliases.delete(t);return e.hasReturn=!1,e.returnValue=void 0,e.currentRecursionDepth--,s}async function Le(e,t){z(e,`assignment evaluation`);let n=await B(e,`assignment value evaluation`,()=>V(e,t.value)),r=t.target,i=t.operator,a;if(i===`=`)a=n;else{let t;if(r.type===`field`)t=M(e,Math.floor(O(await B(e,`assignment field index`,()=>V(e,r.index)))));else if(r.type===`variable`)t=F(e,r.name);else{let n=k(await B(e,`assignment array key`,()=>V(e,r.key)));t=R(e,r.array,n)}let o=O(t),s=O(n);switch(i){case`+=`:a=o+s;break;case`-=`:a=o-s;break;case`*=`:a=o*s;break;case`/=`:a=s===0?0:o/s;break;case`%=`:a=s===0?0:o%s;break;case`^=`:a=o**s;break;default:a=n}}if(r.type===`field`)N(e,Math.floor(O(await B(e,`assignment target field index`,()=>V(e,r.index)))),a);else if(r.type===`variable`)I(e,r.name,a);else{let t=k(await B(e,`assignment target array key`,()=>V(e,r.key)));Ce(e,r.array,t,a)}return a}async function H(e,t,n,r){z(e,`inc/dec evaluation`);let i;if(t.type===`field`){let r=Math.floor(O(await B(e,`inc/dec field index`,()=>V(e,t.index))));i=O(M(e,r)),N(e,r,i+n)}else if(t.type===`variable`)i=O(F(e,t.name)),I(e,t.name,i+n);else{let r=k(await B(e,`inc/dec array key`,()=>V(e,t.key)));i=O(R(e,t.array,r)),Ce(e,t.array,r,i+n)}return r?i+n:i}async function Re(e,t){return H(e,t,1,!0)}async function ze(e,t){return H(e,t,-1,!0)}async function Be(e,t){return H(e,t,1,!1)}async function Ve(e,t){return H(e,t,-1,!1)}async function He(e,t,n){z(e,`in-expression evaluation`);let r;if(t.type===`tuple`){e.coverage?.hit(`awk:expr:tuple`);let n=[];for(let r of t.elements)n.push(k(await B(e,`tuple key element evaluation`,()=>V(e,r))));r=n.join(e.SUBSEP)}else r=k(await B(e,`in-expression key evaluation`,()=>V(e,t)));return we(e,n,r)?1:0}async function Ue(e,t,n,r){if(z(e,`getline evaluation`),r)return We(e,t,r);if(n)return Ge(e,t,n);if(!e.lines||e.lineIndex===void 0)return-1;let i=e.lineIndex+1;if(i>=e.lines.length)return 0;let a=e.lines[i];return t?I(e,t,a):P(e,a),e.NR++,e.lineIndex=i,1}async function We(e,t,n){let i=e.exec;if(!i)return-1;z(e,`getline command source`);let a=k(await B(e,`getline command expression`,()=>V(e,n))),o=`__cmd_${a}`,s=`__cmdi_${a}`,c,l;if(e.vars[o]===void 0)try{c=(await B(e,`getline command exec`,()=>i(a))).stdout.split(`
|
|
@@ -18,4 +18,4 @@ import{n as e,t}from"./chunk-YNYSPYQ5-Dq-BWW-f.mjs";import{i as n}from"./chunk-G
|
|
|
18
18
|
`);t.length>0&&t[t.length-1]===``&&t.pop(),e.push({filename:``,lines:t})}for(let t of e){for(S.FILENAME=t.filename,S.FNR=0,S.lines=t.lines,S.lineIndex=-1,S.shouldNextFile=!1;S.lineIndex<t.lines.length-1;){S.lineIndex++;let e=S.lineIndex;if(await d(`line execution`,()=>C.executeLine(t.lines[e])),S.shouldExit||S.shouldNextFile)break}if(S.shouldExit)break}return await d(`END execution`,()=>C.executeEnd()),{stdout:C.getOutput(),stderr:``,exitCode:C.getExitCode()}}catch(e){if(e instanceof r)throw e;let t=e instanceof Error?e.message:String(e),i=e instanceof n?n.EXIT_CODE:2;return{stdout:C.getOutput(),stderr:`awk: ${t}
|
|
19
19
|
`,exitCode:i}}}};function $(e){return e.replace(/\\t/g,` `).replace(/\\n/g,`
|
|
20
20
|
`).replace(/\\r/g,`\r`).replace(/\\b/g,`\b`).replace(/\\f/g,`\f`).replace(/\\a/g,`\x07`).replace(/\\v/g,`\v`).replace(/\\\\/g,`\\`)}function bt(e){if(e===` `)return t(`\\s+`);if(/[[\](){}.*+?^$|\\]/.test(e))try{return t(e)}catch{return t(xt(e))}return t(xt(e))}function xt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}var St={name:`awk`,flags:[{flag:`-F`,type:`value`,valueHint:`delimiter`},{flag:`-v`,type:`value`,valueHint:`string`}],stdinType:`text`,needsArgs:!0};export{yt as n,St as t};
|
|
21
|
-
//# sourceMappingURL=chunk-OARHFVLG-
|
|
21
|
+
//# sourceMappingURL=chunk-OARHFVLG-Cr0x3Si_.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{t as e}from"./chunk-44UOCSGV-
|
|
1
|
+
import{t as e}from"./chunk-44UOCSGV-CaFxJDHm.mjs";import{n as t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";function n(e){let t=e.replace(/\//g,`-`),n=new Date(t);if(!Number.isNaN(n.getTime()))return n;let r=t.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(r){let[,e,t,i]=r;if(n=new Date(Number.parseInt(e,10),Number.parseInt(t,10)-1,Number.parseInt(i,10)),!Number.isNaN(n.getTime()))return n}let i=t.match(/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})$/);if(i){let[,e,t,r,a,o,s]=i;if(n=new Date(Number.parseInt(e,10),Number.parseInt(t,10)-1,Number.parseInt(r,10),Number.parseInt(a,10),Number.parseInt(o,10),Number.parseInt(s,10)),!Number.isNaN(n.getTime()))return n}return null}var r={name:`touch`,async execute(r,i){let a=[],o=null,s=!1;for(let e=0;e<r.length;e++){let n=r[e];if(n===`--`){a.push(...r.slice(e+1));break}else if(n===`-d`||n===`--date`){if(e+1>=r.length)return{stdout:``,stderr:`touch: option requires an argument -- 'd'
|
|
2
2
|
`,exitCode:1};o=r[++e]}else if(n.startsWith(`--date=`))o=n.slice(7);else if(n===`-c`||n===`--no-create`)s=!0;else if(n===`-a`||n===`-m`||n===`-r`||n===`-t`)(n===`-r`||n===`-t`)&&e++;else{if(n.startsWith(`--`))return t(`touch`,n);if(n.startsWith(`-`)&&n.length>1){let i=!1;for(let a of n.slice(1))if(a===`c`)s=!0;else if(!(a===`a`||a===`m`))if(a===`d`){if(e+1>=r.length)return{stdout:``,stderr:`touch: option requires an argument -- 'd'
|
|
3
3
|
`,exitCode:1};o=r[++e],i=!0;break}else if(a===`r`||a===`t`){e++,i=!0;break}else return t(`touch`,`-${a}`);if(i)continue}else a.push(n)}}if(a.length===0)return{stdout:``,stderr:`touch: missing file operand
|
|
4
4
|
`,exitCode:1};let c=null;if(o!==null&&(c=n(o),c===null))return{stdout:``,stderr:`touch: invalid date format '${o}'
|
|
5
5
|
`,exitCode:1};let l=``,u=0;for(let t of a)try{let e=i.fs.resolvePath(i.cwd,t);if(!await i.fs.exists(e)){if(s)continue;await i.fs.writeFile(e,``)}let n=c??new Date;await i.fs.utimes(e,n,n)}catch(n){l+=`touch: cannot touch '${t}': ${e(n)}
|
|
6
6
|
`,u=1}return{stdout:``,stderr:l,exitCode:u}}},i={name:`touch`,flags:[{flag:`-c`,type:`boolean`},{flag:`-a`,type:`boolean`},{flag:`-m`,type:`boolean`},{flag:`-d`,type:`value`,valueHint:`string`}],needsArgs:!0};export{i as n,r as t};
|
|
7
|
-
//# sourceMappingURL=chunk-OCLXQMOG-
|
|
7
|
+
//# sourceMappingURL=chunk-OCLXQMOG-BW6rwyzS.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-44UOCSGV-
|
|
1
|
+
import{t as e}from"./chunk-44UOCSGV-CaFxJDHm.mjs";import{t}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var n=`Usage: rmdir [-pv] DIRECTORY...
|
|
2
2
|
Remove empty directories.
|
|
3
3
|
|
|
4
4
|
Options:
|
|
@@ -11,4 +11,4 @@ Options:
|
|
|
11
11
|
`,exitCode:1};await t.fs.rm(n,{recursive:!1,force:!1});let e=``;return i&&(e=`rmdir: removing directory, '${r}'
|
|
12
12
|
`),{stdout:e,stderr:``,exitCode:0}}catch(t){return{stdout:``,stderr:`rmdir: failed to remove '${r}': ${e(t)}
|
|
13
13
|
`,exitCode:1}}}function s(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n===-1?`.`:n===0?`/`:t.substring(0,n)}var c={name:`rmdir`,flags:[{flag:`-p`,type:`boolean`},{flag:`-v`,type:`boolean`}],needsArgs:!0};export{i as n,c as t};
|
|
14
|
-
//# sourceMappingURL=chunk-OCS6LSEM-
|
|
14
|
+
//# sourceMappingURL=chunk-OCS6LSEM-D7VAOziZ.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
function e(e){return Object.assign(Object.create(null),Object.fromEntries(e))}function t(e,t){return Object.assign(Object.create(null),Object.fromEntries(e),t)}function n(...e){return Object.assign(Object.create(null),...e)}export{t as n,e as r,n as t};
|
|
2
|
-
//# sourceMappingURL=chunk-OJDRYQWQ-
|
|
2
|
+
//# sourceMappingURL=chunk-OJDRYQWQ-ikvLWpfV.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-YNYSPYQ5-
|
|
1
|
+
import{t as e}from"./chunk-YNYSPYQ5-DesxOVHh.mjs";import{i as t}from"./chunk-GFQRA5P5-DnjwTqP3.mjs";import{n}from"./chunk-5QMZ5MUS-CAp625aG.mjs";import{r,t as i}from"./chunk-24IMIIXA-B6yIPkk2.mjs";import{n as a}from"./chunk-3THT3N7L-DztAF386.mjs";import{n as o,r as s,t as c}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var l=new Map([[`alnum`,`a-zA-Z0-9`],[`alpha`,`a-zA-Z`],[`ascii`,`\\x00-\\x7F`],[`blank`,` \\t`],[`cntrl`,`\\x00-\\x1F\\x7F`],[`digit`,`0-9`],[`graph`,`!-~`],[`lower`,`a-z`],[`print`,` -~`],[`punct`,"!-/:-@\\[-`{-~"],[`space`,` \\t\\n\\r\\f\\v`],[`upper`,`A-Z`],[`word`,`a-zA-Z0-9_`],[`xdigit`,`0-9A-Fa-f`]]);function u(e){let t=``,n=0,r=!1;for(;n<e.length;){if(e[n]===`[`&&!r){if(e[n+1]===`[`&&e[n+2]===`:`){let r=e.indexOf(`:]]`,n+3);if(r!==-1){let i=e.slice(n+3,r),a=l.get(i);if(a){t+=`[${a}]`,n=r+3;continue}}}if(e[n+1]===`^`&&e[n+2]===`[`&&e[n+3]===`:`){let r=e.indexOf(`:]]`,n+4);if(r!==-1){let i=e.slice(n+4,r),a=l.get(i);if(a){t+=`[^${a}]`,n=r+3;continue}}}t+=`[`,n++,r=!0,n<e.length&&e[n]===`^`&&(t+=`^`,n++),n<e.length&&e[n]===`]`&&(t+=`\\]`,n++);continue}if(r){if(e[n]===`]`){t+=`]`,n++,r=!1;continue}if(e[n]===`[`&&e[n+1]===`:`){let r=e.indexOf(`:]`,n+2);if(r!==-1){let i=e.slice(n+2,r),a=l.get(i);if(a){t+=a,n=r+2;continue}}}if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++;continue}if(e[n]===`\\`&&n+1<e.length){let r=e[n+1];if(r===`+`||r===`?`||r===`|`){t+=r,n+=2;continue}if(r===`(`||r===`)`){t+=r,n+=2;continue}if(r===`{`||r===`}`){t+=r,n+=2;continue}if(r===`t`){t+=` `,n+=2;continue}if(r===`n`){t+=`
|
|
2
2
|
`,n+=2;continue}if(r===`r`){t+=`\r`,n+=2;continue}t+=e[n]+r,n+=2;continue}if(e[n]===`+`||e[n]===`?`||e[n]===`|`||e[n]===`(`||e[n]===`)`){t+=`\\${e[n]}`,n++;continue}if(e[n]===`^`&&!(t===``||t.endsWith(`(`))){t+=`\\^`,n++;continue}if(e[n]===`$`){let r=n===e.length-1,i=n+2<e.length&&e[n+1]===`\\`&&e[n+2]===`)`;if(!r&&!i){t+=`\\$`,n++;continue}}t+=e[n],n++}return t}function d(e){let t=``,n=!1;for(let r=0;r<e.length;r++)e[r]===`[`&&!n?(n=!0,t+=`[`,r++,r<e.length&&e[r]===`^`&&(t+=`^`,r++),r<e.length&&e[r]===`]`&&(t+=`]`,r++),r--):e[r]===`]`&&n?(n=!1,t+=`]`):!n&&e[r]===`{`&&e[r+1]===`,`?(t+=`{0,`,r++):t+=e[r];return t}function f(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n],i=r.charCodeAt(0);r===`\\`?t+=`\\\\`:r===` `?t+=`\\t`:r===`
|
|
3
3
|
`?t+=`$
|
|
4
4
|
`:r===`\r`?t+=`\\r`:r===`\x07`?t+=`\\a`:r===`\b`?t+=`\\b`:r===`\f`?t+=`\\f`:r===`\v`?t+=`\\v`:i<32||i>=127?t+=`\\${i.toString(8).padStart(3,`0`)}`:t+=r}return`${t}$`}var p=1e4;function m(e,t,n){return{patternSpace:``,holdSpace:``,lineNumber:0,totalLines:e,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:t,pendingFileReads:[],pendingFileWrites:[],rangeStates:n||new Map,linesConsumedInCycle:0}}function h(e){return typeof e==`object`&&`first`in e&&`step`in e}function g(e){return typeof e==`object`&&`offset`in e}function _(t,n,r,i,a){if(t===`$`)return n===r;if(typeof t==`number`)return n===t;if(h(t)){let{first:e,step:r}=t;return r===0?n===e:(n-e)%r===0&&n>=e}if(typeof t==`object`&&`pattern`in t)try{let n=t.pattern;return n===``&&a?.lastPattern?n=a.lastPattern:n!==``&&a&&(a.lastPattern=n),e(d(u(n))).test(i)}catch{return!1}return!1}function v(e){let t=e=>e===void 0?`undefined`:e===`$`?`$`:typeof e==`number`?String(e):`pattern`in e?`/${e.pattern}/`:`first`in e?`${e.first}~${e.step}`:`unknown`;return`${t(e.start)},${t(e.end)}`}function y(e,t,n,r,i,a){if(!e||!e.start&&!e.end)return!0;let o=e.start,s=e.end;if(o!==void 0&&s===void 0)return _(o,t,n,r,a);if(o!==void 0&&s!==void 0){let c=typeof o==`object`&&`pattern`in o,l=typeof s==`object`&&`pattern`in s,u=g(s);if(u&&i){let c=v(e),l=i.get(c);return l||(l={active:!1},i.set(c,l)),l.active?(t>=(l.startLine||t)+s.offset&&(l.active=!1,i.set(c,l)),!0):_(o,t,n,r,a)?(l.active=!0,l.startLine=t,i.set(c,l),s.offset===0&&(l.active=!1,i.set(c,l)),!0):!1}if(!c&&!l&&!u){let r=typeof o==`number`?o:o===`$`?n:1,a=typeof s==`number`?s:n;if(r<=a)return t>=r&&t<=a;if(i){let n=v(e),a=i.get(n);return a||(a={active:!1},i.set(n,a)),!a.completed&&t>=r?(a.completed=!0,i.set(n,a),!0):!1}return!1}if(i){let c=v(e),l=i.get(c);if(l||(l={active:!1},i.set(c,l)),l.active)return _(s,t,n,r,a)&&(l.active=!1,typeof o==`number`&&(l.completed=!0),i.set(c,l)),!0;{if(l.completed)return!1;let e=!1;return e=typeof o==`number`?t>=o:_(o,t,n,r,a),e?(l.active=!0,l.startLine=t,i.set(c,l),_(s,t,n,r,a)&&(l.active=!1,typeof o==`number`&&(l.completed=!0),i.set(c,l)),!0):!1}}return _(o,t,n,r,a)}return!0}function b(e,t,n,r,i,a){let o=y(e,t,n,r,i,a);return e?.negated?!o:o}function x(e,t,n,r){let i=``,a=0,o=!1;for(;a<=e.length;){t.lastIndex=a;let n=t.exec(e);if(!n){i+=e.slice(a);break}if(n.index!==a){i+=e.slice(a,n.index),a=n.index,o=!1;continue}let s=n[0],c=n.slice(1);if(o&&s.length===0){if(a<e.length)i+=e[a],a++;else break;o=!1;continue}if(i+=r(s,c),o=!1,s.length===0)if(a<e.length)i+=e[a],a++;else break;else a+=s.length,o=!0}return i}function S(e,t,n){let r=``,i=0;for(;i<e.length;){if(e[i]===`\\`&&i+1<e.length){let a=e[i+1];if(a===`&`){r+=`&`,i+=2;continue}if(a===`n`){r+=`
|
|
@@ -97,4 +97,4 @@ Addresses:
|
|
|
97
97
|
`),x+=r}try{let e=await u(`final processing`,()=>F(x,_,b,{limits:l.limits,filename:g.length===1?g[0]:void 0,fs:l.fs,cwd:l.cwd,coverage:l.coverage,requireDefenseContext:l.requireDefenseContext}));return{stdout:e.output,stderr:e.errorMessage?`${e.errorMessage}
|
|
98
98
|
`:``,exitCode:e.exitCode??0}}catch(e){if(e instanceof n)throw e;if(e instanceof t)return{stdout:``,stderr:`sed: ${a(e.message)}
|
|
99
99
|
`,exitCode:t.EXIT_CODE};throw e}}},L={name:`sed`,flags:[{flag:`-n`,type:`boolean`},{flag:`-i`,type:`boolean`},{flag:`-E`,type:`boolean`},{flag:`-r`,type:`boolean`},{flag:`-e`,type:`value`,valueHint:`string`}],stdinType:`text`,needsArgs:!0};export{L as n,I as t};
|
|
100
|
-
//# sourceMappingURL=chunk-OL3S66CO-
|
|
100
|
+
//# sourceMappingURL=chunk-OL3S66CO-CQnF8cPH.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-3THT3N7L-
|
|
1
|
+
import{n as e}from"./chunk-3THT3N7L-DztAF386.mjs";import{n as t,r as n,t as r}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var i={name:`ln`,summary:`make links between files`,usage:`ln [OPTIONS] TARGET LINK_NAME`,options:[`-s create a symbolic link instead of a hard link`,`-f remove existing destination files`,`-n treat LINK_NAME as a normal file if it is a symbolic link to a directory`,`-v print name of each linked file`,` --help display this help and exit`]},a={name:`ln`,async execute(a,o){if(r(a))return n(i);let s=!1,c=!1,l=!1,u=0;for(;u<a.length&&a[u].startsWith(`-`);){let e=a[u];if(e===`-s`||e===`--symbolic`)s=!0,u++;else if(e===`-f`||e===`--force`)c=!0,u++;else if(e===`-v`||e===`--verbose`)l=!0,u++;else if(e===`-n`||e===`--no-dereference`)u++;else if(/^-[sfvn]+$/.test(e))e.includes(`s`)&&(s=!0),e.includes(`f`)&&(c=!0),e.includes(`v`)&&(l=!0),u++;else if(e===`--`){u++;break}else return t(`ln`,e)}let d=a.slice(u);if(d.length<2)return{stdout:``,stderr:`ln: missing file operand
|
|
2
2
|
`,exitCode:1};let f=d[0],p=d[1],m=o.fs.resolvePath(o.cwd,p);if(await o.fs.exists(m))if(c)try{await o.fs.rm(m,{force:!0})}catch{return{stdout:``,stderr:`ln: cannot remove '${p}': Permission denied
|
|
3
3
|
`,exitCode:1}}else return{stdout:``,stderr:`ln: failed to create ${s?`symbolic `:``}link '${p}': File exists
|
|
4
4
|
`,exitCode:1};try{if(s)await o.fs.symlink(f,m);else{let e=o.fs.resolvePath(o.cwd,f);if(!await o.fs.exists(e))return{stdout:``,stderr:`ln: failed to access '${f}': No such file or directory
|
|
@@ -6,4 +6,4 @@ import{n as e}from"./chunk-3THT3N7L-DrzOuTpA.mjs";import{n as t,r as n,t as r}fr
|
|
|
6
6
|
`,exitCode:1}:{stdout:``,stderr:`ln: ${e(n.message)}
|
|
7
7
|
`,exitCode:1}}let h=``;return l&&(h=`'${p}' -> '${f}'
|
|
8
8
|
`),{stdout:h,stderr:``,exitCode:0}}},o={name:`ln`,flags:[{flag:`-s`,type:`boolean`},{flag:`-f`,type:`boolean`},{flag:`-n`,type:`boolean`},{flag:`-v`,type:`boolean`}],needsArgs:!0,minArgs:2};export{a as n,o as t};
|
|
9
|
-
//# sourceMappingURL=chunk-PBXLG62G-
|
|
9
|
+
//# sourceMappingURL=chunk-PBXLG62G-CgbPJTiw.mjs.map
|
|
@@ -2,4 +2,4 @@ async function e(e,t){let n=`octal`,r=[],i=[];for(let t=0;t<e.length;t++){let a=
|
|
|
2
2
|
`,exitCode:1}}}let o=r.includes(`char`);function s(e){return e===0?` \\0`:e===7?` \\a`:e===8?` \\b`:e===9?` \\t`:e===10?` \\n`:e===11?` \\v`:e===12?` \\f`:e===13?` \\r`:e>=32&&e<127?` ${String.fromCharCode(e)}`:` ${e.toString(8).padStart(3,`0`)}`}function c(e){return o?` ${e.toString(16).padStart(2,`0`)}`:` ${e.toString(16).padStart(2,`0`)}`}function l(e){return` ${e.toString(8).padStart(3,`0`)}`}let u=[];for(let e of a)u.push(e.charCodeAt(0));let d=[];for(let e=0;e<u.length;e+=16){let t=u.slice(e,e+16);for(let i=0;i<r.length;i++){let a=r[i],o;o=a===`char`?t.map(s):a===`hex`?t.map(c):t.map(l);let u=``;i===0&&n!==`none`?u=`${e.toString(8).padStart(7,`0`)} `:(i>0||n===`none`)&&(u=n===`none`?``:` `),d.push(u+o.join(``))}}return n!==`none`&&u.length>0&&d.push(u.length.toString(8).padStart(7,`0`)),{stdout:d.length>0?`${d.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`:``,stderr:``,exitCode:0}}var t={name:`od`,execute:e},n={name:`od`,flags:[{flag:`-c`,type:`boolean`},{flag:`-A`,type:`value`,valueHint:`string`},{flag:`-t`,type:`value`,valueHint:`string`},{flag:`-N`,type:`value`,valueHint:`number`}],stdinType:`text`,needsFiles:!0};export{n,t};
|
|
5
|
-
//# sourceMappingURL=chunk-PP6PSHAB-
|
|
5
|
+
//# sourceMappingURL=chunk-PP6PSHAB-CO4MYU__.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-
|
|
1
|
+
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var r={name:`unexpand`,summary:`convert spaces to tabs`,usage:`unexpand [OPTION]... [FILE]...`,description:`Convert blanks in each FILE to TABs, writing to standard output. If no FILE is specified, standard input is read.`,options:[`-t N Use N spaces per tab (default: 8)`,`-t LIST Use comma-separated list of tab stops`,`-a Convert all sequences of blanks (not just leading)`],examples:[`unexpand file.txt # Convert leading spaces to tabs`,`unexpand -a file.txt # Convert all space sequences`,`unexpand -t 4 file.txt # Use 4-space tabs`]};function i(e){let t=e.split(`,`).map(e=>e.trim()),n=[];for(let e of t){let t=parseInt(e,10);if(Number.isNaN(t)||t<1)return null;n.push(t)}for(let e=1;e<n.length;e++)if(n[e]<=n[e-1])return null;return n}function a(e,t){if(t.length===1){let n=t[0];return e+(n-e%n)}for(let n of t)if(n>e)return n;if(t.length>=2){let n=t[t.length-1]-t[t.length-2],r=t[t.length-1];return r+(Math.floor((e-r)/n)+1)*n}return-1}function o(e,t){let{tabStops:n,allBlanks:r}=t,i=``,o=0,s=``,c=0,l=!0,u=()=>{if(s.length===0)return;let e=c+s.length;if(!r&&!l){i+=s,s=``;return}let t=c,o=``;for(;t<e;){let r=a(t,n);if(r<=e&&r>t)o+=` `,t=r;else break}let u=e-t;u>0&&(o+=` `.repeat(u)),i+=o,s=``};for(let t of e)t===` `?(s.length===0&&(c=o),s+=t,o++):t===` `?(u(),i+=t,o=a(o,n)):(u(),i+=t,o++,l=!1);return u(),i}function s(e,t){if(e===``)return``;let n=e.split(`
|
|
2
2
|
`),r=e.endsWith(`
|
|
3
3
|
`)&&n[n.length-1]===``;return r&&n.pop(),n.map(e=>o(e,t)).join(`
|
|
4
4
|
`)+(r?`
|
|
@@ -8,4 +8,4 @@ import{n as e,r as t,t as n}from"./chunk-74CEPOFO-CLQh_oXv.mjs";var r={name:`une
|
|
|
8
8
|
`};c.tabStops=e,u+=2}else if(t.startsWith(`--tabs=`)){let e=i(t.slice(7));if(!e)return{exitCode:1,stdout:``,stderr:`unexpand: invalid tab size: '${t.slice(7)}'
|
|
9
9
|
`};c.tabStops=e,u++}else if(t===`-a`||t===`--all`)c.allBlanks=!0,u++;else if(t===`--`){l.push(...a.slice(u+1));break}else{if(t.startsWith(`-`)&&t!==`-`)return e(`unexpand`,t);l.push(t),u++}}let d=``;if(l.length===0)d=s(o.stdin??``,c);else for(let e of l){let t=o.fs.resolvePath(o.cwd,e),n=await o.fs.readFile(t);if(n===null)return{exitCode:1,stdout:d,stderr:`unexpand: ${e}: No such file or directory
|
|
10
10
|
`};d+=s(n,c)}return{exitCode:0,stdout:d,stderr:``}}},l={name:`unexpand`,flags:[{flag:`-t`,type:`value`,valueHint:`number`},{flag:`-a`,type:`boolean`}],stdinType:`text`,needsFiles:!0};export{c as n,l as t};
|
|
11
|
-
//# sourceMappingURL=chunk-PYSFUGCK-
|
|
11
|
+
//# sourceMappingURL=chunk-PYSFUGCK-DsRn64Ef.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-
|
|
1
|
+
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var r={name:`rev`,summary:`reverse lines characterwise`,usage:`rev [file ...]`,description:`Copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.`,examples:[`echo 'hello' | rev # Output: olleh`,`rev file.txt # Reverse each line in file`]};function i(e){return Array.from(e).reverse().join(``)}var a={name:`rev`,execute:async(a,o)=>{if(n(a))return t(r);let s=[];for(let t of a)if(t===`--`){let e=a.indexOf(t);s.push(...a.slice(e+1));break}else{if(t.startsWith(`-`)&&t!==`-`)return e(`rev`,t);s.push(t)}let c=``,l=e=>{let t=e.split(`
|
|
2
2
|
`),n=e.endsWith(`
|
|
3
3
|
`)&&t[t.length-1]===``;return n&&t.pop(),t.map(i).join(`
|
|
4
4
|
`)+(n?`
|
|
5
5
|
`:``)};if(s.length===0)c=l(o.stdin??``);else for(let e of s)if(e===`-`){let e=o.stdin??``;c+=l(e)}else{let t=o.fs.resolvePath(o.cwd,e),n=await o.fs.readFile(t);if(n===null)return{exitCode:1,stdout:c,stderr:`rev: ${e}: No such file or directory
|
|
6
6
|
`};c+=l(n)}return{exitCode:0,stdout:c,stderr:``}}},o={name:`rev`,flags:[],stdinType:`text`,needsFiles:!0};export{a as n,o as t};
|
|
7
|
-
//# sourceMappingURL=chunk-QCDB2VPH-
|
|
7
|
+
//# sourceMappingURL=chunk-QCDB2VPH-BUMOhlW7.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-74CEPOFO-
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var r={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`]},i={decode:{short:`d`,long:`decode`,type:`boolean`},wrap:{short:`w`,long:`wrap`,type:`number`,default:76}};async function a(e,t,n){if(t.length===0||t.length===1&&t[0]===`-`)return{ok:!0,data:Uint8Array.from(e.stdin,e=>e.charCodeAt(0))};let r=[];for(let i of t){if(i===`-`){r.push(Uint8Array.from(e.stdin,e=>e.charCodeAt(0)));continue}try{let t=e.fs.resolvePath(e.cwd,i),n=await e.fs.readFileBuffer(t);r.push(n)}catch{return{ok:!1,error:{stdout:``,stderr:`${n}: ${i}: No such file or directory
|
|
2
2
|
`,exitCode:1}}}}let i=r.reduce((e,t)=>e+t.length,0),a=new Uint8Array(i),o=0;for(let e of r)a.set(e,o),o+=e.length;return{ok:!0,data:a}}var o={name:`base64`,async execute(o,s){if(t(o))return e(r);let c=n(`base64`,o,i);if(!c.ok)return c.error;let l=c.result.flags.decode,u=c.result.flags.wrap,d=c.result.positional;try{if(l){let e=await a(s,d,`base64`);if(!e.ok)return e.error;if(typeof Buffer<`u`){let t=Buffer.from(e.data).toString(`utf8`).replace(/\s/g,``);return{stdout:Buffer.from(t,`base64`).toString(`latin1`),stderr:``,exitCode:0,stdoutEncoding:`binary`}}let t=String.fromCharCode(...e.data).replace(/\s/g,``);return{stdout:atob(t),stderr:``,exitCode:0,stdoutEncoding:`binary`}}let e=await a(s,d,`base64`);if(!e.ok)return e.error;let t;if(t=typeof Buffer<`u`?Buffer.from(e.data).toString(`base64`):btoa(String.fromCharCode(...e.data)),u>0){let e=[];for(let n=0;n<t.length;n+=u)e.push(t.slice(n,n+u));t=e.join(`
|
|
3
3
|
`)+(t.length>0?`
|
|
4
4
|
`:``)}return{stdout:t,stderr:``,exitCode:0}}catch{return{stdout:``,stderr:`base64: invalid input
|
|
5
5
|
`,exitCode:1}}}},s={name:`base64`,flags:[{flag:`-d`,type:`boolean`},{flag:`-w`,type:`value`,valueHint:`number`}],stdinType:`text`,needsFiles:!0};export{s as n,o as t};
|
|
6
|
-
//# sourceMappingURL=chunk-QJ7O6ZN3-
|
|
6
|
+
//# sourceMappingURL=chunk-QJ7O6ZN3-F0_rcDPM.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e={name:`true`,async execute(){return{stdout:``,stderr:``,exitCode:0}}},t={name:`false`,async execute(){return{stdout:``,stderr:``,exitCode:1}}},n={name:`true`,flags:[]},r={name:`false`,flags:[]};export{t as i,r as n,n as r,e as t};
|
|
2
|
-
//# sourceMappingURL=chunk-R6QSAL5T-
|
|
2
|
+
//# sourceMappingURL=chunk-R6QSAL5T-CeW6f7-x.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
var e=new TextEncoder,t=new TextDecoder;function n(t,n){if(t instanceof Uint8Array)return t;if(n===`base64`)return Uint8Array.from(atob(t),e=>e.charCodeAt(0));if(n===`hex`){let e=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)e[n/2]=parseInt(t.slice(n,n+2),16);return e}if(n===`binary`||n===`latin1`){if(t.length<=65536)return Uint8Array.from(t,e=>e.charCodeAt(0));let e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}return e.encode(t)}function r(e,n){if(n===`base64`){if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);let t=65536,n=``;for(let r=0;r<e.length;r+=t){let i=e.subarray(r,r+t);n+=String.fromCharCode(...i)}return btoa(n)}if(n===`hex`)return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``);if(n===`binary`||n===`latin1`){if(typeof Buffer<`u`)return Buffer.from(e).toString(n);let t=65536;if(e.length<=t)return String.fromCharCode(...e);let r=``;for(let n=0;n<e.length;n+=t){let i=e.subarray(n,n+t);r+=String.fromCharCode(...i)}return r}return t.decode(e)}function i(e){if(e!=null)return typeof e==`string`?e:e.encoding??void 0}export{i as n,n as r,r as t};
|
|
2
|
-
//# sourceMappingURL=chunk-R6VWJ2ZL-
|
|
2
|
+
//# sourceMappingURL=chunk-R6VWJ2ZL-FwG_Za20.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-74CEPOFO-
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var r={name:`du`,summary:`estimate file space usage`,usage:`du [OPTION]... [FILE]...`,options:[`-a write counts for all files, not just directories`,`-h print sizes in human readable format`,`-s display only a total for each argument`,`-c produce a grand total`,`--max-depth=N print total for directory only if N or fewer levels deep`,` --help display this help and exit`]},i={allFiles:{short:`a`,type:`boolean`},humanReadable:{short:`h`,type:`boolean`},summarize:{short:`s`,type:`boolean`},grandTotal:{short:`c`,type:`boolean`},maxDepth:{long:`max-depth`,type:`number`}},a={name:`du`,async execute(a,o){if(t(a))return e(r);let l=n(`du`,a,i);if(!l.ok)return l.error;let u={allFiles:l.result.flags.allFiles,humanReadable:l.result.flags.humanReadable,summarize:l.result.flags.summarize,grandTotal:l.result.flags.grandTotal,maxDepth:l.result.flags.maxDepth??null},d=l.result.positional;d.length===0&&d.push(`.`);let f=``,p=``,m=0;for(let e of d){let t=o.fs.resolvePath(o.cwd,e);try{await o.fs.stat(t);let n=await s(o,t,e,u,0);f+=n.output,m+=n.totalSize,p+=n.stderr}catch{p+=`du: cannot access '${e}': No such file or directory
|
|
2
2
|
`}}return u.grandTotal&&d.length>0&&(f+=`${c(m,u.humanReadable)} total
|
|
3
3
|
`),{stdout:f,stderr:p,exitCode:p?1:0}}},o=1e3;async function s(e,t,n,r,i){let a={output:``,totalSize:0,stderr:``};if(i>o)return a;try{let o=await e.fs.stat(t);if(!o.isDirectory)return a.totalSize=o.size,(r.allFiles||i===0)&&(a.output=c(o.size,r.humanReadable)+` `+n+`
|
|
4
4
|
`),a;let l=0,u=[];if(e.fs.readdirWithFileTypes){let n=await e.fs.readdirWithFileTypes(t),r=n.filter(e=>e.isFile),i=n.filter(e=>e.isDirectory);for(let n=0;n<r.length;n+=100){let i=r.slice(n,n+100),a=await Promise.all(i.map(async n=>{let r=t===`/`?`/${n.name}`:`${t}/${n.name}`;try{let t=await e.fs.stat(r);return{name:n.name,isDirectory:!1,size:t.size}}catch{return{name:n.name,isDirectory:!1,size:0}}}));u.push(...a)}u.push(...i.map(e=>({name:e.name,isDirectory:!0})))}else{let n=await e.fs.readdir(t);for(let r=0;r<n.length;r+=100){let i=n.slice(r,r+100),a=await Promise.all(i.map(async n=>{let r=t===`/`?`/${n}`:`${t}/${n}`;try{let t=await e.fs.stat(r);return{name:n,isDirectory:t.isDirectory,size:t.isDirectory?void 0:t.size}}catch{return{name:n,isDirectory:!1,size:0}}}));u.push(...a)}}u.sort((e,t)=>e.name.localeCompare(t.name));let d=u.filter(e=>!e.isDirectory);for(let e of d){let t=e.size??0;if(l+=t,r.allFiles&&!r.summarize){let i=n===`.`?e.name:`${n}/${e.name}`;a.output+=c(t,r.humanReadable)+` `+i+`
|
|
5
5
|
`}}let f=u.filter(e=>e.isDirectory);for(let o=0;o<f.length;o+=100){let c=f.slice(o,o+100),u=await Promise.all(c.map(async a=>{let o=t===`/`?`/${a.name}`:`${t}/${a.name}`,c=n===`.`?a.name:`${n}/${a.name}`;return{name:a.name,result:await s(e,o,c,r,i+1)}}));u.sort((e,t)=>e.name.localeCompare(t.name));for(let{result:e}of u)l+=e.totalSize,r.summarize||(r.maxDepth===null||i+1<=r.maxDepth)&&(a.output+=e.output)}a.totalSize=l,(r.summarize||r.maxDepth===null||i<=r.maxDepth)&&(a.output+=`${c(l,r.humanReadable)} ${n}
|
|
6
6
|
`)}catch{a.stderr=`du: cannot read directory '${n}': Permission denied
|
|
7
7
|
`}return a}function c(e,t){return t?e<1024?`${e}`:e<1024*1024?`${(e/1024).toFixed(1)}K`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)}M`:`${(e/(1024*1024*1024)).toFixed(1)}G`:String(Math.ceil(e/1024)||1)}var l={name:`du`,flags:[{flag:`-a`,type:`boolean`},{flag:`-h`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-c`,type:`boolean`},{flag:`--max-depth`,type:`value`,valueHint:`number`}],needsFiles:!0};export{l as n,a as t};
|
|
8
|
-
//# sourceMappingURL=chunk-RPNGRAAP-
|
|
8
|
+
//# sourceMappingURL=chunk-RPNGRAAP-BmkapBPD.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-
|
|
1
|
+
import{n as e,r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as r}from"./chunk-7L36YK2X-D7Z_Qw_C.mjs";var i={name:`cut`,summary:`remove sections from each line of files`,usage:`cut [OPTION]... [FILE]...`,options:[`-c LIST select only these characters`,`-d DELIM use DELIM instead of TAB for field delimiter`,`-f LIST select only these fields`,`-s, --only-delimited do not print lines without delimiters`,` --help display this help and exit`]};function a(e){let t=[],n=e.split(`,`);for(let e of n)if(e.includes(`-`)){let[n,r]=e.split(`-`);t.push({start:n?parseInt(n,10):1,end:r?parseInt(r,10):null})}else{let n=parseInt(e,10);t.push({start:n,end:n})}return t}function o(e,t){let n=[];for(let r of t){let t=r.start-1,i=r.end===null?e.length:r.end;for(let r=t;r<i&&r<e.length;r++)r>=0&&!n.includes(e[r])&&n.push(e[r])}return n}var s={name:`cut`,async execute(s,c){if(n(s))return t(i);let l=` `,u=null,d=null,f=!1,p=[];for(let t=0;t<s.length;t++){let n=s[t];if(n===`-d`)l=s[++t]||` `;else if(n.startsWith(`-d`))l=n.slice(2);else if(n===`-f`)u=s[++t];else if(n.startsWith(`-f`))u=n.slice(2);else if(n===`-c`)d=s[++t];else if(n.startsWith(`-c`))d=n.slice(2);else if(n===`-s`||n===`--only-delimited`)f=!0;else{if(n.startsWith(`--`))return e(`cut`,n);if(n.startsWith(`-`)){let t=!1;for(let e of n.slice(1))if(e===`s`)f=!0;else if(!`dfc`.includes(e)){t=!0;break}if(t)return e(`cut`,n)}else p.push(n)}}if(!u&&!d)return{stdout:``,stderr:`cut: you must specify a list of bytes, characters, or fields
|
|
2
2
|
`,exitCode:1};let m=await r(c,p,{cmdName:`cut`});if(!m.ok)return m.error;let h=m.content.split(`
|
|
3
3
|
`);h.length>0&&h[h.length-1]===``&&h.pop();let g=a(u||d||`1`),_=``;for(let e of h)if(d){let t=e.split(``),n=[];for(let e of g){let r=e.start-1,i=e.end===null?t.length:e.end;for(let e=r;e<i&&e<t.length;e++)e>=0&&n.push(t[e])}_+=`${n.join(``)}
|
|
4
4
|
`}else{if(f&&!e.includes(l))continue;let t=o(e.split(l),g);_+=`${t.join(l)}
|
|
5
5
|
`}return{stdout:_,stderr:``,exitCode:0,stdoutEncoding:`binary`}}},c={name:`cut`,flags:[{flag:`-d`,type:`value`,valueHint:`delimiter`},{flag:`-f`,type:`value`,valueHint:`string`},{flag:`-c`,type:`value`,valueHint:`string`},{flag:`-s`,type:`boolean`}],stdinType:`text`,needsFiles:!0};export{s as n,c as t};
|
|
6
|
-
//# sourceMappingURL=chunk-SDNKECQQ-
|
|
6
|
+
//# sourceMappingURL=chunk-SDNKECQQ-DkebEzkd.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-DXB73IDG-
|
|
1
|
+
import{r as e,t}from"./chunk-DXB73IDG-DIKSLkPq.mjs";var n=e((e,n)=>{(function(t,r){typeof define==`function`&&define.amd?define([],r):typeof n==`object`&&typeof e<`u`?n.exports=r():t.Papa=r()})(e,function e(){var n=(function(){return typeof self<`u`?self:typeof window<`u`?window:typeof n<`u`?n:{}})();function r(){var t=n.URL||n.webkitURL||null,r=e.toString();return c.BLOB_URL||=t.createObjectURL(new Blob([`var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; `,`(`,r,`)();`],{type:`text/javascript`}))}var i=!n.document&&!!n.postMessage,a=n.IS_PAPA_WORKER||!1,o={},s=0,c={};if(c.parse=u,c.unparse=d,c.RECORD_SEP=``,c.UNIT_SEP=``,c.BYTE_ORDER_MARK=``,c.BAD_DELIMITERS=[`\r`,`
|
|
2
2
|
`,`"`,c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!i&&!!n.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=1024*1024*10,c.RemoteChunkSize=1024*1024*5,c.DefaultDelimiter=`,`,c.Parser=b,c.ParserHandle=v,c.NetworkStreamer=p,c.FileStreamer=m,c.StringStreamer=h,c.ReadableStreamStreamer=g,typeof PAPA_BROWSER_CONTEXT>`u`&&(c.DuplexStreamStreamer=_),n.jQuery){var l=n.jQuery;l.fn.parse=function(e){var t=e.config||{},r=[];return this.each(function(e){if(!(l(this).prop(`tagName`).toUpperCase()===`INPUT`&&l(this).attr(`type`).toLowerCase()===`file`&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var i=0;i<this.files.length;i++)r.push({file:this.files[i],inputElem:this,instanceConfig:l.extend({},t)})}),i(),this;function i(){if(r.length===0){O(e.complete)&&e.complete();return}var t=r[0];if(O(e.before)){var n=e.before(t.file,t.inputElem);if(typeof n==`object`)if(n.action===`abort`){a(`AbortError`,t.file,t.inputElem,n.reason);return}else if(n.action===`skip`){o();return}else typeof n.config==`object`&&(t.instanceConfig=l.extend(t.instanceConfig,n.config));else if(n===`skip`){o();return}}var i=t.instanceConfig.complete;t.instanceConfig.complete=function(e){O(i)&&i(e,t.file,t.inputElem),o()},c.parse(t.file,t.instanceConfig)}function a(t,n,r,i){O(e.error)&&e.error({name:t},n,r,i)}function o(){r.splice(0,1),i()}}}a&&(n.onmessage=T);function u(e,t){t||={};var r=t.dynamicTyping||!1;if(O(r)&&(t.dynamicTypingFunction=r,r={}),t.dynamicTyping=r,t.transform=O(t.transform)?t.transform:!1,t.worker&&c.WORKERS_SUPPORTED){var i=x();i.userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=O(t.step),t.chunk=O(t.chunk),t.complete=O(t.complete),t.error=O(t.error),delete t.worker,i.postMessage({input:e,config:t,workerId:i.id});return}var a=null;if(e===c.NODE_STREAM_INPUT&&typeof PAPA_BROWSER_CONTEXT>`u`)return a=new _(t),a.getStream();return typeof e==`string`?(e=o(e),a=t.download?new p(t):new h(t)):e.readable===!0&&O(e.read)&&O(e.on)?a=new g(t):(n.File&&e instanceof File||e instanceof Object)&&(a=new m(t)),a.stream(e);function o(e){return e.charCodeAt(0)===65279?e.slice(1):e}}function d(e,t){var n=!1,r=!0,i=`,`,a=`\r
|
|
3
3
|
`,o=`"`,s=o+o,l=!1,u=null,d=!1;p();var f=new RegExp(y(o),`g`);if(typeof e==`string`&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return m(null,e,l);if(typeof e[0]==`object`)return m(u||Object.keys(e[0]),e,l)}else if(typeof e==`object`)return typeof e.data==`string`&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||=e.meta&&e.meta.fields||u,e.fields||=Array.isArray(e.data[0])?e.fields:typeof e.data[0]==`object`?Object.keys(e.data[0]):[],!Array.isArray(e.data[0])&&typeof e.data[0]!=`object`&&(e.data=[e.data])),m(e.fields||[],e.data||[],l);throw Error(`Unable to serialize unrecognized input`);function p(){if(typeof t==`object`){if(typeof t.delimiter==`string`&&!c.BAD_DELIMITERS.filter(function(e){return t.delimiter.indexOf(e)!==-1}).length&&(i=t.delimiter),(typeof t.quotes==`boolean`||typeof t.quotes==`function`||Array.isArray(t.quotes))&&(n=t.quotes),(typeof t.skipEmptyLines==`boolean`||typeof t.skipEmptyLines==`string`)&&(l=t.skipEmptyLines),typeof t.newline==`string`&&(a=t.newline),typeof t.quoteChar==`string`&&(o=t.quoteChar),typeof t.header==`boolean`&&(r=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw Error(`Option columns is empty`);u=t.columns}t.escapeChar!==void 0&&(s=t.escapeChar+o),t.escapeFormulae instanceof RegExp?d=t.escapeFormulae:typeof t.escapeFormulae==`boolean`&&t.escapeFormulae&&(d=/^[=+\-@\t\r].*$/)}}function m(e,t,n){var o=``;typeof e==`string`&&(e=JSON.parse(e)),typeof t==`string`&&(t=JSON.parse(t));var s=Array.isArray(e)&&e.length>0,c=!Array.isArray(t[0]);if(s&&r){for(var l=0;l<e.length;l++)l>0&&(o+=i),o+=h(e[l],l);t.length>0&&(o+=a)}for(var u=0;u<t.length;u++){var d=s?e.length:t[u].length,f=!1,p=s?Object.keys(t[u]).length===0:t[u].length===0;if(n&&!s&&(f=n===`greedy`?t[u].join(``).trim()===``:t[u].length===1&&t[u][0].length===0),n===`greedy`&&s){for(var m=[],g=0;g<d;g++){var _=c?e[g]:g;m.push(t[u][_])}f=m.join(``).trim()===``}if(!f){for(var v=0;v<d;v++){v>0&&!p&&(o+=i);var y=s&&c?e[v]:v;o+=h(t[u][y],v)}u<t.length-1&&(!n||d>0&&!p)&&(o+=a)}}return o}function h(e,t){if(typeof e>`u`||e===null)return``;if(e.constructor===Date)return JSON.stringify(e).slice(1,25);var r=!1;d&&typeof e==`string`&&d.test(e)&&(e=`'`+e,r=!0);var a=e.toString().replace(f,s);return r=r||n===!0||typeof n==`function`&&n(e,t)||Array.isArray(n)&&n[t]||g(a,c.BAD_DELIMITERS)||a.indexOf(i)>-1||a.charAt(0)===` `||a.charAt(a.length-1)===` `,r?o+a+o:a}function g(e,t){for(var n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return!0;return!1}}function f(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine=``,this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},t.call(this,e),this.parseChunk=function(e,t){let r=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&r>0){let t=this._config.newline;if(!t){let n=this._config.quoteChar||`"`;t=this._handle.guessLineEndings(e,n)}e=[...e.split(t).slice(r)].join(t)}if(this.isFirstChunk&&O(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(e);i!==void 0&&(e=i)}this.isFirstChunk=!1,this._halted=!1;var o=this._partialLine+e;this._partialLine=``;var s=this._handle.parse(o,this._baseIndex,!this._finished);if(this._handle.paused()||this._handle.aborted()){this._halted=!0;return}var l=s.meta.cursor;this._finished||(this._partialLine=o.substring(l-this._baseIndex),this._baseIndex=l),s&&s.data&&(this._rowCount+=s.data.length);var u=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(a)n.postMessage({results:s,workerId:c.WORKER_ID,finished:u});else if(O(this._config.chunk)&&!t){if(this._config.chunk(s,this._handle),this._handle.paused()||this._handle.aborted()){this._halted=!0;return}s=void 0,this._completeResults=void 0}return!this._config.step&&!this._config.chunk&&(this._completeResults.data=this._completeResults.data.concat(s.data),this._completeResults.errors=this._completeResults.errors.concat(s.errors),this._completeResults.meta=s.meta),!this._completed&&u&&O(this._config.complete)&&(!s||!s.meta.aborted)&&(this._config.complete(this._completeResults,this._input),this._completed=!0),!u&&(!s||!s.meta.paused)&&this._nextChunk(),s},this._sendError=function(e){O(this._config.error)?this._config.error(e):a&&this._config.error&&n.postMessage({workerId:c.WORKER_ID,error:e,finished:!1})};function t(e){var t=E(e);t.chunkSize=parseInt(t.chunkSize),!e.step&&!e.chunk&&(t.chunkSize=null),this._handle=new v(t),this._handle.streamer=this,this._config=t}}function p(e){e||={},e.chunkSize||=c.RemoteChunkSize,f.call(this,e);var t;i?this._nextChunk=function(){this._readChunk(),this._chunkLoaded()}:this._nextChunk=function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished){this._chunkLoaded();return}if(t=new XMLHttpRequest,this._config.withCredentials&&(t.withCredentials=this._config.withCredentials),i||(t.onload=D(this._chunkLoaded,this),t.onerror=D(this._chunkError,this)),t.open(this._config.downloadRequestBody?`POST`:`GET`,this._input,!i),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var n in e)t.setRequestHeader(n,e[n])}if(this._config.chunkSize){var r=this._start+this._config.chunkSize-1;t.setRequestHeader(`Range`,`bytes=`+this._start+`-`+r)}try{t.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}i&&t.status===0&&this._chunkError()},this._chunkLoaded=function(){if(t.readyState===4){if(t.status<200||t.status>=400){this._chunkError();return}this._start+=this._config.chunkSize?this._config.chunkSize:t.responseText.length,this._finished=!this._config.chunkSize||this._start>=n(t),this.parseChunk(t.responseText)}},this._chunkError=function(e){var n=t.statusText||e;this._sendError(Error(n))};function n(e){var t=e.getResponseHeader(`Content-Range`);return t===null?-1:parseInt(t.substring(t.lastIndexOf(`/`)+1))}}p.prototype=Object.create(f.prototype),p.prototype.constructor=p;function m(e){e||={},e.chunkSize||=c.LocalChunkSize,f.call(this,e);var t,n,r=typeof FileReader<`u`;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?(t=new FileReader,t.onload=D(this._chunkLoaded,this),t.onerror=D(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){!this._finished&&(!this._config.preview||this._rowCount<this._config.preview)&&this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var i=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,i)}var a=t.readAsText(e,this._config.encoding);r||this._chunkLoaded({target:{result:a}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}m.prototype=Object.create(f.prototype),m.prototype.constructor=m;function h(e){e||={},f.call(this,e);var t;this.stream=function(e){return t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,n;return e?(n=t.substring(0,e),t=t.substring(e)):(n=t,t=``),this._finished=!t,this.parseChunk(n)}}}h.prototype=Object.create(h.prototype),h.prototype.constructor=h;function g(e){e||={},f.call(this,e);var t=[],n=!0,r=!1;this.pause=function(){f.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){f.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(`data`,this._streamData),this._input.on(`end`,this._streamEnd),this._input.on(`error`,this._streamError)},this._checkIsFinished=function(){r&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):n=!0},this._streamData=D(function(e){try{t.push(typeof e==`string`?e:e.toString(this._config.encoding)),n&&(n=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=D(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=D(function(){this._streamCleanUp(),r=!0,this._streamData(``)},this),this._streamCleanUp=D(function(){this._input.removeListener(`data`,this._streamData),this._input.removeListener(`end`,this._streamEnd),this._input.removeListener(`error`,this._streamError)},this)}g.prototype=Object.create(f.prototype),g.prototype.constructor=g;function _(e){var n=t(`stream`).Duplex,r=E(e),i=!0,a=!1,o=[],s=null;this._onCsvData=function(e){var t=e.data;!s.push(t)&&!this._handle.paused()&&this._handle.pause()},this._onCsvComplete=function(){s.push(null)},r.step=D(this._onCsvData,this),r.complete=D(this._onCsvComplete,this),f.call(this,r),this._nextChunk=function(){a&&o.length===1&&(this._finished=!0),o.length?o.shift()():i=!0},this._addToParseQueue=function(e,t){o.push(D(function(){if(this.parseChunk(typeof e==`string`?e:e.toString(r.encoding)),O(t))return t()},this)),i&&(i=!1,this._nextChunk())},this._onRead=function(){this._handle.paused()&&this._handle.resume()},this._onWrite=function(e,t,n){this._addToParseQueue(e,n)},this._onWriteComplete=function(){a=!0,this._addToParseQueue(``)},this.getStream=function(){return s},s=new n({readableObjectMode:!0,decodeStrings:!1,read:D(this._onRead,this),write:D(this._onWrite,this)}),s.once(`finish`,D(this._onWriteComplete,this))}typeof PAPA_BROWSER_CONTEXT>`u`&&(_.prototype=Object.create(f.prototype),_.prototype.constructor=_);function v(e){var t=2**53,n=-t,r=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,i=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,a=this,o=0,s=0,l,u,d=!1,f=!1,p,m=[],h={data:[],errors:[],meta:{}};if(O(e.step)){var g=e.step;e.step=function(t){if(h=t,S())x();else{if(x(),h.data.length===0)return;o+=t.data.length,e.preview&&o>e.preview?u.abort():(h.data=h.data[0],g(h,a))}}}this.parse=function(t,n,r){var i=e.quoteChar||`"`;if(e.newline||=this.guessLineEndings(t,i),p=!1,e.delimiter)O(e.delimiter)&&(e.delimiter=e.delimiter(t),h.meta.delimiter=e.delimiter);else{var a=k(t,e.newline,e.skipEmptyLines,e.comments,e.delimitersToGuess);a.successful?e.delimiter=a.bestDelimiter:(p=!0,e.delimiter=c.DefaultDelimiter),h.meta.delimiter=e.delimiter}var o=E(e);return e.preview&&e.header&&o.preview++,l=t,u=new b(o),h=u.parse(l,n,r),x(),d?{meta:{paused:!0}}:h||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,u.abort(),l=O(e.chunk)?``:l.substring(u.getCharIndex())},this.resume=function(){a.streamer._halted?(d=!1,a.streamer.parseChunk(l,!0)):setTimeout(a.resume,3)},this.aborted=function(){return f},this.abort=function(){f=!0,u.abort(),h.meta.aborted=!0,O(e.complete)&&e.complete(h),l=``},this.guessLineEndings=function(e,t){e=e.substring(0,1024*1024);var n=RegExp(y(t)+`([^]*?)`+y(t),`gm`);e=e.replace(n,``);var r=e.split(`\r`),i=e.split(`
|
|
4
4
|
`),a=i.length>1&&i[0].length<r[0].length;if(r.length===1||a)return`
|
|
@@ -19,4 +19,4 @@ License: MIT
|
|
|
19
19
|
*)
|
|
20
20
|
*/
|
|
21
21
|
export{n as t};
|
|
22
|
-
//# sourceMappingURL=chunk-SYMJJMQ4-
|
|
22
|
+
//# sourceMappingURL=chunk-SYMJJMQ4-DOZMaECk.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-FK9Q3tQk.mjs";import{i as t}from"./chunk-GFQRA5P5-
|
|
1
|
+
import{t as e}from"./chunk-FK9Q3tQk.mjs";import{i as t}from"./chunk-GFQRA5P5-DnjwTqP3.mjs";import{t as n}from"./chunk-44UOCSGV-CaFxJDHm.mjs";import{r,t as i}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{n as a,r as o}from"./chunk-EEXR5ZDP-CETL3_Uw.mjs";var s=e((e=>{(function(){var t={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function n(e){return i(o(e),arguments)}function r(e,t){return n.apply(null,[e].concat(t||[]))}function i(e,r){var i=1,a=e.length,o,s=``,c,l,u,d,f,p,m,h;for(c=0;c<a;c++)if(typeof e[c]==`string`)s+=e[c];else if(typeof e[c]==`object`){if(u=e[c],u.keys)for(o=r[i],l=0;l<u.keys.length;l++){if(o==null)throw Error(n(`[sprintf] Cannot access property "%s" of undefined value "%s"`,u.keys[l],u.keys[l-1]));o=o[u.keys[l]]}else o=u.param_no?r[u.param_no]:r[i++];if(t.not_type.test(u.type)&&t.not_primitive.test(u.type)&&o instanceof Function&&(o=o()),t.numeric_arg.test(u.type)&&typeof o!=`number`&&isNaN(o))throw TypeError(n(`[sprintf] expecting number but found %T`,o));switch(t.number.test(u.type)&&(m=o>=0),u.type){case`b`:o=parseInt(o,10).toString(2);break;case`c`:o=String.fromCharCode(parseInt(o,10));break;case`d`:case`i`:o=parseInt(o,10);break;case`j`:o=JSON.stringify(o,null,u.width?parseInt(u.width):0);break;case`e`:o=u.precision?parseFloat(o).toExponential(u.precision):parseFloat(o).toExponential();break;case`f`:o=u.precision?parseFloat(o).toFixed(u.precision):parseFloat(o);break;case`g`:o=u.precision?String(Number(o.toPrecision(u.precision))):parseFloat(o);break;case`o`:o=(parseInt(o,10)>>>0).toString(8);break;case`s`:o=String(o),o=u.precision?o.substring(0,u.precision):o;break;case`t`:o=String(!!o),o=u.precision?o.substring(0,u.precision):o;break;case`T`:o=Object.prototype.toString.call(o).slice(8,-1).toLowerCase(),o=u.precision?o.substring(0,u.precision):o;break;case`u`:o=parseInt(o,10)>>>0;break;case`v`:o=o.valueOf(),o=u.precision?o.substring(0,u.precision):o;break;case`x`:o=(parseInt(o,10)>>>0).toString(16);break;case`X`:o=(parseInt(o,10)>>>0).toString(16).toUpperCase();break}t.json.test(u.type)?s+=o:(t.number.test(u.type)&&(!m||u.sign)?(h=m?`+`:`-`,o=o.toString().replace(t.sign,``)):h=``,f=u.pad_char?u.pad_char===`0`?`0`:u.pad_char.charAt(1):` `,p=u.width-(h+o).length,d=u.width&&p>0?f.repeat(p):``,s+=u.align?h+o+d:f===`0`?h+d+o:d+h+o)}return s}var a=Object.create(null);function o(e){if(a[e])return a[e];for(var n=e,r,i=[],o=0;n;){if((r=t.text.exec(n))!==null)i.push(r[0]);else if((r=t.modulo.exec(n))!==null)i.push(`%`);else if((r=t.placeholder.exec(n))!==null){if(r[2]){o|=1;var s=[],c=r[2],l=[];if((l=t.key.exec(c))!==null)for(s.push(l[1]);(c=c.substring(l[0].length))!==``;)if((l=t.key_access.exec(c))!==null)s.push(l[1]);else if((l=t.index_access.exec(c))!==null)s.push(l[1]);else throw SyntaxError(`[sprintf] failed to parse named argument key`);else throw SyntaxError(`[sprintf] failed to parse named argument key`);r[2]=s}else o|=2;if(o===3)throw Error(`[sprintf] mixing positional and named placeholders is not (yet) supported`);i.push({placeholder:r[0],param_no:r[1],keys:r[2],sign:r[3],pad_char:r[4],align:r[5],width:r[6],precision:r[7],type:r[8]})}else throw SyntaxError(`[sprintf] unexpected placeholder`);n=n.substring(r[0].length)}return a[e]=i}e!==void 0&&(e.sprintf=n,e.vsprintf=r),typeof window<`u`&&(window.sprintf=n,window.vsprintf=r,typeof define==`function`&&define.amd&&define(function(){return{sprintf:n,vsprintf:r}}))})()}))();function c(e,t,n){let r=new Date(t*1e3),i=``,a=0;for(;a<e.length;)if(e[a]===`%`&&a+1<e.length){let t=e[a+1],o=u(r,t,n);o===null?(i+=e[a],a++):(i+=o,a+=2)}else i+=e[a],a++;return i}function l(e,t){let n={year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,weekday:`short`,hour12:!1,timeZone:t};try{let t=new Intl.DateTimeFormat(`en-US`,n).formatToParts(e),r=e=>t.find(t=>t.type===e)?.value??``,i=new Map([[`Sun`,0],[`Mon`,1],[`Tue`,2],[`Wed`,3],[`Thu`,4],[`Fri`,5],[`Sat`,6]]),a=r(`weekday`);return{year:Number.parseInt(r(`year`),10)||e.getFullYear(),month:Number.parseInt(r(`month`),10)||e.getMonth()+1,day:Number.parseInt(r(`day`),10)||e.getDate(),hour:Number.parseInt(r(`hour`),10)||e.getHours(),minute:Number.parseInt(r(`minute`),10)||e.getMinutes(),second:Number.parseInt(r(`second`),10)||e.getSeconds(),weekday:i.get(a)??e.getDay()}}catch{return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),weekday:e.getDay()}}}function u(e,t,n){let r=l(e,n),i=(e,t=2)=>String(e).padStart(t,`0`),a=p(r.year,r.month,r.day),o=m(r.year,r.month,r.day,r.weekday,0),s=m(r.year,r.month,r.day,r.weekday,1);switch(t){case`a`:return[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][r.weekday];case`A`:return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`][r.weekday];case`b`:case`h`:return[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][r.month-1];case`B`:return[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`][r.month-1];case`c`:return`${[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`][r.weekday]} ${[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`][r.month-1]} ${String(r.day).padStart(2,` `)} ${i(r.hour)}:${i(r.minute)}:${i(r.second)} ${r.year}`;case`C`:return i(Math.floor(r.year/100));case`d`:return i(r.day);case`D`:return`${i(r.month)}/${i(r.day)}/${i(r.year%100)}`;case`e`:return String(r.day).padStart(2,` `);case`F`:return`${r.year}-${i(r.month)}-${i(r.day)}`;case`g`:return i(g(r.year,r.month,r.day)%100);case`G`:return String(g(r.year,r.month,r.day));case`H`:return i(r.hour);case`I`:return i(r.hour%12||12);case`j`:return String(a).padStart(3,`0`);case`k`:return String(r.hour).padStart(2,` `);case`l`:return String(r.hour%12||12).padStart(2,` `);case`m`:return i(r.month);case`M`:return i(r.minute);case`n`:return`
|
|
2
2
|
`;case`N`:return`000000000`;case`p`:return r.hour<12?`AM`:`PM`;case`P`:return r.hour<12?`am`:`pm`;case`r`:return`${i(r.hour%12||12)}:${i(r.minute)}:${i(r.second)} ${r.hour<12?`AM`:`PM`}`;case`R`:return`${i(r.hour)}:${i(r.minute)}`;case`s`:return String(Math.floor(e.getTime()/1e3));case`S`:return i(r.second);case`t`:return` `;case`T`:return`${i(r.hour)}:${i(r.minute)}:${i(r.second)}`;case`u`:return String(r.weekday===0?7:r.weekday);case`U`:return i(o);case`V`:return i(h(r.year,r.month,r.day));case`w`:return String(r.weekday);case`W`:return i(s);case`x`:return`${i(r.month)}/${i(r.day)}/${i(r.year%100)}`;case`X`:return`${i(r.hour)}:${i(r.minute)}:${i(r.second)}`;case`y`:return i(r.year%100);case`Y`:return String(r.year);case`z`:return d(e,n);case`Z`:return f(e,n);case`%`:return`%`;default:return null}}function d(e,t){if(!t){let t=-e.getTimezoneOffset(),n=t>=0?`+`:`-`,r=Math.floor(Math.abs(t)/60),i=Math.abs(t)%60;return`${n}${String(r).padStart(2,`0`)}${String(i).padStart(2,`0`)}`}try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,timeZoneName:`longOffset`}).formatToParts(e).find(e=>e.type===`timeZoneName`);if(n){let e=n.value.match(/GMT([+-])(\d{2}):(\d{2})/);if(e)return`${e[1]}${e[2]}${e[3]}`;if(n.value===`GMT`||n.value===`UTC`)return`+0000`}}catch{}let n=-e.getTimezoneOffset(),r=n>=0?`+`:`-`,i=Math.floor(Math.abs(n)/60),a=Math.abs(n)%60;return`${r}${String(i).padStart(2,`0`)}${String(a).padStart(2,`0`)}`}function f(e,t){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:t,timeZoneName:`short`}).formatToParts(e).find(e=>e.type===`timeZoneName`)?.value??`UTC`}catch{return`UTC`}}function p(e,t,n){let r=[31,28,31,30,31,30,31,31,30,31,30,31];(e%4==0&&e%100!=0||e%400==0)&&(r[1]=29);let i=n;for(let e=0;e<t-1;e++)i+=r[e];return i}function m(e,t,n,r,i){let a=p(e,t,n),o=(new Date(e,0,1).getDay()-i+7)%7,s=(r-i+7)%7,c=a-1+o;return Math.floor((c-s+7)/7)}function h(e,t,n){let r=new Date(e,t-1,n,12,0,0);r.setDate(r.getDate()+3-(r.getDay()+6)%7);let i=new Date(r.getFullYear(),0,4);i.setDate(i.getDate()+3-(i.getDay()+6)%7);let a=r.getTime()-i.getTime();return 1+Math.round(a/(10080*60*1e3))}function g(e,t,n){let r=new Date(e,t-1,n,12,0,0);return r.setDate(r.getDate()+3-(r.getDay()+6)%7),r.getFullYear()}function _(e){let t=``,n=0;for(;n<e.length;){let r=e[n];if(r<128){t+=String.fromCharCode(r),n++;continue}if((r&224)==192){if(n+1<e.length&&(e[n+1]&192)==128&&r>=194){let i=(r&31)<<6|e[n+1]&63;t+=String.fromCharCode(i),n+=2;continue}t+=String.fromCharCode(r),n++;continue}if((r&240)==224){if(n+2<e.length&&(e[n+1]&192)==128&&(e[n+2]&192)==128){if(r===224&&e[n+1]<160){t+=String.fromCharCode(r),n++;continue}let i=(r&15)<<12|(e[n+1]&63)<<6|e[n+2]&63;if(i>=55296&&i<=57343){t+=String.fromCharCode(r),n++;continue}t+=String.fromCharCode(i),n+=3;continue}t+=String.fromCharCode(r),n++;continue}if((r&248)==240&&r<=244){if(n+3<e.length&&(e[n+1]&192)==128&&(e[n+2]&192)==128&&(e[n+3]&192)==128){if(r===240&&e[n+1]<144){t+=String.fromCharCode(r),n++;continue}let i=(r&7)<<18|(e[n+1]&63)<<12|(e[n+2]&63)<<6|e[n+3]&63;if(i>1114111){t+=String.fromCharCode(r),n++;continue}t+=String.fromCodePoint(i),n+=4;continue}t+=String.fromCharCode(r),n++;continue}t+=String.fromCharCode(r),n++}return t}var v={name:`printf`,summary:`format and print data`,usage:`printf [-v var] FORMAT [ARGUMENT...]`,options:[` -v var assign the output to shell variable VAR rather than display it`,` --help display this help and exit`],notes:[`FORMAT controls the output like in C printf.`,`Escape sequences: \\n (newline), \\t (tab), \\\\ (backslash)`,`Format specifiers: %s (string), %d (integer), %f (float), %x (hex), %o (octal), %% (literal %)`,`Width and precision: %10s (width 10), %.2f (2 decimal places), %010d (zero-padded)`,`Flags: %- (left-justify), %+ (show sign), %0 (zero-pad)`]},y={name:`printf`,async execute(e,a){if(i(e))return r(v);if(e.length===0)return{stdout:``,stderr:`printf: usage: printf format [arguments]
|
|
3
3
|
`,exitCode:2};let s=null,c=0;for(;c<e.length;){let t=e[c];if(t===`--`){c++;break}if(t===`-v`){if(c+1>=e.length)return{stdout:``,stderr:`printf: -v: option requires an argument
|
|
4
4
|
`,exitCode:1};if(s=e[c+1],!/^[a-zA-Z_][a-zA-Z0-9_]*(\[[a-zA-Z0-9_@*"'$]+\])?$/.test(s))return{stdout:``,stderr:`printf: \`${s}': not a valid identifier
|
|
@@ -12,4 +12,4 @@ import{t as e}from"./chunk-FK9Q3tQk.mjs";import{i as t}from"./chunk-GFQRA5P5-CkM
|
|
|
12
12
|
`}}}}var S=!1;function C(e){S=!1;let t=e.trimStart(),n=t!==t.trimEnd();if(e=t.trimEnd(),e.startsWith(`'`)&&e.length>=2||e.startsWith(`"`)&&e.length>=2)return e.charCodeAt(1);if(e.startsWith(`\\'`)&&e.length>=3||e.startsWith(`\\"`)&&e.length>=3)return e.charCodeAt(2);if(e.startsWith(`+`)&&(e=e.slice(1)),e.startsWith(`0x`)||e.startsWith(`0X`)){let t=parseInt(e,16);return Number.isNaN(t)?(S=!0,0):(n&&(S=!0),t)}if(e.startsWith(`0`)&&e.length>1&&/^-?0[0-7]+$/.test(e))return n&&(S=!0),parseInt(e,8)||0;if(/^\d+#/.test(e)){S=!0;let t=e.match(/^(\d+)#/);return t?parseInt(t[1],10):0}if(e!==``&&!/^-?\d+$/.test(e)){S=!0;let t=parseInt(e,10);return Number.isNaN(t)?0:t}return n&&(S=!0),parseInt(e,10)||0}function w(e,t){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[diu]$/);if(!n)return(0,s.sprintf)(e.replace(/\.\d*/,``),t);let r=n[1]||``,i=n[2]?parseInt(n[2],10):0,a=n[3]===void 0?-1:n[4]?parseInt(n[4],10):0,o=t<0,c=String(Math.abs(t));a>=0&&(c=c.padStart(a,`0`));let l=``;o?l=`-`:r.includes(`+`)?l=`+`:r.includes(` `)&&(l=` `);let u=l+c;return i>u.length&&(u=r.includes(`-`)?u.padEnd(i,` `):r.includes(`0`)&&a<0?l+c.padStart(i-l.length,`0`):u.padStart(i,` `)),u}function T(e,t){let n=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?o$/);if(!n)return(0,s.sprintf)(e,t);let r=n[1]||``,i=n[2]?parseInt(n[2],10):0,a=n[3]===void 0?-1:n[4]?parseInt(n[4],10):0,o=Math.abs(t).toString(8);a>=0&&(o=o.padStart(a,`0`)),r.includes(`#`)&&!o.startsWith(`0`)&&(o=`0${o}`);let c=o;return i>c.length&&(c=r.includes(`-`)?c.padEnd(i,` `):r.includes(`0`)&&a<0?c.padStart(i,`0`):c.padStart(i,` `)),c}function E(e,t){let n=e.includes(`X`),r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[xX]$/);if(!r)return(0,s.sprintf)(e,t);let i=r[1]||``,a=r[2]?parseInt(r[2],10):0,o=r[3]===void 0?-1:r[4]?parseInt(r[4],10):0,c=Math.abs(t).toString(16);n&&(c=c.toUpperCase()),o>=0&&(c=c.padStart(o,`0`));let l=``;i.includes(`#`)&&t!==0&&(l=n?`0X`:`0x`);let u=l+c;return a>u.length&&(u=i.includes(`-`)?u.padEnd(a,` `):i.includes(`0`)&&o<0?l+c.padStart(a-l.length,`0`):u.padStart(a,` `)),u}function D(e){if(e===``)return`''`;if(/^[a-zA-Z0-9_./-]+$/.test(e))return e;if(/[\x00-\x1f\x7f-\xff]/.test(e)){let t=`$'`;for(let n of e){let e=n.charCodeAt(0);n===`'`?t+=`\\'`:n===`\\`?t+=`\\\\`:n===`
|
|
13
13
|
`?t+=`\\n`:n===` `?t+=`\\t`:n===`\r`?t+=`\\r`:n===`\x07`?t+=`\\a`:n===`\b`?t+=`\\b`:n===`\f`?t+=`\\f`:n===`\v`?t+=`\\v`:n===`\x1B`?t+=`\\E`:e<32||e>=127&&e<=255?t+=`\\${e.toString(8).padStart(3,`0`)}`:n===`"`?t+=`\\"`:t+=n}return t+=`'`,t}let t=``;for(let n of e)` |&;<>()$\`\\"'*?[#~=%!{}`.includes(n)?t+=`\\${n}`:t+=n;return t}function O(e,t){let n=e.match(/^%(-?)(\d*)(\.(\d*))?s$/);if(!n)return(0,s.sprintf)(e.replace(/0+(?=\d)/,``),t);let r=n[1]===`-`,i=n[2]?parseInt(n[2],10):0,o=n[3]===void 0?-1:n[4]?parseInt(n[4],10):0;return a(t,r?-i:i,o)}function k(e,t){let n=D(t),r=e.match(/^%(-?)(\d*)q$/);if(!r)return n;let i=r[1]===`-`,a=r[2]?parseInt(r[2],10):0,o=n;return a>o.length&&(o=i?o.padEnd(a,` `):o.padStart(a,` `)),o}function A(e,t,n){let r=e.match(/^%([- +#0']*)(\d*)(\.(\d*))?[eEfFgG]$/);if(!r)return(0,s.sprintf)(e,n);let i=r[1]||``,a=r[2]?parseInt(r[2],10):0,o=r[3]===void 0?6:r[4]?parseInt(r[4],10):0,c,l=t.toLowerCase();if(l===`e`?(c=n.toExponential(o),c=c.replace(/e([+-])(\d)$/,`e$10$2`),t===`E`&&(c=c.toUpperCase())):l===`f`?(c=n.toFixed(o),i.includes(`#`)&&o===0&&!c.includes(`.`)&&(c+=`.`)):l===`g`?(c=n.toPrecision(o||1),i.includes(`#`)||(c=c.replace(/\.?0+$/,``),c=c.replace(/\.?0+e/,`e`)),c=c.replace(/e([+-])(\d)$/,`e$10$2`),t===`G`&&(c=c.toUpperCase())):c=n.toString(),n>=0&&(i.includes(`+`)?c=`+${c}`:i.includes(` `)&&(c=` ${c}`)),a>c.length)if(i.includes(`-`))c=c.padEnd(a,` `);else if(i.includes(`0`)){let e=c.match(/^[+ -]/)?.[0]||``;c=e+(e?c.slice(1):c).padStart(a-e.length,`0`)}else c=c.padStart(a,` `);return c}function j(e){let t=``,n=0;for(;n<e.length;)if(e[n]===`\\`&&n+1<e.length)switch(e[n+1]){case`n`:t+=`
|
|
14
14
|
`,n+=2;break;case`t`:t+=` `,n+=2;break;case`r`:t+=`\r`,n+=2;break;case`\\`:t+=`\\`,n+=2;break;case`a`:t+=`\x07`,n+=2;break;case`b`:t+=`\b`,n+=2;break;case`f`:t+=`\f`,n+=2;break;case`v`:t+=`\v`,n+=2;break;case`c`:return{value:t,stopped:!0};case`x`:{let r=[],i=n;for(;i+1<e.length&&e[i]===`\\`&&e[i+1]===`x`;){let t=``,n=i+2;for(;n<e.length&&n<i+4&&/[0-9a-fA-F]/.test(e[n]);)t+=e[n],n++;if(t)r.push(parseInt(t,16)),i=n;else break}r.length>0?(t+=_(r),n=i):(t+=`\\x`,n+=2);break}case`u`:{let r=``,i=n+2;for(;i<e.length&&i<n+6&&/[0-9a-fA-F]/.test(e[i]);)r+=e[i],i++;r?(t+=String.fromCodePoint(parseInt(r,16)),n=i):(t+=`\\u`,n+=2);break}case`0`:{let r=``,i=n+2;for(;i<e.length&&i<n+5&&/[0-7]/.test(e[i]);)r+=e[i],i++;r?t+=String.fromCharCode(parseInt(r,8)):t+=`\0`,n=i;break}case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:{let r=``,i=n+1;for(;i<e.length&&i<n+4&&/[0-7]/.test(e[i]);)r+=e[i],i++;t+=String.fromCharCode(parseInt(r,8)),n=i;break}default:t+=e[n],n++}else t+=e[n],n++;return{value:t,stopped:!1}}var M={name:`printf`,flags:[{flag:`-v`,type:`value`,valueHint:`string`}],stdinType:`none`,needsArgs:!0};export{M as n,y as t};
|
|
15
|
-
//# sourceMappingURL=chunk-T56QNPHK-
|
|
15
|
+
//# sourceMappingURL=chunk-T56QNPHK-DPXaSSfC.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{n as e}from"./libesm-
|
|
1
|
+
import{n as e}from"./libesm-Cfo1LhlX.mjs";import{r as t,t as n}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as r}from"./chunk-HWKDQ44K-wgmyck2O.mjs";var i={name:`diff`,summary:`compare files line by line`,usage:`diff [OPTION]... FILE1 FILE2`,options:[`-u, --unified output unified diff format (default)`,`-q, --brief report only whether files differ`,`-s, --report-identical-files report when files are the same`,`-i, --ignore-case ignore case differences`,` --help display this help and exit`]},a={unified:{short:`u`,long:`unified`,type:`boolean`},brief:{short:`q`,long:`brief`,type:`boolean`},reportSame:{short:`s`,long:`report-identical-files`,type:`boolean`},ignoreCase:{short:`i`,long:`ignore-case`,type:`boolean`}},o={name:`diff`,async execute(o,s){if(n(o))return t(i);let c=r(`diff`,o,a);if(!c.ok)return c.error;let l=c.result.flags.brief,u=c.result.flags.reportSame,d=c.result.flags.ignoreCase,f=c.result.positional;if(c.result.flags.unified,f.length<2)return{stdout:``,stderr:`diff: missing operand
|
|
2
2
|
`,exitCode:2};let p,m,[h,g]=f;try{p=h===`-`?s.stdin:await s.fs.readFile(s.fs.resolvePath(s.cwd,h))}catch{return{stdout:``,stderr:`diff: ${h}: No such file or directory
|
|
3
3
|
`,exitCode:2}}try{m=g===`-`?s.stdin:await s.fs.readFile(s.fs.resolvePath(s.cwd,g))}catch{return{stdout:``,stderr:`diff: ${g}: No such file or directory
|
|
4
4
|
`,exitCode:2}}let _=p,v=m;return d&&(_=_.toLowerCase(),v=v.toLowerCase()),_===v?u?{stdout:`Files ${h} and ${g} are identical
|
|
5
5
|
`,stderr:``,exitCode:0}:{stdout:``,stderr:``,exitCode:0}:l?{stdout:`Files ${h} and ${g} differ
|
|
6
6
|
`,stderr:``,exitCode:1}:{stdout:e(h,g,p,m,``,``,{context:3}),stderr:``,exitCode:1}}},s={name:`diff`,flags:[{flag:`-u`,type:`boolean`},{flag:`-q`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-i`,type:`boolean`}],needsArgs:!0,minArgs:2};export{s as n,o as t};
|
|
7
|
-
//# sourceMappingURL=chunk-TLSUDHID-
|
|
7
|
+
//# sourceMappingURL=chunk-TLSUDHID-Ckw-B5Ug.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{t as e}from"./chunk-IPJHKYVM-
|
|
1
|
+
import{t as e}from"./chunk-IPJHKYVM-C3IodQq7.mjs";import{n as t,r as n,t as r}from"./chunk-74CEPOFO-BcZUJMO1.mjs";var i={name:`xargs`,summary:`build and execute command lines from standard input`,usage:`xargs [OPTION]... [COMMAND [INITIAL-ARGS]]`,options:[`-I REPLACE replace occurrences of REPLACE with input`,`-d DELIM use DELIM as input delimiter (e.g., -d '\\n' for newline)`,`-n NUM use at most NUM arguments per command line`,`-P NUM run at most NUM processes at a time`,`-0, --null items are separated by null, not whitespace`,`-t, --verbose print commands before executing`,`-r, --no-run-if-empty do not run command if input is empty`,` --help display this help and exit`]},a={name:`xargs`,async execute(a,o){if(r(a))return n(i);let s=null,c=null,l=null,u=null,d=!1,f=!1,p=0;for(let e=0;e<a.length;e++){let n=a[e];if(n===`-I`&&e+1<a.length)s=a[++e],p=e+1;else if(n===`-d`&&e+1<a.length)c=a[++e].replace(/\\n/g,`
|
|
2
2
|
`).replace(/\\t/g,` `).replace(/\\r/g,`\r`).replace(/\\0/g,`\0`).replace(/\\\\/g,`\\`),p=e+1;else if(n===`-n`&&e+1<a.length)l=parseInt(a[++e],10),p=e+1;else if(n===`-P`&&e+1<a.length)u=parseInt(a[++e],10),p=e+1;else if(n===`-0`||n===`--null`)d=!0,p=e+1;else if(n===`-t`||n===`--verbose`)f=!0,p=e+1;else if(n===`-r`||n===`--no-run-if-empty`)p=e+1;else{if(n.startsWith(`--`))return t(`xargs`,n);if(n.startsWith(`-`)&&n.length>1){for(let e of n.slice(1))if(!`0tr`.includes(e))return t(`xargs`,`-${e}`);n.includes(`0`)&&(d=!0),n.includes(`t`)&&(f=!0),n.includes(`r`),p=e+1}else if(!n.startsWith(`-`)){p=e;break}}}let m=a.slice(p);m.length===0&&m.push(`echo`);let h;if(h=d?o.stdin.split(`\0`).filter(e=>e.length>0):c===null?o.stdin.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0):o.stdin.replace(/\n$/,``).split(c).filter(e=>e.length>0),h.length===0)return{stdout:``,stderr:``,exitCode:0};let g=``,_=``,v=0,y=e=>/[\s"'\\$`!*?[\]{}();&|<>#]/.test(e)?`"${e.replace(/([\\"`$])/g,`\\$1`)}"`:e,b=async t=>{if(f){let e=t.map(y).join(` `);_+=`${e}
|
|
3
3
|
`}return o.exec?o.exec(e([t[0]]),{cwd:o.cwd,signal:o.signal,args:t.slice(1)}):{stdout:`${t.map(y).join(` `)}
|
|
4
4
|
`,stderr:``,exitCode:0}},x=async e=>{if(u!==null&&u>1)for(let t=0;t<e.length;t+=u){let n=e.slice(t,t+u),r=await Promise.all(n.map(b));for(let e of r)g+=e.stdout,_+=e.stderr,e.exitCode!==0&&(v=e.exitCode)}else for(let t of e){let e=await b(t);g+=e.stdout,_+=e.stderr,e.exitCode!==0&&(v=e.exitCode)}};if(s!==null)await x(h.map(e=>m.map(t=>t.replaceAll(s,e))));else if(l!==null){let e=[];for(let t=0;t<h.length;t+=l){let n=h.slice(t,t+l);e.push([...m,...n])}await x(e)}else{let e=await b([...m,...h]);g+=e.stdout,_+=e.stderr,v=e.exitCode}return{stdout:g,stderr:_,exitCode:v}}},o={name:`xargs`,flags:[{flag:`-I`,type:`value`,valueHint:`string`},{flag:`-d`,type:`value`,valueHint:`delimiter`},{flag:`-n`,type:`value`,valueHint:`number`},{flag:`-0`,type:`boolean`},{flag:`-t`,type:`boolean`},{flag:`-r`,type:`boolean`}],stdinType:`text`};export{a as n,o as t};
|
|
5
|
-
//# sourceMappingURL=chunk-TOMNU26N-
|
|
5
|
+
//# sourceMappingURL=chunk-TOMNU26N-AAglMy4J.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r as e,t}from"./chunk-74CEPOFO-
|
|
1
|
+
import{r as e,t}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{t as n}from"./chunk-HWKDQ44K-wgmyck2O.mjs";import{n as r}from"./chunk-7L36YK2X-D7Z_Qw_C.mjs";var i={name:`cat`,summary:`concatenate files and print on the standard output`,usage:`cat [OPTION]... [FILE]...`,options:[`-n, --number number all output lines`,` --help display this help and exit`]},a={number:{short:`n`,long:`number`,type:`boolean`}},o={name:`cat`,async execute(o,c){if(t(o))return e(i);let l=n(`cat`,o,a);if(!l.ok)return l.error;let u=l.result.flags.number,d=l.result.positional,f=await r(c,d,{cmdName:`cat`,allowStdinMarker:!0,stopOnError:!1}),p=``,m=1;for(let{content:e}of f.files)if(u){let t=s(e,m);p+=t.content,m=t.nextLineNumber}else p+=e;let h=d.length>0&&d.some(e=>e!==`-`);return{stdout:p,stderr:f.stderr,exitCode:f.exitCode,...h?{stdoutEncoding:`binary`}:{}}}};function s(e,t){let n=e.split(`
|
|
2
2
|
`),r=e.endsWith(`
|
|
3
3
|
`),i=r?n.slice(0,-1):n;return{content:i.map((e,n)=>`${String(t+n).padStart(6,` `)} ${e}`).join(`
|
|
4
4
|
`)+(r?`
|
|
5
5
|
`:``),nextLineNumber:t+i.length}}var c={name:`cat`,flags:[{flag:`-n`,type:`boolean`},{flag:`-A`,type:`boolean`},{flag:`-b`,type:`boolean`},{flag:`-s`,type:`boolean`},{flag:`-v`,type:`boolean`},{flag:`-e`,type:`boolean`},{flag:`-t`,type:`boolean`}],stdinType:`text`,needsFiles:!0};export{c as n,o as t};
|
|
6
|
-
//# sourceMappingURL=chunk-TXBZCHCQ-
|
|
6
|
+
//# sourceMappingURL=chunk-TXBZCHCQ-WeVWfqYv.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./chunk-YNYSPYQ5-
|
|
1
|
+
import{t as e}from"./chunk-YNYSPYQ5-DesxOVHh.mjs";import{a as t,i as n,n as r,o as i}from"./chunk-DXB73IDG-DIKSLkPq.mjs";import{r as a,t as o}from"./chunk-74CEPOFO-BcZUJMO1.mjs";import{n as s}from"./chunk-7L36YK2X-D7Z_Qw_C.mjs";import{t as c}from"./chunk-SYMJJMQ4-DOZMaECk.mjs";import{n as l,s as u}from"./chunk-7TSDKFEO-DUQhJkDy.mjs";import{n as d}from"./chunk-BBXLRYSX-K758HlCs.mjs";import{a as f,c as p,i as m,n as h,o as g,r as _,s as v,t as y}from"./chunk-F55TLFGB-Vy5RU2P3.mjs";var b,x=r(()=>{b=class{input;pos=0;tokens=[];constructor(e){this.input=e}tokenize(){for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let e=this.nextToken();e&&this.tokens.push(e)}return this.tokens.push({type:`eof`,value:``,pos:this.pos}),this.tokens}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.input[this.pos];if(e===` `||e===` `||e===`
|
|
2
2
|
`||e===`\r`)this.pos++;else if(e===`#`)for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
3
3
|
`;)this.pos++;else break}}nextToken(){let e=this.pos,t=this.input[this.pos];if(t>=`0`&&t<=`9`)return this.readNumber();if(t===`"`||t===`'`||t==="`")return this.readString(t);if(t===`b`&&this.pos+1<this.input.length){let e=this.input[this.pos+1];if(e===`"`||e===`'`||e==="`")return this.pos++,this.readString(e)}if(t===`/`){let t=this.tokens[this.tokens.length-1];return t&&(t.type===`int`||t.type===`float`||t.type===`string`||t.type===`ident`||t.type===`)`||t.type===`]`)?this.input[this.pos+1]===`/`?(this.pos+=2,{type:`//`,value:`//`,pos:e}):(this.pos++,{type:`/`,value:`/`,pos:e}):this.readRegex()}if(this.match(`not in`))return{type:`not in`,value:`not in`,pos:e};if(this.match(`=>`))return{type:`=>`,value:`=>`,pos:e};if(this.match(`**`))return{type:`**`,value:`**`,pos:e};if(this.match(`++`))return{type:`++`,value:`++`,pos:e};if(this.match(`//`))return{type:`//`,value:`//`,pos:e};if(this.match(`==`))return{type:`==`,value:`==`,pos:e};if(this.match(`!=`))return{type:`!=`,value:`!=`,pos:e};if(this.match(`<=`))return{type:`<=`,value:`<=`,pos:e};if(this.match(`>=`))return{type:`>=`,value:`>=`,pos:e};if(this.match(`&&`))return{type:`&&`,value:`&&`,pos:e};if(this.match(`||`))return{type:`||`,value:`||`,pos:e};let n=new Map([[`(`,`(`],[`)`,`)`],[`[`,`[`],[`]`,`]`],[`{`,`{`],[`}`,`}`],[`,`,`,`],[`:`,`:`],[`;`,`;`],[`+`,`+`],[`-`,`-`],[`*`,`*`],[`%`,`%`],[`<`,`<`],[`>`,`>`],[`!`,`!`],[`.`,`.`],[`|`,`|`],[`=`,`=`]]).get(t);if(n!==void 0)return this.pos++,{type:n,value:t,pos:e};if(this.isIdentStart(t))return this.readIdentifier();throw Error(`Unexpected character '${t}' at position ${this.pos}`)}match(e){if(this.input.slice(this.pos,this.pos+e.length)===e){if(/^[a-zA-Z]/.test(e)){let t=this.input[this.pos+e.length];if(t&&this.isIdentChar(t))return!1}return this.pos+=e.length,!0}return!1}isIdentStart(e){return e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`_`}isIdentChar(e){return this.isIdentStart(e)||e>=`0`&&e<=`9`}readNumber(){let e=this.pos,t=!1,n=!1;for(;this.pos<this.input.length;){let e=this.input[this.pos];if(e>=`0`&&e<=`9`)this.pos++;else if(e===`_`)this.pos++;else if(e===`.`&&!t&&!n)t=!0,this.pos++;else if((e===`e`||e===`E`)&&!n)n=!0,t=!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(e,this.pos).replace(/_/g,``);return{type:t?`float`:`int`,value:r,pos:e}}readString(e){let t=this.pos;this.pos++;let n=``;for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===e)return this.pos++,{type:`string`,value:n,pos:t};if(r===`\\`){if(this.pos++,this.pos<this.input.length){let e=this.input[this.pos];switch(e){case`n`:n+=`
|
|
4
4
|
`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;case`\\`:n+=`\\`;break;case`"`:n+=`"`;break;case`'`:n+=`'`;break;case"`":n+="`";break;case`0`:n+=`\0`;break;default:n+=e}this.pos++}}else n+=r,this.pos++}throw Error(`Unterminated string starting at position ${t}`)}readRegex(){let e=this.pos;this.pos++;let t=``,n=``;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`;)n+=this.input[this.pos],this.pos++;return{type:`regex`,value:t+(n?`/${n}`:``),pos:e}}r===`\\`?(t+=r,this.pos++,this.pos<this.input.length&&(t+=this.input[this.pos],this.pos++)):(t+=r,this.pos++)}throw Error(`Unterminated regex starting at position ${e}`)}readIdentifier(){let e=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let t=!1;this.pos<this.input.length&&this.input[this.pos]===`?`&&(t=!0,this.pos++);let n=this.input.slice(e,t?this.pos-1:this.pos);t&&(n+=`?`);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`],[`_`,`_`]]),i=n.replace(/\?$/,``),a=r.get(i);return a!==void 0&&!t?{type:a,value:i,pos:e}:{type:`ident`,value:n,pos:e}}}}),S={};n(S,{parseMoonblade:()=>w,parseNamedExpressions:()=>C});function C(e){let t=[],n=new b(e).tokenize(),r=0,i=()=>n[r]||{type:`eof`,value:``,pos:0},a=()=>n[r++];for(;i().type!==`eof`;){if(i().type===`,`&&t.length>0){a();continue}let o=[],s=0,c=r;for(;i().type!==`eof`;){let e=i();if((e.type===`,`||e.type===`as`)&&s===0)break;(e.type===`(`||e.type===`[`||e.type===`{`)&&s++,(e.type===`)`||e.type===`]`||e.type===`}`)&&s--,o.push(a())}o.push({type:`eof`,value:``,pos:0});let l=new E(o).parse(),u;if(i().type===`as`)if(a(),i().type===`(`){a();let e=[];for(;i().type!==`)`&&i().type!==`eof`;)(i().type===`ident`||i().type===`string`)&&(e.push(i().value),a()),i().type===`,`&&a();i().type===`)`&&a(),u=e}else if(i().type===`ident`||i().type===`string`)u=i().value,a();else throw Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(n[c].pos,n[r-1]?.pos||e.length).trim(),l.type===`identifier`&&(u=l.name);t.push({expr:l,name:u})}return t}function w(e){let t=new b(e).tokenize();return new E(t).parse()}var T,E,D=r(()=>{x(),T={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},E=class{pos=0;tokens;constructor(e){this.tokens=e}parse(){let e=this.parseExpr(0);if(this.peek().type!==`eof`)throw Error(`Unexpected token: ${this.peek().value}`);return e}parseExpr(e){let t=this.parsePrefix();for(;;){let n=this.peek(),r=this.getInfixPrec(n.type);if(r<e)break;t=this.parseInfix(t,r)}return t}parsePrefix(){let e=this.peek();switch(e.type){case`int`:return this.advance(),{type:`int`,value:Number.parseInt(e.value,10)};case`float`:return this.advance(),{type:`float`,value:Number.parseFloat(e.value)};case`string`:return this.advance(),{type:`string`,value:e.value};case`regex`:{this.advance();let t=e.value.split(`/`),n=t.length>1?t[t.length-1]:``;return{type:`regex`,pattern:t.slice(0,-1).join(`/`)||e.value,caseInsensitive:n.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 t=e.value,n=t.endsWith(`?`),r=n?t.slice(0,-1):t;if(this.advance(),this.peek().type===`(`)return this.parseFunctionCall(r);if(this.peek().type===`=>`){this.advance();let e=this.parseExpr(0);return this.bindLambdaArgs({type:`lambda`,params:[r],body:e},[r])}return{type:`identifier`,name:r,unsure:n}}case`(`:{this.advance();let e=[];if(this.peek().type===`)`){if(this.advance(),this.peek().type===`=>`)return this.advance(),{type:`lambda`,params:[],body:this.parseExpr(0)};throw Error(`Empty parentheses not allowed`)}if(this.peek().type===`ident`){let t=this.peek().value;if(this.advance(),this.peek().type===`,`||this.peek().type===`)`){for(e.push(t);this.peek().type===`,`&&(this.advance(),this.peek().type===`ident`);)e.push(this.peek().value),this.advance();if(this.peek().type===`)`&&(this.advance(),this.peek().type===`=>`)){this.advance();let t=this.parseExpr(0);return this.bindLambdaArgs({type:`lambda`,params:e,body:t},e)}this.pos-=e.length*2,e.length>1&&(this.pos=this.pos)}this.pos--}let t=this.parseExpr(0);return this.expect(`)`),this.peek().type,t}case`[`:return this.parseList();case`{`:return this.parseMap();case`-`:{this.advance();let e=this.parseExpr(T.UNARY);return e.type===`int`?{type:`int`,value:-e.value}:e.type===`float`?{type:`float`,value:-e.value}:{type:`func`,name:`neg`,args:[{expr:e}]}}case`!`:return this.advance(),{type:`func`,name:`not`,args:[{expr:this.parseExpr(T.UNARY)}]};default:throw Error(`Unexpected token: ${e.type} (${e.value})`)}}parseFunctionCall(e){this.expect(`(`);let t=[];if(this.peek().type!==`)`)do{t.length>0&&this.peek().type===`,`&&this.advance();let e;if(this.peek().type===`ident`){let t=this.peek().value,n=this.pos+1;n<this.tokens.length&&this.tokens[n].type===`=`&&(e=t,this.advance(),this.advance())}let n=this.parseExpr(0);t.push({name:e,expr:n})}while(this.peek().type===`,`);return this.expect(`)`),{type:`func`,name:e.toLowerCase(),args:t}}parseList(){this.expect(`[`);let e=[];if(this.peek().type!==`]`)do e.length>0&&this.peek().type===`,`&&this.advance(),e.push(this.parseExpr(0));while(this.peek().type===`,`);return this.expect(`]`),{type:`list`,elements:e}}parseMap(){this.expect(`{`);let e=[];if(this.peek().type!==`}`)do{e.length>0&&this.peek().type===`,`&&this.advance();let t;if(this.peek().type===`ident`)t=this.peek().value,this.advance();else if(this.peek().type===`string`)t=this.peek().value,this.advance();else throw Error(`Expected map key, got ${this.peek().type}`);this.expect(`:`);let n=this.parseExpr(0);e.push({key:t,value:n})}while(this.peek().type===`,`);return this.expect(`}`),{type:`map`,entries:e}}parseInfix(e,t){let n=this.peek(),r=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(n.type);if(r!==void 0){this.advance();let i=this.parseExpr(t+(this.isRightAssoc(n.type)?0:1));return{type:`func`,name:r,args:[{expr:e},{expr:i}]}}if(n.type===`|`){this.advance();let n=this.parseExpr(t);return this.handlePipe(e,n)}if(n.type===`.`)return this.advance(),this.handleDot(e);if(n.type===`[`)return this.advance(),this.handleIndexing(e);if(n.type===`in`)return this.advance(),{type:`func`,name:`contains`,args:[{expr:this.parseExpr(t+1)},{expr:e}]};if(n.type===`not in`)return this.advance(),{type:`func`,name:`not`,args:[{expr:{type:`func`,name:`contains`,args:[{expr:this.parseExpr(t+1)},{expr:e}]}}]};throw Error(`Unexpected infix token: ${n.type}`)}handlePipe(e,t){if(t.type===`identifier`)return{type:`func`,name:t.name,args:[{expr:e}]};if(t.type===`func`){let n=this.countUnderscores(t);return n===0?t:n===1?this.fillUnderscore(t,e):{type:`pipeline`,exprs:[e,t]}}return this.countUnderscores(t)===1?this.fillUnderscore(t,e):t}handleDot(e){let t=this.peek();if(t.type===`ident`){let n=t.value;if(this.advance(),this.peek().type===`(`){let t=this.parseFunctionCall(n);return t.type===`func`&&t.args.unshift({expr:e}),t}return{type:`func`,name:`get`,args:[{expr:e},{expr:{type:`string`,value:n}}]}}if(t.type===`int`){let n=Number.parseInt(t.value,10);return this.advance(),{type:`func`,name:`get`,args:[{expr:e},{expr:{type:`int`,value:n}}]}}if(t.type===`string`){let n=t.value;return this.advance(),{type:`func`,name:`get`,args:[{expr:e},{expr:{type:`string`,value:n}}]}}throw Error(`Expected identifier, number, or string after dot, got ${t.type}`)}handleIndexing(e){if(this.peek().type===`:`){if(this.advance(),this.peek().type===`]`)return this.advance(),{type:`func`,name:`slice`,args:[{expr:e}]};let t=this.parseExpr(0);return this.expect(`]`),{type:`func`,name:`slice`,args:[{expr:e},{expr:{type:`int`,value:0}},{expr:t}]}}let t=this.parseExpr(0);if(this.peek().type===`:`){if(this.advance(),this.peek().type===`]`)return this.advance(),{type:`func`,name:`slice`,args:[{expr:e},{expr:t}]};let n=this.parseExpr(0);return this.expect(`]`),{type:`func`,name:`slice`,args:[{expr:e},{expr:t},{expr:n}]}}return this.expect(`]`),{type:`func`,name:`get`,args:[{expr:e},{expr:t}]}}countUnderscores(e){return e.type===`underscore`?1:e.type===`func`?e.args.reduce((e,t)=>e+this.countUnderscores(t.expr),0):e.type===`list`?e.elements.reduce((e,t)=>e+this.countUnderscores(t),0):e.type===`map`?e.entries.reduce((e,t)=>e+this.countUnderscores(t.value),0):0}fillUnderscore(e,t){return e.type===`underscore`?t:e.type===`func`?{...e,args:e.args.map(e=>({...e,expr:this.fillUnderscore(e.expr,t)}))}:e.type===`list`?{...e,elements:e.elements.map(e=>this.fillUnderscore(e,t))}:e.type===`map`?{...e,entries:e.entries.map(e=>({...e,value:this.fillUnderscore(e.value,t)}))}:e}bindLambdaArgs(e,t){return{...e,body:this.bindLambdaArgsInExpr(e.body,t)}}bindLambdaArgsInExpr(e,t){return e.type===`identifier`&&t.includes(e.name)?{type:`lambdaBinding`,name:e.name}:e.type===`func`?{...e,args:e.args.map(e=>({...e,expr:this.bindLambdaArgsInExpr(e.expr,t)}))}:e.type===`list`?{...e,elements:e.elements.map(e=>this.bindLambdaArgsInExpr(e,t))}:e.type===`map`?{...e,entries:e.entries.map(e=>({...e,value:this.bindLambdaArgsInExpr(e.value,t)}))}:e}getInfixPrec(e){switch(e){case`|`:return T.PIPE;case`||`:case`or`:return T.OR;case`&&`:case`and`:return T.AND;case`==`:case`!=`:case`eq`:case`ne`:return T.EQUALITY;case`<`:case`<=`:case`>`:case`>=`:case`lt`:case`le`:case`gt`:case`ge`:case`in`:case`not in`:return T.COMPARISON;case`+`:case`-`:case`++`:return T.ADDITIVE;case`*`:case`/`:case`//`:case`%`:return T.MULTIPLICATIVE;case`**`:return T.POWER;case`.`:case`[`:return T.POSTFIX;default:return-1}}isRightAssoc(e){return e===`**`}peek(){return this.tokens[this.pos]||{type:`eof`,value:``,pos:0}}advance(){return this.tokens[this.pos++]}expect(e){let t=this.peek();if(t.type!==e)throw Error(`Expected ${e}, got ${t.type}`);return this.advance()}}});D();function O(e,t){return t.length===0?j(e,[]):t.length===1?{type:`Pipe`,left:t[0],right:j(e,[])}:{type:`Pipe`,left:t[0],right:j(e,t.slice(1))}}var k={add:e=>A(`+`,e[0],e[1]),sub:e=>A(`-`,e[0],e[1]),mul:e=>A(`*`,e[0],e[1]),div:e=>A(`/`,e[0],e[1]),mod:e=>A(`%`,e[0],e[1]),idiv:e=>j(`floor`,[A(`/`,e[0],e[1])]),pow:e=>O(`pow`,e),neg:e=>({type:`UnaryOp`,op:`-`,operand:e[0]}),"==":e=>A(`==`,e[0],e[1]),"!=":e=>A(`!=`,e[0],e[1]),"<":e=>A(`<`,e[0],e[1]),"<=":e=>A(`<=`,e[0],e[1]),">":e=>A(`>`,e[0],e[1]),">=":e=>A(`>=`,e[0],e[1]),eq:e=>A(`==`,P(e[0]),P(e[1])),ne:e=>A(`!=`,P(e[0]),P(e[1])),lt:e=>A(`<`,P(e[0]),P(e[1])),le:e=>A(`<=`,P(e[0]),P(e[1])),gt:e=>A(`>`,P(e[0]),P(e[1])),ge:e=>A(`>=`,P(e[0]),P(e[1])),and:e=>A(`and`,e[0],e[1]),or:e=>A(`or`,e[0],e[1]),not:e=>({type:`UnaryOp`,op:`not`,operand:e[0]}),len:e=>O(`length`,e),length:e=>O(`length`,e),upper:e=>O(`ascii_upcase`,e),lower:e=>O(`ascii_downcase`,e),trim:e=>O(`trim`,e),ltrim:e=>e.length===0?j(`ltrimstr`,[{type:`Literal`,value:` `}]):{type:`Pipe`,left:e[0],right:j(`ltrimstr`,[{type:`Literal`,value:` `}])},rtrim:e=>e.length===0?j(`rtrimstr`,[{type:`Literal`,value:` `}]):{type:`Pipe`,left:e[0],right:j(`rtrimstr`,[{type:`Literal`,value:` `}])},split:e=>O(`split`,e),join:e=>e.length===1?j(`join`,[{type:`Literal`,value:``}]):O(`join`,e),concat:e=>A(`+`,e[0],e[1]),startswith:e=>O(`startswith`,e),endswith:e=>O(`endswith`,e),contains:e=>O(`contains`,e),replace:e=>O(`gsub`,e),substr:e=>e.length===2?{type:`Slice`,base:e[0],start:e[1]}:{type:`Slice`,base:e[0],start:e[1],end:A(`+`,e[1],e[2])},abs:e=>O(`fabs`,e),floor:e=>O(`floor`,e),ceil:e=>O(`ceil`,e),round:e=>O(`round`,e),sqrt:e=>O(`sqrt`,e),log:e=>O(`log`,e),log10:e=>O(`log10`,e),log2:e=>O(`log2`,e),exp:e=>O(`exp`,e),sin:e=>O(`sin`,e),cos:e=>O(`cos`,e),tan:e=>O(`tan`,e),asin:e=>O(`asin`,e),acos:e=>O(`acos`,e),atan:e=>O(`atan`,e),min:e=>O(`min`,e),max:e=>O(`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=>j(`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=>j(`select`,e),empty:()=>j(`empty`,[]),count:()=>j(`length`,[]),sum:e=>e.length===0?j(`add`,[]):{type:`Pipe`,left:{type:`Array`,elements:e[0]},right:j(`add`,[])},mean:e=>e.length===0?{type:`Pipe`,left:{type:`Identity`},right:A(`/`,j(`add`,[]),j(`length`,[]))}:{type:`Pipe`,left:{type:`Array`,elements:e[0]},right:A(`/`,j(`add`,[]),j(`length`,[]))},avg:e=>e.length===0?{type:`Pipe`,left:{type:`Identity`},right:A(`/`,j(`add`,[]),j(`length`,[]))}:{type:`Pipe`,left:{type:`Array`,elements:e[0]},right:A(`/`,j(`add`,[]),j(`length`,[]))},type:`type`,isnull:e=>e.length===0?A(`==`,{type:`Identity`},{type:`Literal`,value:null}):A(`==`,e[0],{type:`Literal`,value:null}),isempty:e=>e.length===0?A(`==`,{type:`Identity`},{type:`Literal`,value:``}):A(`==`,e[0],{type:`Literal`,value:``}),tonumber:e=>e.length===0?j(`tonumber`,[]):j(`tonumber`,e),tostring:e=>e.length===0?j(`tostring`,[]):j(`tostring`,e),if:e=>N(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,...n]=e;return N(A(`and`,A(`!=`,t,{type:`Literal`,value:null}),A(`!=`,t,{type:`Literal`,value:``})),t,n.length===1?n[0]:k.coalesce(n))},index:()=>({type:`Field`,name:`_row_index`}),now:()=>j(`now`,[]),fmt:e=>j(`tostring`,e),format:e=>j(`tostring`,e)};Object.setPrototypeOf(k,null);function A(e,t,n){return{type:`BinaryOp`,op:e,left:t,right:n}}function j(e,t){return{type:`Call`,name:e,args:t}}var M=`then`;function N(e,t,n){let r=u({type:`Cond`,cond:e,elifs:[],else:n||{type:`Literal`,value:null}});return r[M]=t,r}function P(e){return{type:`Pipe`,left:e,right:{type:`Call`,name:`tostring`,args:[]}}}function F(e,t=!0){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`:{let n=e.args.map(e=>F(e.expr,t)),r=Object.hasOwn(k,e.name)?k[e.name]:void 0;return typeof r==`function`?r(n):j(typeof r==`string`?r:e.name,n)}case`list`:return e.elements.length===0?{type:`Array`}:{type:`Array`,elements:e.elements.reduce((e,n,r)=>{let i=F(n,t);return r===0?i:{type:`Comma`,left:e,right:i}},null)};case`map`:return{type:`Object`,entries:e.entries.map(e=>({key:e.key,value:F(e.value,t)}))};case`regex`:return{type:`Literal`,value:e.pattern};case`slice`:return{type:`Slice`,start:e.start?F(e.start,t):void 0,end:e.end?F(e.end,t):void 0};case`lambda`:return F(e.body,t);case`pipeline`:return{type:`Identity`};default:throw Error(`Unknown moonblade expression type: ${e.type}`)}}function I(e){let t=[],n=0;for(;n<e.length;){for(;n<e.length&&(e[n]===` `||e[n]===`,`);)n++;if(n>=e.length)break;let r=n;for(;n<e.length&&/\w/.test(e[n]);)n++;let i=e.slice(r,n);for(;n<e.length&&e[n]===` `;)n++;if(e[n]!==`(`)break;n++;let a=1,o=n;for(;n<e.length&&a>0;)e[n]===`(`?a++:e[n]===`)`&&a--,a>0&&n++;let s=e.slice(o,n).trim();for(n++;n<e.length&&e[n]===` `;)n++;let c=``;if(e.slice(n,n+3).toLowerCase()===`as `){for(n+=3;n<e.length&&e[n]===` `;)n++;let t=n;for(;n<e.length&&/\w/.test(e[n]);)n++;c=e.slice(t,n)}c||=s?`${i}(${s})`:`${i}()`,t.push({func:i,expr:s,alias:c})}return t}function L(e){return/^\w+$/.test(e)}function R(e,t,n){let r=d(e,F(w(t)),n);return r.length>0?r[0]:null}function z(e,t,n={}){let{func:r,expr:i}=t;if(r===`count`&&!i)return e.length;let a;switch(a=L(i)?e.map(e=>e[i]).filter(e=>e!=null):e.map(e=>R(e,i,n)).filter(e=>e!=null),r){case`count`:return L(i)?a.length:a.filter(e=>!!e).length;case`sum`:return a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e))).reduce((e,t)=>e+t,0);case`mean`:case`avg`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e)));return e.length>0?e.reduce((e,t)=>e+t,0)/e.length:0}case`min`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e)));return e.length>0?Math.min(...e):null}case`max`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e)));return e.length>0?Math.max(...e):null}case`first`:return a.length>0?a[0]:null;case`last`:return a.length>0?a[a.length-1]:null;case`median`:{let e=a.map(e=>typeof e==`number`?e:Number.parseFloat(String(e))).filter(e=>!Number.isNaN(e)).sort((e,t)=>e-t);if(e.length===0)return null;let t=Math.floor(e.length/2);return e.length%2==0?(e[t-1]+e[t])/2:e[t]}case`mode`:{let e=new Map;for(let t of a){let n=String(t);e.set(n,(e.get(n)||0)+1)}let t=0,n=null;for(let[r,i]of e)i>t&&(t=i,n=r);return n}case`cardinality`:return new Set(a.map(e=>String(e))).size;case`values`:return a.map(e=>String(e)).join(`|`);case`distinct_values`:return[...new Set(a.map(e=>String(e)))].sort().join(`|`);case`all`:if(e.length===0)return!0;for(let t of e)if(!R(t,i,n))return!1;return!0;case`any`:for(let t of e)if(R(t,i,n))return!0;return!1;default:return null}}function ee(e,t,n={}){let r=v();for(let i of t)_(r,i.alias,z(e,i,n));return r}async function te(e,t){let n=``,r=[];for(let t of e)t.startsWith(`-`)||(n?r.push(t):n=t);if(!n)return{stdout:``,stderr:`xan agg: no aggregation expression
|
|
@@ -58,7 +58,7 @@ import{t as e}from"./chunk-YNYSPYQ5-Dq-BWW-f.mjs";import{a as t,i as n,n as r,o
|
|
|
58
58
|
`,exitCode:1};o=a[0].headers}let c=[];for(let{headers:e,data:t}of a)for(let n of t){let t=v();for(let r of o)_(t,r,e.includes(r)?n[r]:``);c.push(t)}return{stdout:h(o,c),stderr:``,exitCode:0}}async function Me(t,n){let r=``,i=[],a=!1,o=!1,s=[];for(let e=0;e<t.length;e++){let n=t[e];(n===`-s`||n===`--select`)&&e+1<t.length?i=t[++e].split(`,`):n===`-v`||n===`--invert`?a=!0:n===`-i`||n===`--ignore-case`?o=!0:n===`-r`||n===`--regex`||n.startsWith(`-`)||(r?s.push(n):r=n)}if(!r)return{stdout:``,stderr:`xan search: no pattern specified
|
|
59
59
|
`,exitCode:1};let{headers:c,data:l,error:u}=await g(s,n);if(u)return u;let d=i.length>0?i:c,f;try{f=e(r,o?`i`:``)}catch{return{stdout:``,stderr:`xan search: invalid regex pattern '${r}'
|
|
60
60
|
`,exitCode:1}}return{stdout:h(c,l.filter(e=>{let t=d.some(t=>{let n=e[t];return n!=null&&f.test(String(n))});return a?!t:t})),stderr:``,exitCode:0}}async function Ne(e,t){let n=``,r=[];for(let t of e)t.startsWith(`-`)||(n?r.push(t):n=t);if(!n)return{stdout:``,stderr:`xan flatmap: no expression specified
|
|
61
|
-
`,exitCode:1};let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=C(n).map(({expr:e,name:t})=>({alias:typeof t==`string`?t:t[0],ast:F(e)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},l=[...i,...s.map(e=>e.alias)],u=[];for(let e of a){let t=[],n=1;for(let r of s){let i=d(e,r.ast,c),a=i.length>0&&Array.isArray(i[0])?i[0]:i;t.push(a),n=Math.max(n,a.length)}for(let r=0;r<n;r++){let n=y(e);for(let e=0;e<s.length;e++){let i=t[e][r]??null;_(n,s[e].alias,i)}u.push(n)}}return{stdout:h(l,u),stderr:``,exitCode:0}}async function Pe(e,t){let{cmdView:n}=await import(`./xan-view-ECQUO7AJ-
|
|
61
|
+
`,exitCode:1};let{headers:i,data:a,error:o}=await g(r,t);if(o)return o;let s=C(n).map(({expr:e,name:t})=>({alias:typeof t==`string`?t:t[0],ast:F(e)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations}:void 0},l=[...i,...s.map(e=>e.alias)],u=[];for(let e of a){let t=[],n=1;for(let r of s){let i=d(e,r.ast,c),a=i.length>0&&Array.isArray(i[0])?i[0]:i;t.push(a),n=Math.max(n,a.length)}for(let r=0;r<n;r++){let n=y(e);for(let e=0;e<s.length;e++){let i=t[e][r]??null;_(n,s[e].alias,i)}u.push(n)}}return{stdout:h(l,u),stderr:``,exitCode:0}}async function Pe(e,t){let{cmdView:n}=await import(`./xan-view-ECQUO7AJ-DWDC57b_.mjs`);return n(e,t)}var Q=new Set([`fuzzy-join`,`glob`,`hist`,`input`,`parallel`,`plot`,`progress`,`range`,`scrape`,`tokenize`,`union-find`]),Fe=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`,...Q]),$={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.
|
|
62
62
|
It provides a simple, ergonomic interface for common data operations.
|
|
63
63
|
|
|
64
64
|
COMMANDS:
|
|
@@ -137,4 +137,4 @@ EXAMPLES:
|
|
|
137
137
|
`,exitCode:1}:{stdout:``,stderr:`xan: unknown command '${n}'
|
|
138
138
|
Run 'xan --help' for usage.
|
|
139
139
|
`,exitCode:1}}}},Re={name:`xan`,flags:[],stdinType:`text`,needsArgs:!0};export{Le as n,Re as t};
|
|
140
|
-
//# sourceMappingURL=chunk-UNYNJIFU-
|
|
140
|
+
//# sourceMappingURL=chunk-UNYNJIFU-CqGlXAg7.mjs.map
|