@jerryan/just-bash 3.9.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -0
- package/README.md +2 -2
- package/dist/AGENTS.md +2 -2
- package/dist/abort-signals.d.ts +10 -0
- package/dist/bin/chunks/awk2-LCV2AUIX.js +3 -0
- package/dist/bin/{shell/chunks/base64-TQ5KOCNW.js → chunks/base64-OLYCF2PC.js} +1 -1
- package/dist/bin/chunks/builtin-manifest-ORBIZM7I.js +3 -0
- package/dist/bin/chunks/{cat-BQ7FQTN5.js → cat-UJLF2DU2.js} +1 -1
- package/dist/bin/{shell/chunks/chmod-GX5SYTRL.js → chunks/chmod-V5F4BXZ2.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-V4S4A7M6.js → chunks/chunk-2TEF4USR.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-GBKR5KTT.js → chunks/chunk-3ASHUC7C.js} +13 -13
- package/dist/bin/chunks/{chunk-N26Y42L6.js → chunk-3M5OMKFS.js} +1 -1
- package/dist/bin/chunks/chunk-4NYJ4ZTO.js +17 -0
- package/dist/bin/chunks/{chunk-M3Z5NZXT.js → chunk-572NXISH.js} +1 -1
- package/dist/bin/chunks/chunk-5NWK7A4R.js +13 -0
- package/dist/bin/{shell/chunks/chunk-YXPSX3SI.js → chunks/chunk-623Q77WZ.js} +1 -1
- package/dist/bin/chunks/chunk-6NG4ULJM.js +7 -0
- package/dist/bin/{shell/chunks/chunk-QFOXSCOD.js → chunks/chunk-726WDFMQ.js} +1 -1
- package/dist/bin/chunks/{chunk-DRPHNXG7.js → chunk-7LGT4LHQ.js} +1 -1
- package/dist/bin/chunks/{chunk-MBREBDZQ.js → chunk-AIWBN36Z.js} +1 -1
- package/dist/bin/chunks/{chunk-3ROYEBJI.js → chunk-AJ3CSZ34.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-VTAMGD42.js → chunks/chunk-APEQNYAO.js} +1 -1
- package/dist/bin/chunks/chunk-AQKIHX3Q.js +3 -0
- package/dist/bin/chunks/chunk-BFLKIASG.js +7 -0
- package/dist/bin/chunks/{chunk-IOKQFPM6.js → chunk-BRB5PJ3E.js} +1 -1
- package/dist/bin/chunks/{chunk-ZVG47PYA.js → chunk-BVBYPYA5.js} +1 -1
- package/dist/bin/chunks/{chunk-T6OIISUC.js → chunk-BZJ77YQD.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-GR4ZHKXI.js → chunks/chunk-C2BLJ3AE.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-KMYJMEON.js → chunks/chunk-C45GTJTD.js} +1 -1
- package/dist/bin/chunks/{chunk-GOWX7VPU.js → chunk-CTS7QXCJ.js} +1 -1
- package/dist/bin/chunks/{chunk-42AMF6EE.js → chunk-DTNGYQCJ.js} +1 -1
- package/dist/bin/chunks/{chunk-TW2IJRUF.js → chunk-ENEHPI32.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-E54Z6VIE.js → chunks/chunk-ERYPQAZE.js} +5 -5
- package/dist/bin/chunks/{chunk-PQ2INDRF.js → chunk-GB3KUAFV.js} +1 -1
- package/dist/bin/chunks/chunk-HFVQCXYX.js +10 -0
- package/dist/bin/chunks/chunk-HSWCKN2X.js +14 -0
- package/dist/bin/chunks/{chunk-B6WWC6K3.js → chunk-I6MS5ZWE.js} +1 -1
- package/dist/bin/chunks/{chunk-V4U26ZWL.js → chunk-IOFXLMNJ.js} +1 -1
- package/dist/bin/chunks/chunk-IX6QY5JW.js +5 -0
- package/dist/bin/chunks/{chunk-QKJAAJ7J.js → chunk-IXTPVJ6W.js} +1 -1
- package/dist/bin/chunks/{chunk-OUQKFRVR.js → chunk-JBYLHCKP.js} +1 -1
- package/dist/bin/chunks/{chunk-NXUXZWS5.js → chunk-JLRB7DV3.js} +1 -1
- package/dist/bin/chunks/{chunk-6JEDM6CZ.js → chunk-KH6YLKPE.js} +1 -1
- package/dist/bin/chunks/chunk-KXSDVBJA.js +12 -0
- package/dist/bin/chunks/{chunk-DYIBFLS3.js → chunk-LOU52GPJ.js} +2 -2
- package/dist/bin/chunks/{chunk-L345YZ6R.js → chunk-LVT5R45K.js} +1 -1
- package/dist/bin/chunks/{chunk-PTUQEN6I.js → chunk-M345X45Z.js} +7 -7
- package/dist/bin/chunks/{chunk-6FGMEZZP.js → chunk-NDS7PYKD.js} +1 -1
- package/dist/bin/chunks/chunk-O3PNT72D.js +3 -0
- package/dist/bin/chunks/chunk-OGOISDGZ.js +3 -0
- package/dist/bin/chunks/chunk-OSW4MDDH.js +21 -0
- package/dist/bin/{shell/chunks/chunk-ABP4OLJV.js → chunks/chunk-OXEDIWNZ.js} +1 -1
- package/dist/bin/chunks/{chunk-FPWHWWXO.js → chunk-OXV2B2YS.js} +1 -1
- package/dist/bin/chunks/{chunk-QMPZXXEK.js → chunk-OY25E3ZN.js} +1 -1
- package/dist/bin/chunks/{chunk-O2BCKSMK.js → chunk-PEJXCXSY.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-6KHZX4HU.js → chunks/chunk-PLLMJHMV.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-6TUILMPB.js → chunks/chunk-QELDDRV5.js} +1 -1
- package/dist/bin/chunks/{chunk-3FQBUEB6.js → chunk-RC4UXNHA.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-H7PD6FLC.js → chunks/chunk-RE7Z53A3.js} +1 -1
- package/dist/bin/chunks/chunk-SCQRBEQW.js +275 -0
- package/dist/bin/chunks/{chunk-3DWQCLNP.js → chunk-SS2OPV62.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-CC2AQ6B7.js → chunks/chunk-U6JTVQU6.js} +1 -1
- package/dist/bin/chunks/chunk-UBA7DOWE.js +3 -0
- package/dist/bin/chunks/{chunk-VPSBWWXM.js → chunk-UFAYH3WW.js} +7 -6
- package/dist/bin/chunks/chunk-UPUFWGHR.js +3 -0
- package/dist/bin/{shell/chunks/chunk-QJWFCA7P.js → chunks/chunk-UU42WPB7.js} +1 -1
- package/dist/bin/chunks/{chunk-CNVNOT67.js → chunk-UW4E5XU5.js} +1 -1
- package/dist/bin/chunks/chunk-VMVXACZ5.js +6 -0
- package/dist/bin/chunks/chunk-WLQ2KWS3.js +10 -0
- package/dist/bin/chunks/{chunk-MVBK66TR.js → chunk-WPJ5CECR.js} +1 -1
- package/dist/bin/chunks/{chunk-ANX7U57Q.js → chunk-XBOBVLRL.js} +2 -2
- package/dist/bin/chunks/{chunk-HZGHQZSY.js → chunk-Z3MXFCN7.js} +1 -1
- package/dist/bin/chunks/{column-AJFK3TWF.js → column-AL4LR5PO.js} +1 -1
- package/dist/bin/chunks/{cp-YLP7ULVT.js → cp-XJWV46T5.js} +1 -1
- package/dist/bin/{shell/chunks/curl-NHNZ46BU.js → chunks/curl-HZ5SBTVY.js} +11 -11
- package/dist/bin/chunks/{cut-42X6363P.js → cut-LNJEMWBJ.js} +1 -1
- package/dist/bin/{shell/chunks/diff-DM47S5PT.js → chunks/diff-YLVT27CZ.js} +1 -1
- package/dist/bin/chunks/dist-4NZ74CRE.js +141 -0
- package/dist/bin/chunks/{du-DH76GZJ3.js → du-YNAJTGCR.js} +1 -1
- package/dist/bin/chunks/{expr-PQEPO5TE.js → expr-GLGO2VEZ.js} +1 -1
- package/dist/bin/chunks/{file-JA7QI2YT.js → file-7M5LLZJY.js} +1 -1
- package/dist/bin/chunks/find-3QDGII35.js +3 -0
- package/dist/bin/chunks/flag-coverage-AGEO3F6X.js +3 -0
- package/dist/bin/chunks/{grep-VXWNMIDD.js → grep-AZJ2CMYE.js} +1 -1
- package/dist/bin/chunks/{gzip-UQZL4R74.js → gzip-W5CL2E2W.js} +1 -1
- package/dist/bin/{shell/chunks/head-QKVY3SIO.js → chunks/head-ABLEKDMV.js} +1 -1
- package/dist/bin/{shell/chunks/help-HVIDHJ6M.js → chunks/help-EXVKU23F.js} +1 -1
- package/dist/bin/chunks/{html-to-markdown-XUMA42ZC.js → html-to-markdown-FDNPIEKZ.js} +1 -1
- package/dist/bin/{shell/chunks/jq-YS4PR46D.js → chunks/jq-5SOTL7D7.js} +1 -1
- package/dist/bin/chunks/{js-exec-ZAAIZQWI.js → js-exec-LISDW7YC.js} +2 -2
- package/dist/bin/chunks/js-exec-worker.js +1 -0
- package/dist/bin/chunks/{ls-5Z45FV4U.js → ls-EEX3YIOF.js} +1 -1
- package/dist/bin/chunks/mkdir-KDEZTR53.js +3 -0
- package/dist/bin/chunks/mktemp-OYQYUB5H.js +3 -0
- package/dist/bin/{shell/chunks/mv-EOOP2TO3.js → chunks/mv-35V6IA5V.js} +1 -1
- package/dist/bin/{shell/chunks/od-2GXD4D5K.js → chunks/od-TD5LZDUM.js} +1 -1
- package/dist/bin/{shell/chunks/paste-DWWA3JTW.js → chunks/paste-QJG6BYAP.js} +1 -1
- package/dist/bin/chunks/{python3-TJ6DCPIA.js → python3-P6MZ44HK.js} +5 -5
- package/dist/bin/{shell/chunks/readlink-EJ3IKLWW.js → chunks/readlink-BF435HNQ.js} +1 -1
- package/dist/bin/chunks/rg-B2DVJQVY.js +3 -0
- package/dist/bin/chunks/rm-HCMKNRM2.js +3 -0
- package/dist/bin/{shell/chunks/rmdir-PRNISPBA.js → chunks/rmdir-WGVUYGPF.js} +1 -1
- package/dist/bin/{shell/chunks/sed-SY63U2YX.js → chunks/sed-66XZQ75T.js} +1 -1
- package/dist/bin/chunks/{seq-X2EAOGV5.js → seq-KBVCQ4WT.js} +1 -1
- package/dist/bin/chunks/{sleep-MOJQBZMY.js → sleep-4O22Z4DI.js} +1 -1
- package/dist/bin/{shell/chunks/split-HIFKSV2A.js → chunks/split-OK6JHDWZ.js} +1 -1
- package/dist/bin/chunks/sqlite3-57ACN7ES.js +3 -0
- package/dist/bin/chunks/{stat-LROLDXHH.js → stat-VNNI7JDZ.js} +1 -1
- package/dist/bin/chunks/{tail-UOTUV25D.js → tail-PAHZX3MA.js} +1 -1
- package/dist/bin/chunks/{tar-7XOP7VOX.js → tar-RPVTXGFJ.js} +1 -1
- package/dist/bin/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
- package/dist/bin/chunks/timeout-XMTXHNFF.js +3 -0
- package/dist/bin/{shell/chunks/tr-PVFO6FRY.js → chunks/tr-ETPC3LHV.js} +1 -1
- package/dist/bin/chunks/{which-4TPGVSBZ.js → which-G7X54RZL.js} +1 -1
- package/dist/bin/chunks/worker.js +5 -0
- package/dist/bin/chunks/{xan-RMH6JEXM.js → xan-XZHKEPJ4.js} +1 -1
- package/dist/bin/chunks/{xan-view-PD26QEFN.js → xan-view-CNGKCABE.js} +1 -1
- package/dist/bin/chunks/yes-2EQTNSIB.js +3 -0
- package/dist/bin/chunks/yq-T6S3IDKY.js +3 -0
- package/dist/bin/just-bash.js +299 -293
- package/dist/bin/shell/chunks/awk2-LCV2AUIX.js +3 -0
- package/dist/bin/{chunks/base64-TQ5KOCNW.js → shell/chunks/base64-OLYCF2PC.js} +1 -1
- package/dist/bin/shell/chunks/builtin-manifest-ORBIZM7I.js +3 -0
- package/dist/bin/shell/chunks/{cat-BQ7FQTN5.js → cat-UJLF2DU2.js} +1 -1
- package/dist/bin/{chunks/chmod-GX5SYTRL.js → shell/chunks/chmod-V5F4BXZ2.js} +1 -1
- package/dist/bin/{chunks/chunk-V4S4A7M6.js → shell/chunks/chunk-2TEF4USR.js} +1 -1
- package/dist/bin/{chunks/chunk-GBKR5KTT.js → shell/chunks/chunk-3ASHUC7C.js} +13 -13
- package/dist/bin/shell/chunks/{chunk-N26Y42L6.js → chunk-3M5OMKFS.js} +1 -1
- package/dist/bin/shell/chunks/chunk-4NYJ4ZTO.js +17 -0
- package/dist/bin/shell/chunks/{chunk-M3Z5NZXT.js → chunk-572NXISH.js} +1 -1
- package/dist/bin/shell/chunks/chunk-5NWK7A4R.js +13 -0
- package/dist/bin/{chunks/chunk-YXPSX3SI.js → shell/chunks/chunk-623Q77WZ.js} +1 -1
- package/dist/bin/shell/chunks/chunk-6NG4ULJM.js +7 -0
- package/dist/bin/{chunks/chunk-QFOXSCOD.js → shell/chunks/chunk-726WDFMQ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-DRPHNXG7.js → chunk-7LGT4LHQ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-MBREBDZQ.js → chunk-AIWBN36Z.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-3ROYEBJI.js → chunk-AJ3CSZ34.js} +1 -1
- package/dist/bin/{chunks/chunk-VTAMGD42.js → shell/chunks/chunk-APEQNYAO.js} +1 -1
- package/dist/bin/shell/chunks/chunk-AQKIHX3Q.js +3 -0
- package/dist/bin/shell/chunks/chunk-BFLKIASG.js +7 -0
- package/dist/bin/shell/chunks/{chunk-IOKQFPM6.js → chunk-BRB5PJ3E.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-ZVG47PYA.js → chunk-BVBYPYA5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-T6OIISUC.js → chunk-BZJ77YQD.js} +1 -1
- package/dist/bin/{chunks/chunk-GR4ZHKXI.js → shell/chunks/chunk-C2BLJ3AE.js} +1 -1
- package/dist/bin/{chunks/chunk-KMYJMEON.js → shell/chunks/chunk-C45GTJTD.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-GOWX7VPU.js → chunk-CTS7QXCJ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-42AMF6EE.js → chunk-DTNGYQCJ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-TW2IJRUF.js → chunk-ENEHPI32.js} +1 -1
- package/dist/bin/{chunks/chunk-E54Z6VIE.js → shell/chunks/chunk-ERYPQAZE.js} +5 -5
- package/dist/bin/shell/chunks/{chunk-PQ2INDRF.js → chunk-GB3KUAFV.js} +1 -1
- package/dist/bin/shell/chunks/chunk-HFVQCXYX.js +10 -0
- package/dist/bin/shell/chunks/chunk-HSWCKN2X.js +14 -0
- package/dist/bin/shell/chunks/{chunk-B6WWC6K3.js → chunk-I6MS5ZWE.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-V4U26ZWL.js → chunk-IOFXLMNJ.js} +1 -1
- package/dist/bin/shell/chunks/chunk-IX6QY5JW.js +5 -0
- package/dist/bin/shell/chunks/{chunk-QKJAAJ7J.js → chunk-IXTPVJ6W.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-OUQKFRVR.js → chunk-JBYLHCKP.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-NXUXZWS5.js → chunk-JLRB7DV3.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-6JEDM6CZ.js → chunk-KH6YLKPE.js} +1 -1
- package/dist/bin/shell/chunks/chunk-KXSDVBJA.js +12 -0
- package/dist/bin/shell/chunks/{chunk-DYIBFLS3.js → chunk-LOU52GPJ.js} +2 -2
- package/dist/bin/shell/chunks/{chunk-L345YZ6R.js → chunk-LVT5R45K.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-PTUQEN6I.js → chunk-M345X45Z.js} +7 -7
- package/dist/bin/shell/chunks/{chunk-6FGMEZZP.js → chunk-NDS7PYKD.js} +1 -1
- package/dist/bin/shell/chunks/chunk-O3PNT72D.js +3 -0
- package/dist/bin/shell/chunks/chunk-OGOISDGZ.js +3 -0
- package/dist/bin/shell/chunks/chunk-OSW4MDDH.js +21 -0
- package/dist/bin/{chunks/chunk-ABP4OLJV.js → shell/chunks/chunk-OXEDIWNZ.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-FPWHWWXO.js → chunk-OXV2B2YS.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-QMPZXXEK.js → chunk-OY25E3ZN.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-O2BCKSMK.js → chunk-PEJXCXSY.js} +1 -1
- package/dist/bin/{chunks/chunk-6KHZX4HU.js → shell/chunks/chunk-PLLMJHMV.js} +1 -1
- package/dist/bin/{chunks/chunk-6TUILMPB.js → shell/chunks/chunk-QELDDRV5.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-3FQBUEB6.js → chunk-RC4UXNHA.js} +1 -1
- package/dist/bin/{chunks/chunk-H7PD6FLC.js → shell/chunks/chunk-RE7Z53A3.js} +1 -1
- package/dist/bin/shell/chunks/chunk-SCQRBEQW.js +275 -0
- package/dist/bin/shell/chunks/{chunk-3DWQCLNP.js → chunk-SS2OPV62.js} +1 -1
- package/dist/bin/{chunks/chunk-CC2AQ6B7.js → shell/chunks/chunk-U6JTVQU6.js} +1 -1
- package/dist/bin/shell/chunks/chunk-UBA7DOWE.js +3 -0
- package/dist/bin/shell/chunks/{chunk-VPSBWWXM.js → chunk-UFAYH3WW.js} +7 -6
- package/dist/bin/shell/chunks/chunk-UPUFWGHR.js +3 -0
- package/dist/bin/{chunks/chunk-QJWFCA7P.js → shell/chunks/chunk-UU42WPB7.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-CNVNOT67.js → chunk-UW4E5XU5.js} +1 -1
- package/dist/bin/shell/chunks/chunk-VMVXACZ5.js +6 -0
- package/dist/bin/shell/chunks/chunk-WLQ2KWS3.js +10 -0
- package/dist/bin/shell/chunks/{chunk-MVBK66TR.js → chunk-WPJ5CECR.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-ANX7U57Q.js → chunk-XBOBVLRL.js} +2 -2
- package/dist/bin/shell/chunks/{chunk-HZGHQZSY.js → chunk-Z3MXFCN7.js} +1 -1
- package/dist/bin/shell/chunks/{column-AJFK3TWF.js → column-AL4LR5PO.js} +1 -1
- package/dist/bin/shell/chunks/{cp-YLP7ULVT.js → cp-XJWV46T5.js} +1 -1
- package/dist/bin/{chunks/curl-NHNZ46BU.js → shell/chunks/curl-HZ5SBTVY.js} +11 -11
- package/dist/bin/shell/chunks/{cut-42X6363P.js → cut-LNJEMWBJ.js} +1 -1
- package/dist/bin/{chunks/diff-DM47S5PT.js → shell/chunks/diff-YLVT27CZ.js} +1 -1
- package/dist/bin/shell/chunks/dist-4NZ74CRE.js +141 -0
- package/dist/bin/shell/chunks/{du-DH76GZJ3.js → du-YNAJTGCR.js} +1 -1
- package/dist/bin/shell/chunks/{expr-PQEPO5TE.js → expr-GLGO2VEZ.js} +1 -1
- package/dist/bin/shell/chunks/{file-JA7QI2YT.js → file-7M5LLZJY.js} +1 -1
- package/dist/bin/shell/chunks/find-3QDGII35.js +3 -0
- package/dist/bin/shell/chunks/flag-coverage-AGEO3F6X.js +3 -0
- package/dist/bin/shell/chunks/{grep-VXWNMIDD.js → grep-AZJ2CMYE.js} +1 -1
- package/dist/bin/shell/chunks/{gzip-UQZL4R74.js → gzip-W5CL2E2W.js} +1 -1
- package/dist/bin/{chunks/head-QKVY3SIO.js → shell/chunks/head-ABLEKDMV.js} +1 -1
- package/dist/bin/{chunks/help-HVIDHJ6M.js → shell/chunks/help-EXVKU23F.js} +1 -1
- package/dist/bin/shell/chunks/{html-to-markdown-XUMA42ZC.js → html-to-markdown-FDNPIEKZ.js} +1 -1
- package/dist/bin/{chunks/jq-YS4PR46D.js → shell/chunks/jq-5SOTL7D7.js} +1 -1
- package/dist/bin/shell/chunks/{js-exec-ZAAIZQWI.js → js-exec-LISDW7YC.js} +2 -2
- package/dist/bin/shell/chunks/{ls-5Z45FV4U.js → ls-EEX3YIOF.js} +1 -1
- package/dist/bin/shell/chunks/mkdir-KDEZTR53.js +3 -0
- package/dist/bin/shell/chunks/mktemp-OYQYUB5H.js +3 -0
- package/dist/bin/{chunks/mv-EOOP2TO3.js → shell/chunks/mv-35V6IA5V.js} +1 -1
- package/dist/bin/{chunks/od-2GXD4D5K.js → shell/chunks/od-TD5LZDUM.js} +1 -1
- package/dist/bin/{chunks/paste-DWWA3JTW.js → shell/chunks/paste-QJG6BYAP.js} +1 -1
- package/dist/bin/shell/chunks/{python3-TJ6DCPIA.js → python3-P6MZ44HK.js} +5 -5
- package/dist/bin/{chunks/readlink-EJ3IKLWW.js → shell/chunks/readlink-BF435HNQ.js} +1 -1
- package/dist/bin/shell/chunks/rg-B2DVJQVY.js +3 -0
- package/dist/bin/shell/chunks/rm-HCMKNRM2.js +3 -0
- package/dist/bin/{chunks/rmdir-PRNISPBA.js → shell/chunks/rmdir-WGVUYGPF.js} +1 -1
- package/dist/bin/{chunks/sed-SY63U2YX.js → shell/chunks/sed-66XZQ75T.js} +1 -1
- package/dist/bin/shell/chunks/{seq-X2EAOGV5.js → seq-KBVCQ4WT.js} +1 -1
- package/dist/bin/shell/chunks/{sleep-MOJQBZMY.js → sleep-4O22Z4DI.js} +1 -1
- package/dist/bin/{chunks/split-HIFKSV2A.js → shell/chunks/split-OK6JHDWZ.js} +1 -1
- package/dist/bin/shell/chunks/sqlite3-57ACN7ES.js +3 -0
- package/dist/bin/shell/chunks/{stat-LROLDXHH.js → stat-VNNI7JDZ.js} +1 -1
- package/dist/bin/shell/chunks/{tail-UOTUV25D.js → tail-PAHZX3MA.js} +1 -1
- package/dist/bin/shell/chunks/{tar-7XOP7VOX.js → tar-RPVTXGFJ.js} +1 -1
- package/dist/bin/shell/chunks/{time-LF7BTSK5.js → time-J2DAZUIN.js} +1 -1
- package/dist/bin/shell/chunks/timeout-XMTXHNFF.js +3 -0
- package/dist/bin/{chunks/tr-PVFO6FRY.js → shell/chunks/tr-ETPC3LHV.js} +1 -1
- package/dist/bin/shell/chunks/{which-4TPGVSBZ.js → which-G7X54RZL.js} +1 -1
- package/dist/bin/shell/chunks/{xan-RMH6JEXM.js → xan-XZHKEPJ4.js} +1 -1
- package/dist/bin/shell/chunks/{xan-view-PD26QEFN.js → xan-view-CNGKCABE.js} +1 -1
- package/dist/bin/shell/chunks/yes-2EQTNSIB.js +3 -0
- package/dist/bin/shell/chunks/yq-T6S3IDKY.js +3 -0
- package/dist/bin/shell/shell.js +369 -363
- package/dist/browser.d.ts +1 -1
- package/dist/bundle/browser.js +746 -726
- package/dist/bundle/chunks/awk2-TLK6FCHV.js +2 -0
- package/dist/bundle/chunks/{base64-MHVQ5XHI.js → base64-GUZMZ645.js} +1 -1
- package/dist/bundle/chunks/builtin-manifest-7MJJDZ2T.js +2 -0
- package/dist/bundle/chunks/{cat-VZBWBIJB.js → cat-LG4YGKUE.js} +1 -1
- package/dist/bundle/chunks/{chmod-TEY5MD2W.js → chmod-XUKPG2M4.js} +1 -1
- package/dist/bundle/chunks/{chunk-E2F4A3CM.js → chunk-2A4OZBCS.js} +5 -5
- package/dist/bundle/chunks/{chunk-WNH3HOQA.js → chunk-353VO5TF.js} +1 -1
- package/dist/bundle/chunks/chunk-37UJACD6.js +9 -0
- package/dist/bundle/chunks/{chunk-H3A45X3W.js → chunk-3LGQ6XEC.js} +1 -1
- package/dist/bundle/chunks/{chunk-P57S6Z6R.js → chunk-3ZY5QX3G.js} +1 -1
- package/dist/bundle/chunks/{chunk-45QZRGYF.js → chunk-4VU4IF3W.js} +7 -6
- package/dist/bundle/chunks/{chunk-SIOONII3.js → chunk-52W2IWA7.js} +1 -1
- package/dist/bundle/chunks/chunk-5IB57TIJ.js +274 -0
- package/dist/bundle/chunks/chunk-5J4S2LP5.js +2 -0
- package/dist/bundle/chunks/{chunk-PCPW54JH.js → chunk-5LDRJ22P.js} +1 -1
- package/dist/bundle/chunks/{chunk-BKUWXPEM.js → chunk-654CJKE3.js} +1 -1
- package/dist/bundle/chunks/{chunk-EZNS4GF7.js → chunk-67ODVGSB.js} +1 -1
- package/dist/bundle/chunks/{chunk-6QF3PCMO.js → chunk-6HQQON3N.js} +1 -1
- package/dist/bundle/chunks/chunk-6L6OYVLY.js +2 -0
- package/dist/bundle/chunks/{chunk-U57DSHID.js → chunk-6P2DITXT.js} +1 -1
- package/dist/bundle/chunks/chunk-74IR77AZ.js +11 -0
- package/dist/bundle/chunks/{chunk-S3ENGQML.js → chunk-7DVD6YCI.js} +1 -1
- package/dist/bundle/chunks/{chunk-HXWB4Z5X.js → chunk-7II7XIVI.js} +1 -1
- package/dist/bundle/chunks/{chunk-AYSZ5MAE.js → chunk-A3C4Z3Q3.js} +1 -1
- package/dist/bundle/chunks/chunk-A6SU3BZX.js +6 -0
- package/dist/bundle/chunks/{chunk-6HO6HX7V.js → chunk-AMXNXHXK.js} +1 -1
- package/dist/bundle/chunks/{chunk-QJ7OXJAZ.js → chunk-BLG7RWH4.js} +1 -1
- package/dist/bundle/chunks/chunk-BMBITA6Y.js +2 -0
- package/dist/bundle/chunks/{chunk-XQ2ZZFO6.js → chunk-BQTWRHZR.js} +2 -2
- package/dist/bundle/chunks/{chunk-WE7BJ7YU.js → chunk-BZ2OMW2T.js} +1 -1
- package/dist/bundle/chunks/{chunk-S6DNKKUL.js → chunk-CM4T4GB4.js} +1 -1
- package/dist/bundle/chunks/{chunk-CH7SUFFO.js → chunk-CORCIYJD.js} +1 -1
- package/dist/bundle/chunks/{chunk-LGIJSCWH.js → chunk-EQDVNHQS.js} +1 -1
- package/dist/bundle/chunks/{chunk-U4K5ZDWK.js → chunk-EZEO6MFE.js} +1 -1
- package/dist/bundle/chunks/{chunk-SE23TEGG.js → chunk-EZT6M2HG.js} +1 -1
- package/dist/bundle/chunks/{chunk-4MJ7VJG4.js → chunk-H7UVJSZR.js} +1 -1
- package/dist/bundle/chunks/{chunk-5EI7WSRV.js → chunk-HYQGYXGZ.js} +1 -1
- package/dist/bundle/chunks/{chunk-6IA4DXG2.js → chunk-IPKSYZ3R.js} +1 -1
- package/dist/bundle/chunks/{chunk-TLPMB3FO.js → chunk-KJBPGFZD.js} +1 -1
- package/dist/bundle/chunks/chunk-L7NEGEOJ.js +16 -0
- package/dist/bundle/chunks/{chunk-YFFU74KY.js → chunk-MJEJ7QEY.js} +1 -1
- package/dist/bundle/chunks/{chunk-QJFYYEFV.js → chunk-N36I27VM.js} +1 -1
- package/dist/bundle/chunks/chunk-N5L7E4EL.js +6 -0
- package/dist/bundle/chunks/{chunk-6QAM55HM.js → chunk-NFODJFHN.js} +1 -1
- package/dist/bundle/chunks/{chunk-IXFQXNL4.js → chunk-NFW4YKDO.js} +1 -1
- package/dist/bundle/chunks/{chunk-HCKTU6IR.js → chunk-NOX3PCUH.js} +1 -1
- package/dist/bundle/chunks/{chunk-MQKGGNPS.js → chunk-NXBUT5V2.js} +2 -2
- package/dist/bundle/chunks/{chunk-4KZT23KR.js → chunk-O5BHWBYH.js} +1 -1
- package/dist/bundle/chunks/{chunk-DVSA72LH.js → chunk-QTL2XC4B.js} +1 -1
- package/dist/bundle/chunks/chunk-RK2WBVP4.js +2 -0
- package/dist/bundle/chunks/{chunk-BLPYR4TN.js → chunk-RVBBGZ22.js} +1 -1
- package/dist/bundle/chunks/{chunk-PS2RJNZZ.js → chunk-SXQJYLP7.js} +1 -1
- package/dist/bundle/chunks/{chunk-MWL2I5BV.js → chunk-T7OAZEXT.js} +1 -1
- package/dist/bundle/chunks/{chunk-O452S4KX.js → chunk-URIKBXSE.js} +1 -1
- package/dist/bundle/chunks/{chunk-6BSOPPZH.js → chunk-UVQC75LS.js} +7 -7
- package/dist/bundle/chunks/chunk-VCREDMWH.js +4 -0
- package/dist/bundle/chunks/{chunk-DDPD7SIB.js → chunk-VQ6EUBJ3.js} +1 -1
- package/dist/bundle/chunks/chunk-VQEB6E2M.js +13 -0
- package/dist/bundle/chunks/{chunk-R2FBRMDU.js → chunk-VWUMR4IC.js} +1 -1
- package/dist/bundle/chunks/{chunk-XXBIOG4R.js → chunk-WDY2TNMK.js} +1 -1
- package/dist/bundle/chunks/chunk-XT7EK6BR.js +9 -0
- package/dist/bundle/chunks/{chunk-BS6EJR2R.js → chunk-XUTEQMTL.js} +5 -5
- package/dist/bundle/chunks/{chunk-KIGPB52X.js → chunk-XZ34OGNM.js} +1 -1
- package/dist/bundle/chunks/{chunk-FSKXIFYT.js → chunk-Y6UHNLT5.js} +1 -1
- package/dist/bundle/chunks/chunk-YUITEK6N.js +12 -0
- package/dist/bundle/chunks/chunk-YZCPEJRE.js +20 -0
- package/dist/bundle/chunks/chunk-ZIQS5QAW.js +5 -0
- package/dist/bundle/chunks/chunk-ZUEPJPYA.js +2 -0
- package/dist/bundle/chunks/{column-QJI65SH2.js → column-T4LGMRJG.js} +1 -1
- package/dist/bundle/chunks/{cp-UR762VVT.js → cp-ZDDVNITX.js} +1 -1
- package/dist/bundle/chunks/{curl-K4WT7UPN.js → curl-RCRD36LD.js} +11 -11
- package/dist/bundle/chunks/{cut-FMDNVWQN.js → cut-35WER2E2.js} +1 -1
- package/dist/bundle/chunks/{diff-R7TXVVLN.js → diff-Z3XOLW44.js} +1 -1
- package/dist/bundle/chunks/{du-EQKH3UNA.js → du-YBSJVBXP.js} +1 -1
- package/dist/bundle/chunks/{expr-A5XITHQD.js → expr-KSNRNE7V.js} +1 -1
- package/dist/bundle/chunks/{file-6AYYTULJ.js → file-XH37HMGV.js} +1 -1
- package/dist/bundle/chunks/find-3AONTPPM.js +2 -0
- package/dist/bundle/chunks/flag-coverage-6YGO7STE.js +2 -0
- package/dist/bundle/chunks/{grep-Q2O5EIXQ.js → grep-WW5KJPUG.js} +1 -1
- package/dist/bundle/chunks/{gzip-KC5ENBD2.js → gzip-ISZXQNJJ.js} +1 -1
- package/dist/bundle/chunks/{head-6UIPFWVJ.js → head-VYXZQLPZ.js} +1 -1
- package/dist/bundle/chunks/{help-QDDMBDU7.js → help-62M75TSG.js} +1 -1
- package/dist/bundle/chunks/{html-to-markdown-PE6BPRPA.js → html-to-markdown-4LXS3A44.js} +1 -1
- package/dist/bundle/chunks/{jq-UKAA3QWU.js → jq-3IVOWP3G.js} +1 -1
- package/dist/bundle/chunks/{js-exec-MUZRDUJ3.js → js-exec-T2WEE4KG.js} +2 -2
- package/dist/bundle/chunks/js-exec-worker.js +1 -0
- package/dist/bundle/chunks/{ls-WH5S4PPL.js → ls-FC3CSHKE.js} +1 -1
- package/dist/bundle/chunks/mkdir-DPFWDY25.js +2 -0
- package/dist/bundle/chunks/mktemp-SW2AHXZW.js +2 -0
- package/dist/bundle/chunks/{mv-WE7DBLEK.js → mv-PWCFXEF2.js} +1 -1
- package/dist/bundle/chunks/{od-Z4AIL3P4.js → od-VJ6PBBEI.js} +1 -1
- package/dist/bundle/chunks/{paste-ZNHNSRBW.js → paste-TIQETHSO.js} +1 -1
- package/dist/bundle/chunks/{python3-W4UMQJAQ.js → python3-6JEP7ZZK.js} +5 -5
- package/dist/bundle/chunks/{readlink-JSRKXLLQ.js → readlink-7XGQ3PL7.js} +1 -1
- package/dist/bundle/chunks/rg-2OPJ5V3D.js +2 -0
- package/dist/bundle/chunks/rm-AZZM5DCE.js +2 -0
- package/dist/bundle/chunks/{rmdir-3WTXMVKI.js → rmdir-YXYSZD4X.js} +1 -1
- package/dist/bundle/chunks/{sed-6G32B25J.js → sed-HYSBLGO5.js} +1 -1
- package/dist/bundle/chunks/{seq-B6KDLMYQ.js → seq-M2S4FRN4.js} +1 -1
- package/dist/bundle/chunks/{sleep-25QUPVDK.js → sleep-YC4HFEGC.js} +1 -1
- package/dist/bundle/chunks/{split-HUKVGJTW.js → split-UOPIWKKE.js} +1 -1
- package/dist/bundle/chunks/sqlite3-XCROTL6G.js +2 -0
- package/dist/bundle/chunks/{stat-LXFZND2P.js → stat-I3FPUTR7.js} +1 -1
- package/dist/bundle/chunks/{tail-UBGSN4JF.js → tail-WK3WACZK.js} +1 -1
- package/dist/bundle/chunks/{tar-LE7LAAIX.js → tar-VZYMNZV2.js} +1 -1
- package/dist/bundle/chunks/{time-NERE2JJ2.js → time-N6J6DC6C.js} +1 -1
- package/dist/bundle/chunks/timeout-UDR5J2MP.js +2 -0
- package/dist/bundle/chunks/{tr-UI2LA3GA.js → tr-VI5PIA4A.js} +1 -1
- package/dist/bundle/chunks/{which-UWVKETYW.js → which-BP5YY5BR.js} +1 -1
- package/dist/bundle/chunks/worker.js +5 -0
- package/dist/bundle/chunks/{xan-UIL24CGT.js → xan-DL576EIT.js} +1 -1
- package/dist/bundle/chunks/xan-view-GJVN6IHX.js +2 -0
- package/dist/bundle/chunks/yes-OVJMX6NM.js +2 -0
- package/dist/bundle/chunks/yq-KYPU4LQP.js +2 -0
- package/dist/bundle/index.cjs +1079 -1059
- package/dist/bundle/index.js +345 -339
- package/dist/commands/mktemp/mktemp.d.ts +4 -0
- package/dist/commands/registry.d.ts +1 -1
- package/dist/commands/which/which.d.ts +10 -0
- package/dist/commands/yes/yes.d.ts +4 -0
- package/dist/custom-commands.d.ts +12 -0
- package/dist/fs/create-exclusive.d.ts +30 -0
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +8 -1
- package/dist/fs/interface.d.ts +37 -0
- package/dist/fs/mountable-fs/mountable-fs.d.ts +18 -1
- package/dist/fs/overlay-fs/overlay-fs.d.ts +19 -1
- package/dist/fs/path-utils.d.ts +0 -4
- package/dist/fs/read-write-fs/read-write-fs.d.ts +22 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/interpreter/expansion/array-prefix-suffix.d.ts +2 -1
- package/dist/interpreter/expansion/parameter-ops.d.ts +1 -0
- package/dist/interpreter/expansion/pattern-removal.d.ts +3 -0
- package/dist/interpreter/expansion/variable.d.ts +1 -1
- package/dist/interpreter/helpers/loop.d.ts +32 -0
- package/dist/limits.d.ts +0 -3
- package/dist/network/dns-pin.d.ts +1 -32
- package/dist/network/fetch.d.ts +1 -1
- package/dist/security/trusted-globals.d.ts +8 -0
- package/dist/types.d.ts +6 -0
- package/package.json +3 -4
- package/dist/bin/chunks/awk2-NTRVFXRA.js +0 -3
- package/dist/bin/chunks/chunk-3PCPQIUD.js +0 -3
- package/dist/bin/chunks/chunk-6JUPBMCR.js +0 -13
- package/dist/bin/chunks/chunk-BB5VTPMQ.js +0 -16
- package/dist/bin/chunks/chunk-CN4JKMTR.js +0 -8
- package/dist/bin/chunks/chunk-F2PYTUMR.js +0 -9
- package/dist/bin/chunks/chunk-HWI42GQO.js +0 -7
- package/dist/bin/chunks/chunk-HWK7KFGB.js +0 -3
- package/dist/bin/chunks/chunk-I57EACSL.js +0 -3
- package/dist/bin/chunks/chunk-ONF4KUYV.js +0 -13
- package/dist/bin/chunks/chunk-PRVPFKTC.js +0 -276
- package/dist/bin/chunks/chunk-RTN6X652.js +0 -11
- package/dist/bin/chunks/chunk-RVPTAYDS.js +0 -4
- package/dist/bin/chunks/chunk-U5JLGI56.js +0 -21
- package/dist/bin/chunks/dist-5MWO25Y4.js +0 -141
- package/dist/bin/chunks/find-MHC4QV6H.js +0 -3
- package/dist/bin/chunks/flag-coverage-LLAQBVIG.js +0 -3
- package/dist/bin/chunks/mkdir-YJ3SOVRP.js +0 -3
- package/dist/bin/chunks/rg-WHVR3YDT.js +0 -3
- package/dist/bin/chunks/rm-B4LVIG7A.js +0 -3
- package/dist/bin/chunks/sqlite3-CXQTZRPZ.js +0 -3
- package/dist/bin/chunks/timeout-RQOWSWYG.js +0 -3
- package/dist/bin/chunks/yq-CWBZMGUV.js +0 -3
- package/dist/bin/shell/chunks/awk2-NTRVFXRA.js +0 -3
- package/dist/bin/shell/chunks/chunk-3PCPQIUD.js +0 -3
- package/dist/bin/shell/chunks/chunk-6JUPBMCR.js +0 -13
- package/dist/bin/shell/chunks/chunk-BB5VTPMQ.js +0 -16
- package/dist/bin/shell/chunks/chunk-CN4JKMTR.js +0 -8
- package/dist/bin/shell/chunks/chunk-F2PYTUMR.js +0 -9
- package/dist/bin/shell/chunks/chunk-HWI42GQO.js +0 -7
- package/dist/bin/shell/chunks/chunk-HWK7KFGB.js +0 -3
- package/dist/bin/shell/chunks/chunk-I57EACSL.js +0 -3
- package/dist/bin/shell/chunks/chunk-ONF4KUYV.js +0 -13
- package/dist/bin/shell/chunks/chunk-PRVPFKTC.js +0 -276
- package/dist/bin/shell/chunks/chunk-RTN6X652.js +0 -11
- package/dist/bin/shell/chunks/chunk-RVPTAYDS.js +0 -4
- package/dist/bin/shell/chunks/chunk-U5JLGI56.js +0 -21
- package/dist/bin/shell/chunks/dist-5MWO25Y4.js +0 -141
- package/dist/bin/shell/chunks/find-MHC4QV6H.js +0 -3
- package/dist/bin/shell/chunks/flag-coverage-LLAQBVIG.js +0 -3
- package/dist/bin/shell/chunks/mkdir-YJ3SOVRP.js +0 -3
- package/dist/bin/shell/chunks/rg-WHVR3YDT.js +0 -3
- package/dist/bin/shell/chunks/rm-B4LVIG7A.js +0 -3
- package/dist/bin/shell/chunks/sqlite3-CXQTZRPZ.js +0 -3
- package/dist/bin/shell/chunks/timeout-RQOWSWYG.js +0 -3
- package/dist/bin/shell/chunks/yq-CWBZMGUV.js +0 -3
- package/dist/bundle/chunks/awk2-VS5QVYHU.js +0 -2
- package/dist/bundle/chunks/chunk-2SMD2AUA.js +0 -3
- package/dist/bundle/chunks/chunk-35MBA3VY.js +0 -12
- package/dist/bundle/chunks/chunk-3OBCZP7T.js +0 -12
- package/dist/bundle/chunks/chunk-4CC3OZPU.js +0 -2
- package/dist/bundle/chunks/chunk-A257L6QO.js +0 -7
- package/dist/bundle/chunks/chunk-ATGOUOX2.js +0 -15
- package/dist/bundle/chunks/chunk-BRJERIF4.js +0 -2
- package/dist/bundle/chunks/chunk-FTET43KM.js +0 -2
- package/dist/bundle/chunks/chunk-GRUZ4SBY.js +0 -275
- package/dist/bundle/chunks/chunk-LRFR25IP.js +0 -8
- package/dist/bundle/chunks/chunk-RWQWFXMH.js +0 -10
- package/dist/bundle/chunks/chunk-Y6JBSHCM.js +0 -20
- package/dist/bundle/chunks/chunk-ZBUZKIPX.js +0 -6
- package/dist/bundle/chunks/find-RLKBCGJR.js +0 -2
- package/dist/bundle/chunks/flag-coverage-YQGACUSN.js +0 -2
- package/dist/bundle/chunks/mkdir-Z6MMWH3D.js +0 -2
- package/dist/bundle/chunks/rg-JKB7DR66.js +0 -2
- package/dist/bundle/chunks/rm-IGPLE632.js +0 -2
- package/dist/bundle/chunks/sqlite3-DQNCWDG5.js +0 -2
- package/dist/bundle/chunks/timeout-37GM7IIL.js +0 -2
- package/dist/bundle/chunks/xan-view-FOCYCKZQ.js +0 -2
- package/dist/bundle/chunks/yq-ZRNZKDLE.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{d as l,e as u}from"./chunk-
|
|
3
|
+
import{d as l,e as u}from"./chunk-IXTPVJ6W.js";import{randomBytes as h}from"node:crypto";var d=class{options;protocolToken=h(16).toString("hex");deadline;cleanups=[];cancelHandler;canceledReason;closed=!1;constructor(t){this.options=t,this.deadline=Date.now()+t.timeoutMs}arm(t){if(this.cancelHandler)throw new Error("worker request is already armed");this.cancelHandler=t;let a=this.options.signal;if(a){let i=()=>this.cancel("abort");a.addEventListener("abort",i,{once:!0}),this.cleanups.push(()=>a.removeEventListener("abort",i)),a.aborted&&this.cancel("abort")}if(!this.canceledReason){let i=l(()=>this.cancel("timeout"),Math.max(0,this.options.timeoutMs));i!==void 0&&this.cleanups.push(()=>u(i))}}get isCanceled(){return this.canceledReason!==void 0}remainingTimeMs(){return Math.max(0,this.deadline-Date.now())}timeoutMessage(t="Execution"){return`${t} timeout: exceeded ${this.options.timeoutMs}ms limit`}abortMessage(){return"Execution aborted"}assertMessageSize(t,a){if(f(t,this.options.maxMessageBytes)>this.options.maxMessageBytes)throw new Error(`${this.options.commandName}: worker ${a} exceeds ${this.options.maxMessageBytes} byte limit`)}async terminate(t){if(!t)return!0;try{return await t.terminate(),!0}catch{return!1}}close(){if(!this.closed){this.closed=!0;for(let t=this.cleanups.length-1;t>=0;t--)this.cleanups[t]();this.cleanups.length=0,this.cancelHandler=void 0}}cancel(t){this.closed||this.canceledReason||(this.canceledReason=t,this.cancelHandler?.(t))}};function f(o,t){let a=function*(n){for(let e in n)Object.hasOwn(n,e)&&(yield[e,n[e]])},i=[{kind:"value",value:o}],c=new WeakSet,s=0;for(;i.length>0&&s<=t;){let n=i.pop();if(!n)break;if(n.kind==="array"){n.index<n.value.length&&(i.push({...n,index:n.index+1}),i.push({kind:"value",value:n.value[n.index]}));continue}if(n.kind==="object"){let r=n.iterator.next();r.done||(s+=8+Buffer.byteLength(r.value[0],"utf8"),i.push(n),i.push({kind:"value",value:r.value[1]}));continue}let e=n.value;if(e==null)s+=4;else if(typeof e=="string")s+=Buffer.byteLength(e,"utf8");else if(typeof e=="number"||typeof e=="bigint")s+=8;else if(typeof e=="boolean")s+=1;else if(typeof e=="object"){if(c.has(e))continue;if(c.add(e),ArrayBuffer.isView(e))s+=e.byteLength;else if(e instanceof ArrayBuffer||e instanceof SharedArrayBuffer)s+=e.byteLength;else if(Array.isArray(e)){if(e.length>Math.floor((t-s)/8))return t+1;s+=e.length*8,i.push({kind:"array",value:e,index:0})}else i.push({kind:"object",iterator:a(e)})}}return s}export{d as a};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as g}from"./chunk-3MRB66F4.js";import{c as p}from"./chunk-
|
|
3
|
+
import{a as g}from"./chunk-3MRB66F4.js";import{c as p}from"./chunk-ENEHPI32.js";import{a as h}from"./chunk-MROECM42.js";import{a as f}from"./chunk-PBOVSFTJ.js";var T={name:"time",async execute(r,s){let a="%e %M",o=null,u=!1,c=!1,t=0;for(;t<r.length;){let e=r[t];if(e==="-f"||e==="--format"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-f'
|
|
4
4
|
`,exitCode:1};a=r[t],t++}else if(e==="-o"||e==="--output"){if(t++,t>=r.length)return{stdout:"",stderr:`time: missing argument to '-o'
|
|
5
5
|
`,exitCode:1};o=r[t],t++}else if(e==="-a"||e==="--append")u=!0,t++;else if(e==="-v"||e==="--verbose")a=`Command being timed: %C
|
|
6
6
|
Elapsed (wall clock) time: %e seconds
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as i}from"./chunk-OHFB3M3X.js";var a=40,d=493,x=420,$=511;function e(t){if(!t||t==="/")return"/";let r=t.endsWith("/")&&t!=="/"?t.slice(0,-1):t;r.startsWith("/")||(r=`/${r}`);let n=r.split("/").filter(s=>s&&s!=="."),o=[];for(let s of n)s===".."?o.pop():o.push(s);return`/${o.join("/")}`||"/"}function m(t,r){let n=e(t),o=e(r);return o===n||n==="/"||o.startsWith(`${n}/`)}function E(t,r){if(t.includes("\0"))throw new i("ENOENT",`path contains null byte, ${r} '${t}'`)}function c(t){let r=e(t);if(r==="/")return"/";let n=r.lastIndexOf("/");return n===0?"/":r.slice(0,n)}function l(t){if(typeof process>"u"||process.platform!=="win32"||!/^[A-Za-z]:[\\/]/.test(t))return t;let r=t[0].toLowerCase(),n=t.slice(2).replace(/\\/g,"/");return`/${r}${n}`}function p(t,r){if(r=l(r),r.startsWith("/"))return e(r);let n=t==="/"?`/${r}`:`${t}/${r}`;return e(n)}function D(t){return t.replace(/\\/g,"/")}function u(t,r){return t==="/"?`/${r}`:`${t}/${r}`}function P(t,r){if(r.startsWith("/"))return e(r);let n=c(t);return e(u(n,r))}export{a,d as b,x as c,$ as d,e,m as f,E as g,c as h,p as i,D as j,u as k,P as l};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{f as Y}from"./chunk-47IFMQYS.js";import{a as K}from"./chunk-3MRB66F4.js";import{a as P,b as J,c as D}from"./chunk-
|
|
3
|
+
import{f as Y}from"./chunk-47IFMQYS.js";import{a as K}from"./chunk-3MRB66F4.js";import{a as P,b as J,c as D}from"./chunk-726WDFMQ.js";import{a as W}from"./chunk-623Q77WZ.js";import{b as N}from"./chunk-C2BLJ3AE.js";import{e as H}from"./chunk-O3PNT72D.js";import{d as Z}from"./chunk-AIWBN36Z.js";import{l as M}from"./chunk-FUT3X2GJ.js";import{a as G,b as T,e as _}from"./chunk-CPKBPQ2C.js";import{a as q,b as V,c as E}from"./chunk-MUFNRCMY.js";var X=Y({js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}}),j=class{types;constructor(){this.types=new Map(Object.entries(X).map(([t,s])=>[t,{extensions:[...s.extensions],globs:[...s.globs]}]))}addType(t){let s=t.indexOf(":");if(s===-1)return;let n=t.slice(0,s),r=t.slice(s+1);if(r.startsWith("include:")){let i=r.slice(8),l=this.types.get(i);if(l){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...l.extensions),o.globs.push(...l.globs),this.types.set(n,o)}}else{let i=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let l=r.slice(1);i.extensions.includes(l)||i.extensions.push(l)}else i.globs.includes(r)||i.globs.push(r);this.types.set(n,i)}}clearType(t){let s=this.types.get(t);s&&(s.extensions=[],s.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,s){let n=t.toLowerCase();for(let r of s){if(r==="all"){if(this.matchesAnyType(t))return!0;continue}let i=this.types.get(r);if(i){for(let l of i.extensions)if(n.endsWith(l))return!0;for(let l of i.globs)if(l.includes("*")){let o=l.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${o}$`,"i").test(t))return!0}else if(n===l.toLowerCase())return!0}}return!1}matchesAnyType(t){let s=t.toLowerCase();for(let n of this.types.values()){for(let r of n.extensions)if(s.endsWith(r))return!0;for(let r of n.globs)if(r.includes("*")){let i=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(W(`^${i}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function Q(){let e=[];for(let[t,s]of Object.entries(X).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(`
|
|
4
4
|
`)}
|
|
5
5
|
`}function ee(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:512*1024*1024,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function ue(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let s=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return s*1024;case"M":return s*1024*1024;case"G":return s*1024*1024*1024;default:return s}}function fe(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
6
6
|
`,exitCode:1}}function he(e,t){return!/^\d+$/.test(t)||!Number.isSafeInteger(Number(t))?{stdout:"",stderr:`rg: invalid --${e} value: ${t}
|
|
7
7
|
`,exitCode:1}:null}function te(e){return null}var se=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:te},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:te},{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:e=>Number(e),validate:e=>he("max-depth",e)},{long:"max-filesize",target:"maxFilesize",parse:ue,validate:fe},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",ignored:!0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],ge=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}]]),me=new Set(["n","--line-number"]);function pe(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function de(e,t,s){let n=e[t];for(let r of se){if(n.startsWith(`--${r.long}=`)){let i=n.slice(`--${r.long}=`.length),l=z(s,r,i);return l?{newIndex:t,error:l}:{newIndex:t}}if(r.short&&n.startsWith(`-${r.short}`)&&n.length>2){let i=n.slice(2),l=z(s,r,i);return l?{newIndex:t,error:l}:{newIndex:t}}if(r.short&&n===`-${r.short}`||n===`--${r.long}`){if(t+1>=e.length)return null;let i=e[t+1],l=z(s,r,i);return l?{newIndex:t+1,error:l}:{newIndex:t+1}}}return null}function ye(e){return se.find(t=>t.short===e)}function z(e,t,s){if(t.validate){let r=t.validate(s);if(r)return r}if(t.ignored||!t.target)return;let n=t.parse?t.parse(s):s;t.multi?e[t.target].push(n):e[t.target]=n}function xe(e,t){let s=e[t];if(s==="--sort"&&t+1<e.length){let n=e[t+1];if(n==="path"||n==="none")return{value:n,newIndex:t+1}}if(s.startsWith("--sort=")){let n=s.slice(7);if(n==="path"||n==="none")return{value:n,newIndex:t}}return null}function be(e,t){let s=e[t],n=s.match(/^-([ABC])(\d+)$/);return n?{flag:n[1],value:parseInt(n[2],10),newIndex:t}:(s==="-A"||s==="-B"||s==="-C")&&t+1<e.length?{flag:s[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function we(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function ne(e){let t=ee(),s=null,n=[],r=-1,i=-1,l=-1,o=!1;for(let a=0;a<e.length;a++){let c=e[a];if(c.startsWith("-")&&c!=="-"){let f=be(e,a);if(f){let{flag:u,value:w,newIndex:v}=f;u==="A"?r=Math.max(r,w):u==="B"?i=Math.max(i,w):l=w,a=v;continue}let h=we(c);if(h!==null){t.maxCount=h;continue}let m=de(e,a,t);if(m){if(m.error)return{success:!1,error:m.error};a=m.newIndex;continue}let y=xe(e,a);if(y){t.sort=y.value,a=y.newIndex;continue}let S=c.startsWith("--")?[c]:c.slice(1).split(""),b=!1;for(let u of S){if(me.has(u)){t.lineNumber=!0,o=!0;continue}if(u==="u"||u==="--unrestricted"){pe(t);continue}if(u==="P"||u==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
8
|
-
`,exitCode:1}};if(u.length===1){let v=ye(u);if(v){if(a+1>=e.length)return{success:!1,error:
|
|
9
|
-
`);for(let n of s){let r=n.replace(/\s+$/,"");if(!r||r.startsWith("#"))continue;let i=!1;r.startsWith("!")&&(i=!0,r=r.slice(1));let l=!1;r.endsWith("/")&&(l=!0,r=r.slice(0,-1));let o=!1;r.startsWith("/")?(o=!0,r=r.slice(1)):r.includes("/")&&!r.startsWith("**/")&&(o=!0);let a=this.patternToRegex(r,o);this.patterns.push({pattern:n,regex:a,negated:i,directoryOnly:l,rooted:o})}}patternToRegex(t,s){let n="";s?n="^":n="(?:^|/)";let r=0;for(;r<t.length;){let i=t[r];if(i==="*")t[r+1]==="*"?t[r+2]==="/"?(n+="(?:.*/)?",r+=3):(r+2>=t.length,n+=".*",r+=2):(n+="[^/]*",r++);else if(i==="?")n+="[^/]",r++;else if(i==="["){let l=r+1;for(l<t.length&&t[l]==="!"&&l++,l<t.length&&t[l]==="]"&&l++;l<t.length&&t[l]!=="]";)l++;if(l<t.length){let o=t.slice(r,l+1);o.startsWith("[!")&&(o=`[^${o.slice(2)}`),n+=o,r=l+1}else n+="\\[",r++}else i==="/"?(n+="/",r++):(n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r++)}return n+="(?:/.*)?$",W(n)}matches(t,s){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");let r=!1;for(let i of this.patterns)i.directoryOnly&&!s||i.regex.test(n)&&(r=!i.negated);return r}isWhitelisted(t,s){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");for(let r of this.patterns)if(!(r.directoryOnly&&!s)&&r.negated&&r.regex.test(n))return!0;return!1}getBasePath(){return this.basePath}},
|
|
8
|
+
`,exitCode:1}};if(u.length===1){let v=ye(u);if(v){if(a+1>=e.length)return{success:!1,error:E("rg",`-${u}`)};let g=z(t,v,e[a+1]);if(g)return{success:!1,error:g};a++,b=!0;continue}}let w=ge.get(u);if(w){w(t);continue}if(u.startsWith("--"))return{success:!1,error:E("rg",u)};if(u.length===1)return{success:!1,error:E("rg",`-${u}`)}}}else s===null&&t.patterns.length===0&&t.patternFiles.length===0?s=c:n.push(c)}return(r>=0||l>=0)&&(t.afterContext=Math.max(r>=0?r:0,l>=0?l:0)),(i>=0||l>=0)&&(t.beforeContext=Math.max(i>=0?i:0,l>=0?l:0)),s!==null&&t.patterns.push(s),(t.column||t.vimgrep)&&(o=!0),{success:!0,options:t,paths:n,explicitLineNumbers:o}}import{gunzipSync as ve}from"node:zlib";var A=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let s=t.split(`
|
|
9
|
+
`);for(let n of s){let r=n.replace(/\s+$/,"");if(!r||r.startsWith("#"))continue;let i=!1;r.startsWith("!")&&(i=!0,r=r.slice(1));let l=!1;r.endsWith("/")&&(l=!0,r=r.slice(0,-1));let o=!1;r.startsWith("/")?(o=!0,r=r.slice(1)):r.includes("/")&&!r.startsWith("**/")&&(o=!0);let a=this.patternToRegex(r,o);this.patterns.push({pattern:n,regex:a,negated:i,directoryOnly:l,rooted:o})}}patternToRegex(t,s){let n="";s?n="^":n="(?:^|/)";let r=0;for(;r<t.length;){let i=t[r];if(i==="*")t[r+1]==="*"?t[r+2]==="/"?(n+="(?:.*/)?",r+=3):(r+2>=t.length,n+=".*",r+=2):(n+="[^/]*",r++);else if(i==="?")n+="[^/]",r++;else if(i==="["){let l=r+1;for(l<t.length&&t[l]==="!"&&l++,l<t.length&&t[l]==="]"&&l++;l<t.length&&t[l]!=="]";)l++;if(l<t.length){let o=t.slice(r,l+1);o.startsWith("[!")&&(o=`[^${o.slice(2)}`),n+=o,r=l+1}else n+="\\[",r++}else i==="/"?(n+="/",r++):(n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r++)}return n+="(?:/.*)?$",W(n)}matches(t,s){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");let r=!1;for(let i of this.patterns)i.directoryOnly&&!s||i.regex.test(n)&&(r=!i.negated);return r}isWhitelisted(t,s){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");for(let r of this.patterns)if(!(r.directoryOnly&&!s)&&r.negated&&r.regex.test(n))return!0;return!1}getBasePath(){return this.basePath}},O=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(t,s,n=!1,r=!1){this.fs=t,this.skipDotIgnore=n,this.skipVcsIgnore=r}async load(t){let s=[],n=t;for(;;){s.unshift(n);let i=this.fs.resolvePath(n,"..");if(i===n)break;n=i}let r=[];this.skipVcsIgnore||r.push(".gitignore"),this.skipDotIgnore||r.push(".rgignore",".ignore");for(let i of s){this.loadedDirs.add(i);for(let l of r){let o=this.fs.resolvePath(i,l);try{let a=await this.fs.readFile(o),c=new A(i);c.parse(a),this.parsers.push(c)}catch{}}}}async loadForDirectory(t){if(this.loadedDirs.has(t))return;this.loadedDirs.add(t);let s=[];this.skipVcsIgnore||s.push(".gitignore"),this.skipDotIgnore||s.push(".rgignore",".ignore");for(let n of s){let r=this.fs.resolvePath(t,n);try{let i=await this.fs.readFile(r),l=new A(t);l.parse(i),this.parsers.push(l)}catch{}}}addPatternsFromContent(t,s){let n=new A(s);n.parse(t),this.parsers.push(n)}matches(t,s){for(let n of this.parsers){let r=n.getBasePath();if(!t.startsWith(r))continue;let i=t.slice(r.length).replace(/^\//,"");if(n.matches(i,s))return!0}return!1}isWhitelisted(t,s){for(let n of this.parsers){let r=n.getBasePath();if(!t.startsWith(r))continue;let i=t.slice(r.length).replace(/^\//,"");if(n.isWhitelisted(i,s))return!0}return!1}static isCommonIgnored(t){return new Set(["node_modules",".git",".svn",".hg","__pycache__",".pytest_cache",".mypy_cache","venv",".venv",".next",".nuxt",".cargo"]).has(t)}};async function R(e,t,s=!1,n=!1,r=[]){let i=new O(e,t,s,n);await i.load(t);for(let l of r)try{let o=e.resolvePath(t,l),a=await e.readFile(o);i.addPatternsFromContent(a,t)}catch{}return i}function Se(e){return e.length>=2&&e[0]===31&&e[1]===139}function Ce(e){let t=!1;for(let s=0;s<e.length;s++){let n=e[s];n==="["&&!t?t=!0:n==="]"&&t&&(t=!1)}return t?`rg: glob '${e}' has an unclosed character class`:null}function re(e,t){if(!Number.isSafeInteger(t)||t<0||t>e.limits.maxStringLength||t>Math.floor(e.limits.maxLiveBytes/3))throw new M(t>e.limits.maxStringLength?`rg: pattern file exceeds string limit (${e.limits.maxStringLength} bytes)`:`rg: live byte limit exceeded (${e.limits.maxLiveBytes} bytes)`,"string_length");return e.executionScope?.reserveBytes("rg pattern files",t*3,"rg")??{release:()=>{}}}function Ie(e,t,s){let n=0;for(let r=0;r<=t.length;r++)if(!(r<t.length&&t.charCodeAt(r)!==10)){if(r>n){if(e.length>=s.limits.maxArrayElements)throw new M(`rg: pattern limit exceeded (${s.limits.maxArrayElements})`,"iterations");s.executionScope?.consumeWork(1,"rg pattern insertion"),e.push(t.slice(n,r))}n=r+1}}function ie(e,t,s){if(t>e.limits.maxInputBytes-s)throw new M(`rg: aggregate input size limit exceeded (${e.limits.maxInputBytes} bytes)`,"string_length");return e.executionScope?.consumeInput(t,"rg pattern files"),s+t}async function le(e){let{ctx:t,options:s,paths:n,explicitLineNumbers:r}=e;for(let g of s.globs){let d=g.startsWith("!")?g.slice(1):g,x=Ce(d);if(x)return{stdout:"",stderr:`${x}
|
|
10
10
|
`,exitCode:1}}if(s.files){let g=[...s.patterns,...n];return Me(t,g,s)}if(s.patterns.length>t.limits.maxArrayElements)throw new M(`rg: pattern limit exceeded (${t.limits.maxArrayElements})`,"iterations");let i=s.patterns.slice(),l=[],o=0,a,c;try{for(let d of s.patternFiles)try{let x,p;if(d==="-")x=t.stdin,p=t.stdin.length,o=ie(t,p,o);else{let $=t.fs.resolvePath(t.cwd,d);p=(await t.fs.stat($)).size,o=ie(t,p,o);let I=re(t,p);l.push(I),x=await _(t.fs,$);let B=x.length;if(B>p)throw new M("rg: pattern file grew while being read","string_length");p=B}d==="-"&&l.push(re(t,p));let C=T(x,t.limits.maxStringLength);t.executionScope?.consumeWork(C.length,"rg pattern file parsing"),Ie(i,C,t)}catch(x){return N(x),{stdout:"",stderr:`rg: ${d}: No such file or directory
|
|
11
11
|
`,exitCode:2}}if(i.length===0)return s.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`rg: no pattern given
|
|
12
12
|
`,exitCode:2};let g=Fe(s,i);try{let d=$e(i,s,g);a=d.regex,c=d.kResetGroup}catch{return{stdout:"",stderr:`rg: invalid regex: ${i.join(", ")}
|
|
13
13
|
`,exitCode:2}}}finally{for(let g of l)g.release()}let f=s.patternFiles.includes("-"),h=T(t.stdin);if(n.length===0&&h.length>0&&!f){let d=P(h,a,{invertMatch:s.invertMatch,showLineNumbers:s.lineNumber,countOnly:s.count,countMatches:s.countMatches,filename:"",onlyMatching:s.onlyMatching,beforeContext:s.beforeContext,afterContext:s.afterContext,maxCount:s.maxCount,contextSeparator:s.contextSeparator,showColumn:s.column,vimgrep:s.vimgrep,showByteOffset:s.byteOffset,replace:s.replace!==null?D(s.replace):null,passthru:s.passthru,multiline:s.multiline,kResetGroup:c,maxWork:t.limits.maxLoopIterations,maxMatches:t.limits.maxArrayElements,signal:t.signal});return s.quiet?{stdout:"",stderr:"",exitCode:d.matched?0:1}:s.filesWithMatches?{stdout:d.matched?`(standard input)
|
|
14
14
|
`:"",stderr:"",exitCode:d.matched?0:1}:s.filesWithoutMatch?{stdout:d.matched?"":`(standard input)
|
|
15
|
-
`,stderr:"",exitCode:d.matched?1:0}:{stdout:d.output,stderr:"",exitCode:d.matched?0:1}}let m=n.length===0?["."]:n,y=null;s.noIgnore||(y=await R(t.fs,t.cwd,s.noIgnoreDot,s.noIgnoreVcs,s.ignoreFiles));let S=new
|
|
16
|
-
`,a=new
|
|
15
|
+
`,stderr:"",exitCode:d.matched?1:0}:{stdout:d.output,stderr:"",exitCode:d.matched?0:1}}let m=n.length===0?["."]:n,y=null;s.noIgnore||(y=await R(t.fs,t.cwd,s.noIgnoreDot,s.noIgnoreVcs,s.ignoreFiles));let S=new j;for(let g of s.typeClear)S.clearType(g);for(let g of s.typeAdd)S.addType(g);let{files:b,singleExplicitFile:u}=await oe(t,m,s,y,S);if(b.length===0)return{stdout:"",stderr:"",exitCode:1};let w=!s.noFilename&&(s.withFilename||!u||b.length>1),v=s.lineNumber;return r||(u&&b.length===1&&(v=!1),s.onlyMatching&&(v=!1)),We(t,b,a,s,w,v,c)}function Fe(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(s=>/[A-Z]/.test(s)):!1}function $e(e,t,s){let n;return e.length===1?n=e[0]:n=e.map(r=>t.fixedStrings?r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${r})`).join("|"),J(n,{mode:t.fixedStrings&&e.length===1?"fixed":"perl",ignoreCase:s,wholeWord:t.wordRegexp,lineRegexp:t.lineRegexp,multiline:t.multiline,multilineDotall:t.multilineDotall})}async function oe(e,t,s,n,r){let i=[],l=new Z({limits:e.limits,signal:e.signal,executionScope:e.executionScope,site:"rg"}),o=0,a=0;for(let f of t){l.checkpoint();let h=e.fs.resolvePath(e.cwd,f);try{let m=await e.fs.stat(h);if(m.isFile){if(o++,s.maxFilesize>0&&m.size>s.maxFilesize)continue;if(ce(f,s,n,h,r)){if(i.length>=e.limits.maxArrayElements)throw new M(`rg: file collection limit exceeded (${e.limits.maxArrayElements})`,"array_elements");i.push(f)}}else m.isDirectory&&(a++,await ae(e,f,h,0,s,n,r,i,l,new Set))}catch(m){N(m)}}return{files:s.sort==="path"?i.sort():i,singleExplicitFile:o===1&&a===0}}async function ae(e,t,s,n,r,i,l,o,a,c){if(n>=r.maxDepth)return;a.visit(n);let f;if(r.followSymlinks)try{let h=await e.fs.stat(s);if(f=h.identity!==void 0?`identity:${h.identity}`:h.dev!==void 0&&h.ino!==void 0?`inode:${String(h.dev)}:${String(h.ino)}`:`path:${await e.fs.realpath(s)}`,c.has(f))return;c.add(f)}catch(h){N(h);return}i&&await i.loadForDirectory(s);try{let h=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(s):(await e.fs.readdir(s)).map(m=>({name:m,isFile:void 0}));for(let m of h){a.checkpoint();let y=m.name;if(!r.noIgnore&&O.isCommonIgnored(y))continue;let S=y.startsWith("."),b=t==="."?y:t==="./"?`./${y}`:t.endsWith("/")?`${t}${y}`:`${t}/${y}`,u=e.fs.resolvePath(s,y),w,v,g=!1;if(m.isFile!==void 0&&"isDirectory"in m){let p=m;if(g=p.isSymbolicLink===!0,g&&!r.followSymlinks)continue;if(g&&r.followSymlinks)try{let C=await e.fs.stat(u);w=C.isFile,v=C.isDirectory}catch{continue}else w=p.isFile,v=p.isDirectory}else try{let p=e.fs.lstat?await e.fs.lstat(u):await e.fs.stat(u);if(g=p.isSymbolicLink===!0,g&&!r.followSymlinks)continue;let C=g&&r.followSymlinks?await e.fs.stat(u):p;w=C.isFile,v=C.isDirectory}catch{continue}if(!i?.matches(u,v)&&!(S&&!r.hidden&&!i?.isWhitelisted(u,v))){if(v)await ae(e,b,u,n+1,r,i,l,o,a,c);else if(w){if(a.visit(n+1),r.maxFilesize>0)try{if((await e.fs.stat(u)).size>r.maxFilesize)continue}catch{continue}if(ce(b,r,i,u,l)){if(o.length>=e.limits.maxArrayElements)throw new M(`rg: file collection limit exceeded (${e.limits.maxArrayElements})`,"array_elements");o.push(b)}}}}}catch(h){N(h)}finally{f!==void 0&&c.delete(f)}}function ce(e,t,s,n,r){let i=e.split("/").pop()||e;if(s?.matches(n,!1)||t.types.length>0&&!r.matchesType(i,t.types)||t.typesNot.length>0&&r.matchesType(i,t.typesNot))return!1;if(t.globs.length>0){let l=t.globCaseInsensitive,o=t.globs.filter(c=>!c.startsWith("!")),a=t.globs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(o.length>0){let c=!1;for(let f of o)if(F(i,f,l)||F(e,f,l)){c=!0;break}if(!c)return!1}for(let c of a)if(c.startsWith("/")){let f=c.slice(1);if(F(e,f,l))return!1}else if(F(i,c,l)||F(e,c,l))return!1}if(t.iglobs.length>0){let l=t.iglobs.filter(a=>!a.startsWith("!")),o=t.iglobs.filter(a=>a.startsWith("!")).map(a=>a.slice(1));if(l.length>0){let a=!1;for(let c of l)if(F(i,c,!0)||F(e,c,!0)){a=!0;break}if(!a)return!1}for(let a of o)if(a.startsWith("/")){let c=a.slice(1);if(F(e,c,!0))return!1}else if(F(i,a,!0)||F(e,a,!0))return!1}return!0}function F(e,t,s=!1){let n="^";for(let r=0;r<t.length;r++){let i=t[r];if(i==="*")t[r+1]==="*"?(n+=".*",r++):n+="[^/]*";else if(i==="?")n+="[^/]";else if(i==="["){let l=r+1;for(l<t.length&&t[l]==="!"&&l++,l<t.length&&t[l]==="]"&&l++;l<t.length&&t[l]!=="]";)l++;if(l<t.length){let o=t.slice(r,l+1);o.startsWith("[!")&&(o=`[^${o.slice(2)}`),n+=o,r=l}else n+="\\["}else n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return n+="$",W(n,s?"i":"").test(e)}async function Me(e,t,s){let n=null;s.noIgnore||(n=await R(e.fs,e.cwd,s.noIgnoreDot,s.noIgnoreVcs,s.ignoreFiles));let r=new j;for(let f of s.typeClear)r.clearType(f);for(let f of s.typeAdd)r.addType(f);let i=t.length===0?["."]:t,{files:l}=await oe(e,i,s,n,r);if(l.length===0)return{stdout:"",stderr:"",exitCode:1};if(s.quiet)return{stdout:"",stderr:"",exitCode:0};let o=s.nullSeparator?"\0":`
|
|
16
|
+
`,a=new H(Math.min(e.limits.maxOutputSize,e.limits.maxStringLength),"rg");for(let f of l)a.append(f).append(o);return{stdout:a.build(),stderr:"",exitCode:0}}function ke(e,t){if(t.length===0)return!0;for(let s of t)if(F(e,s,!1))return!0;return!1}async function Le(e,t,s,n){let r;try{if(n.preprocessor&&e.exec){let f=s.split("/").pop()||s;if(ke(f,n.preprocessorGlobs)){let h=await e.exec(K([n.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]});if(h.exitCode===0&&h.stdout){r=e.executionScope?.reserveBytes("rg preprocessor text",h.stdout.length,"rg preprocessor");let m=T(h.stdout);e.executionScope?.consumeInput(G(m),"rg preprocessor");let y=m.slice(0,8192);return{content:m,isBinary:y.includes("\0"),lease:r}}}}if(n.searchZip&&s.endsWith(".gz")){let f=await e.fs.stat(t),h=e.executionScope?.reserveBytes("rg compressed input",f.size,"rg"),m=await e.fs.readFileBuffer(t);if(m.byteLength>f.size)throw h?.release(),new M("rg: file grew while being read","string_length");if(e.executionScope?.consumeInput(m.byteLength,"rg"),Se(m)){let y;try{let S=Math.min(e.limits.maxStringLength,e.limits.maxOutputSize,Math.floor((e.executionScope?.remainingLiveBytes??e.limits.maxLiveBytes)/2));y=e.executionScope?.reserveBytes("rg decompressed text",S*2,"rg");let b=ve(m,{maxOutputLength:S}),u=new TextDecoder().decode(b),w=u.slice(0,8192);return{content:u,isBinary:w.includes("\0"),lease:Ne(h,y)}}catch(S){return y?.release(),h?.release(),N(S),null}}h?.release()}let i=await e.fs.stat(t);r=e.executionScope?.reserveBytes("rg file text",i.size*2,"rg");let l=await _(e.fs,t),o=l.length;if(o>i.size)throw new M("rg: file grew while being read","string_length");e.executionScope?.consumeInput(o,"rg");let a=T(l,e.limits.maxStringLength),c=a.slice(0,8192);return{content:a,isBinary:c.includes("\0"),lease:r}}catch(i){return r?.release(),N(i),null}}function Ne(...e){let t=e.filter(s=>s!==void 0);if(t.length!==0)return{release:()=>{for(let s of t)s.release()}}}async function We(e,t,s,n,r,i,l){let o="",a=!1,c=[],f=0,h=0,m=0,y=n.searchZip?2:50;e:for(let u=0;u<t.length;u+=y){let w=t.slice(u,u+y),v=await Promise.all(w.map(async g=>{let d=e.fs.resolvePath(e.cwd,g),x=await Le(e,d,g,n);if(!x)return null;let{content:p,isBinary:C,lease:$}=x;if(m+=p.length,C&&!n.searchBinary)return $?.release(),null;let L=r&&!n.heading?g:"";try{let I=P(p,s,{invertMatch:n.invertMatch,showLineNumbers:i,countOnly:n.count,countMatches:n.countMatches,filename:L,onlyMatching:n.onlyMatching,beforeContext:n.beforeContext,afterContext:n.afterContext,maxCount:n.maxCount,contextSeparator:n.contextSeparator,showColumn:n.column,vimgrep:n.vimgrep,showByteOffset:n.byteOffset,replace:n.replace!==null?D(n.replace):null,passthru:n.passthru,multiline:n.multiline,kResetGroup:l,maxWork:e.limits.maxLoopIterations,maxMatches:e.limits.maxArrayElements,signal:e.signal});return n.json&&I.matched?{file:g,result:I,content:p,isBinary:!1,lease:$}:($?.release(),{file:g,result:I})}catch(I){throw $?.release(),I}}));for(let g of v){if(!g)continue;let{file:d,result:x}=g;if(x.matched){if(a=!0,h++,f+=x.matchCount,n.quiet&&!n.json)break e;if(n.json&&!n.quiet){let p=g.content||"";c.push(JSON.stringify({type:"begin",data:{path:{text:d}}}));let C=p.split(`
|
|
17
17
|
`);s.lastIndex=0;let $=0;for(let L=0;L<C.length;L++){let I=C[L];s.lastIndex=0;let B=[];for(let k=s.exec(I);k!==null;k=s.exec(I)){let U={match:{text:k[0]},start:k.index,end:k.index+k[0].length};n.replace!==null&&(U.replacement={text:n.replace}),B.push(U),k[0].length===0&&s.lastIndex++}if(B.length>0){let k={type:"match",data:{path:{text:d},lines:{text:`${I}
|
|
18
18
|
`},line_number:L+1,absolute_offset:$,submatches:B}};c.push(JSON.stringify(k))}$+=I.length+1}c.push(JSON.stringify({type:"end",data:{path:{text:d},binary_offset:null,stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:1,searches_with_match:1,bytes_searched:p.length,bytes_printed:0,matched_lines:x.matchCount,matches:x.matchCount}}}))}else if(n.filesWithMatches){let p=n.nullSeparator?"\0":`
|
|
19
19
|
`;o+=`${d}${p}`}else n.filesWithoutMatch||(n.heading&&!n.noFilename&&(o+=`${d}
|
|
@@ -33,4 +33,5 @@ EXAMPLES:
|
|
|
33
33
|
rg -t js foo Search only JavaScript files
|
|
34
34
|
rg -g '*.ts' foo Search files matching glob
|
|
35
35
|
rg --hidden foo Include hidden files
|
|
36
|
-
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"]},lt={name:"rg",async execute(e,t){if(
|
|
36
|
+
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"]},lt={handlesOwnVersion:!0,name:"rg",async execute(e,t){if(V(e))return q(Be);if(e.includes("--version")||e.includes("-V"))return{stdout:`rg (just-bash)
|
|
37
|
+
`,stderr:"",exitCode:0};if(e.includes("--type-list"))return{stdout:Q(),stderr:"",exitCode:0};let s=ne(e);return s.success?le({ctx:t,options:s.options,paths:s.paths,explicitLineNumbers:s.explicitLineNumbers}):s.error}},ot={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{lt as a,ot as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
var t=class extends Error{code="ENOSYS";constructor(e,r){super(`ENOSYS: filesystem cannot create entries atomically, ${r} '${e}'`),this.name="ExclusiveCreateUnsupportedError"}};async function a(c,e,r){if(!c.createExclusive)throw new t(e,r.directory?"mkdir":"open");await c.createExclusive(e,r)}export{t as a,a as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as w}from"./chunk-QES5OSUC.js";import{b as m}from"./chunk-
|
|
3
|
+
import{a as w}from"./chunk-QES5OSUC.js";import{b as m}from"./chunk-C2BLJ3AE.js";import{e as v}from"./chunk-O3PNT72D.js";import{e as B}from"./chunk-AIWBN36Z.js";import{l as z}from"./chunk-FUT3X2GJ.js";import{a as L}from"./chunk-NE4R2FVV.js";import{a as F,b as E}from"./chunk-MUFNRCMY.js";import{constants as C,gunzipSync as _,gzipSync as A}from"node:zlib";var D={name:"gzip",summary:"compress or expand files",usage:"gzip [OPTION]... [FILE]...",description:`Compress FILEs (by default, in-place).
|
|
4
4
|
|
|
5
5
|
When no FILE is given, or when FILE is -, read from standard input.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as m}from"./chunk-
|
|
3
|
+
import{a as m}from"./chunk-623Q77WZ.js";import{b as x}from"./chunk-C2BLJ3AE.js";import{a as w}from"./chunk-PBOVSFTJ.js";var k={name:"expr",async execute(i,a){if(i.length===0)return{stdout:"",stderr:`expr: missing operand
|
|
4
4
|
`,exitCode:2};try{let t=S(i,h=>a.executionScope?.consumeWork(h,"expr index")),f=t==="0"||t===""?1:0;return{stdout:`${t}
|
|
5
5
|
`,stderr:"",exitCode:f}}catch(t){return x(t),{stdout:"",stderr:`expr: ${w(t.message)}
|
|
6
6
|
`,exitCode:2}}}};function S(i,a){if(i.length===1)return i[0];let t=0;function f(){let e=h();for(;t<i.length&&i[t]==="|";){t++;let r=h();if(e!=="0"&&e!=="")return e;e=r}return e}function h(){let e=g();for(;t<i.length&&i[t]==="&";){t++;let r=g();(e==="0"||e===""||r==="0"||r==="")&&(e="0")}return e}function g(){let e=p();for(;t<i.length;){let r=i[t];if(["=","!=","<",">","<=",">="].includes(r)){t++;let s=p(),o=parseInt(e,10),n=parseInt(s,10),l=!Number.isNaN(o)&&!Number.isNaN(n),c;r==="="?c=l?o===n:e===s:r==="!="?c=l?o!==n:e!==s:r==="<"?c=l?o<n:e<s:r===">"?c=l?o>n:e>s:r==="<="?c=l?o<=n:e<=s:c=l?o>=n:e>=s,e=c?"1":"0"}else break}return e}function p(){let e=N();for(;t<i.length;){let r=i[t];if(r==="+"||r==="-"){t++;let s=N(),o=parseInt(e,10),n=parseInt(s,10);if(Number.isNaN(o)||Number.isNaN(n))throw new Error("non-integer argument");e=String(r==="+"?o+n:o-n)}else break}return e}function N(){let e=d();for(;t<i.length;){let r=i[t];if(r==="*"||r==="/"||r==="%"){t++;let s=d(),o=parseInt(e,10),n=parseInt(s,10);if(Number.isNaN(o)||Number.isNaN(n))throw new Error("non-integer argument");if((r==="/"||r==="%")&&n===0)throw new Error("division by zero");r==="*"?e=String(o*n):r==="/"?e=String(Math.trunc(o/n)):e=String(o%n)}else break}return e}function d(){let e=u();for(;t<i.length&&i[t]===":";){t++;let r=u(),o=m(`^${r}`).match(e);o?e=o[1]!==void 0?o[1]:String(o[0].length):e="0"}return e}function u(){if(t>=i.length)throw new Error("syntax error");let e=i[t];if(e==="match"){t++;let r=u(),s=u(),n=m(s).match(r);return n?n[1]!==void 0?n[1]:String(n[0].length):"0"}if(e==="substr"){t++;let r=u(),s=parseInt(u(),10),o=parseInt(u(),10);if(Number.isNaN(s)||Number.isNaN(o))throw new Error("non-integer argument");return r.substring(s-1,s-1+o)}if(e==="index"){t++;let r=u(),s=u();a(s.length+r.length);let o=new Set;for(let n=0;n<s.length;n++)o.add(s[n]);for(let n=0;n<r.length;n++)if(o.has(r[n]))return String(n+1);return"0"}if(e==="length"){t++;let r=u();return String(r.length)}if(e==="("){t++;let r=f();if(t>=i.length||i[t]!==")")throw new Error("syntax error");return t++,r}return t++,e}let b=f();if(t!==i.length)throw new Error("syntax error");return b}var C={name:"expr",flags:[],needsArgs:!0};export{k as a,C as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as m}from"./chunk-NE4R2FVV.js";import{a as p,b as d}from"./chunk-MUFNRCMY.js";var y={name:"which",summary:"locate a command",usage:"which [-as] program ...",options:["-a List all instances of executables found","-s No output, just return 0 if found, 1 if not","--help display this help and exit"]},x={showAll:{short:"a",type:"boolean"},silent:{short:"s",type:"boolean"}},a=null;async function A(){return a||(a=(await import("./builtin-manifest-ORBIZM7I.js")).SHELL_BUILTINS),a}var L={name:"which",async execute(n,o){if(d(n))return p(y);let t=m("which",n,x);if(!t.ok)return t.error;let g=t.result.flags.showAll,i=t.result.flags.silent,r=t.result.positional;if(r.length===0)return{stdout:"",stderr:"",exitCode:1};let w=await A(),b=(o.env.get("PATH")||"/usr/bin:/bin").split(":"),l="",h="",f=!0;for(let e of r){let s=!1;for(let u of b){if(!u)continue;let c=o.fs.resolvePath(u,e);if(await o.fs.exists(c)&&(s=!0,i||(l+=`${c}
|
|
4
|
+
`),!g))break}!s&&w.has(e)&&(s=!0,i||(l+=`${e}: shell builtin
|
|
5
|
+
`)),s||(i||(h+=`which: no ${e} in this sandboxed bash environment
|
|
6
|
+
`),f=!1)}return{stdout:l,stderr:h,exitCode:f?0:1}}},B={name:"which",flags:[{flag:"-a",type:"boolean"},{flag:"-s",type:"boolean"}],needsArgs:!0};export{L as a,B as b};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{c as n}from"./chunk-OHFB3M3X.js";import{a as g}from"./chunk-I4IRHQDW.js";import{a as d}from"./chunk-PBOVSFTJ.js";import{a as u}from"./chunk-NE4R2FVV.js";var b={recursive:{short:"r",long:"recursive",type:"boolean"},recursiveUpper:{short:"R",type:"boolean"},force:{short:"f",long:"force",type:"boolean"},verbose:{short:"v",long:"verbose",type:"boolean"}},C={name:"rm",async execute(v,s){let e=u("rm",v,b);if(!e.ok)return e.error;let l=e.result.flags.recursive||e.result.flags.recursiveUpper,a=e.result.flags.force,y=e.result.flags.verbose,f=e.result.positional;if(f.length===0)return a?{stdout:"",stderr:"",exitCode:0}:{stdout:"",stderr:`rm: missing operand
|
|
4
|
+
`,exitCode:1};let c="",t="",i=0;for(let r of f)try{let o=s.fs.resolvePath(s.cwd,r);if((await s.fs.stat(o)).isDirectory&&!l){t+=`rm: cannot remove '${r}': Is a directory
|
|
5
|
+
`,i=1;continue}await s.fs.rm(o,{recursive:l,force:a}),y&&(c+=`removed '${r}'
|
|
6
|
+
`)}catch(o){let m=g(o),p=n(o,"ENOENT");if(a&&p)continue;p?t+=`rm: cannot remove '${r}': No such file or directory
|
|
7
|
+
`:n(o,"ENOTEMPTY")?t+=`rm: cannot remove '${r}': Directory not empty
|
|
8
|
+
`:n(o,"EROFS")?t+=`rm: cannot remove '${r}': Read-only file system
|
|
9
|
+
`:t+=`rm: cannot remove '${r}': ${d(m)}
|
|
10
|
+
`,i=1}return{stdout:c,stderr:t,exitCode:i}}},N={name:"rm",flags:[{flag:"-r",type:"boolean"},{flag:"-R",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-v",type:"boolean"}],needsArgs:!0};export{C as a,N as b};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{b as A}from"./chunk-
|
|
3
|
+
import{b as A}from"./chunk-C2BLJ3AE.js";import{l as f}from"./chunk-FUT3X2GJ.js";import{a as z,b as T}from"./chunk-CPKBPQ2C.js";import{a as _}from"./chunk-PBOVSFTJ.js";import{a as B}from"./chunk-NE4R2FVV.js";import{a as M,b as q}from"./chunk-MUFNRCMY.js";var L={name:"tr",summary:"translate or delete characters",usage:"tr [OPTION]... SET1 [SET2]",options:["-c, -C, --complement use the complement of SET1","-d, --delete delete characters in SET1","-s, --squeeze-repeats squeeze repeated characters"," --help display this help and exit"],description:`SET syntax:
|
|
4
4
|
a-z character range
|
|
5
5
|
[:alnum:] all letters and digits
|
|
6
6
|
[:alpha:] all letters
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-
|
|
3
|
+
import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k,k as ie,l as ae}from"./chunk-IOFXLMNJ.js";import{b as V,d as Qe}from"./chunk-5NWK7A4R.js";import{d as Ge,f as Xe,g as oe}from"./chunk-47IFMQYS.js";import{a as Z}from"./chunk-623Q77WZ.js";import{b as Ye}from"./chunk-2UV6ZFHK.js";import{b as q}from"./chunk-C2BLJ3AE.js";import{a as W,d as se,e as re}from"./chunk-O3PNT72D.js";import{l as E}from"./chunk-FUT3X2GJ.js";import{a as K,b as Y}from"./chunk-CPKBPQ2C.js";import{a as J,b as ne}from"./chunk-MUFNRCMY.js";var G=class{input;pos=0;tokens=[];maxSourceLength;maxTokens;constructor(t,n={}){this.input=t,this.maxSourceLength=n.maxSourceLength??1024*1024,this.maxTokens=n.maxTokens??1e5}tokenize(){if(this.input.length>this.maxSourceLength)throw new E(`xan: expression length limit exceeded (${this.maxSourceLength})`,"string_length");for(;this.pos<this.input.length&&(this.skipWhitespace(),!(this.pos>=this.input.length));){let t=this.nextToken();t&&(this.assertTokenCapacity(),this.tokens.push(t))}return this.assertTokenCapacity(),this.tokens.push({type:"eof",value:"",pos:this.pos}),this.tokens}assertTokenCapacity(){if(this.tokens.length>=this.maxTokens)throw new E(`xan: expression token limit exceeded (${this.maxTokens})`,"array_elements")}skipWhitespace(){for(;this.pos<this.input.length;){let t=this.input[this.pos];if(t===" "||t===" "||t===`
|
|
4
4
|
`||t==="\r")this.pos++;else if(t==="#")for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
5
5
|
`;)this.pos++;else break}}nextToken(){let t=this.pos,n=this.input[this.pos];if(n>="0"&&n<="9")return this.readNumber();if(n==='"'||n==="'"||n==="`")return this.readString(n);if(n==="b"&&this.pos+1<this.input.length){let o=this.input[this.pos+1];if(o==='"'||o==="'"||o==="`")return this.pos++,this.readString(o)}if(n==="/"){let o=this.tokens[this.tokens.length-1];return o&&(o.type==="int"||o.type==="float"||o.type==="string"||o.type==="ident"||o.type===")"||o.type==="]")?this.input[this.pos+1]==="/"?(this.pos+=2,{type:"//",value:"//",pos:t}):(this.pos++,{type:"/",value:"/",pos:t}):this.readRegex()}if(this.match("not in"))return{type:"not in",value:"not in",pos:t};if(this.match("=>"))return{type:"=>",value:"=>",pos:t};if(this.match("**"))return{type:"**",value:"**",pos:t};if(this.match("++"))return{type:"++",value:"++",pos:t};if(this.match("//"))return{type:"//",value:"//",pos:t};if(this.match("=="))return{type:"==",value:"==",pos:t};if(this.match("!="))return{type:"!=",value:"!=",pos:t};if(this.match("<="))return{type:"<=",value:"<=",pos:t};if(this.match(">="))return{type:">=",value:">=",pos:t};if(this.match("&&"))return{type:"&&",value:"&&",pos:t};if(this.match("||"))return{type:"||",value:"||",pos:t};let r=new Map([["(","("],[")",")"],["[","["],["]","]"],["{","{"],["}","}"],[",",","],[":",":"],[";",";"],["+","+"],["-","-"],["*","*"],["%","%"],["<","<"],[">",">"],["!","!"],[".","."],["|","|"],["=","="]]).get(n);if(r!==void 0)return this.pos++,{type:r,value:n,pos:t};if(this.isIdentStart(n))return this.readIdentifier();throw new Error(`Unexpected character '${n}' at position ${this.pos}`)}match(t){if(this.input.slice(this.pos,this.pos+t.length)===t){if(/^[a-zA-Z]/.test(t)){let n=this.input[this.pos+t.length];if(n&&this.isIdentChar(n))return!1}return this.pos+=t.length,!0}return!1}isIdentStart(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="_"}isIdentChar(t){return this.isIdentStart(t)||t>="0"&&t<="9"}readNumber(){let t=this.pos,n=!1,s=!1;for(;this.pos<this.input.length;){let o=this.input[this.pos];if(o>="0"&&o<="9")this.pos++;else if(o==="_")this.pos++;else if(o==="."&&!n&&!s)n=!0,this.pos++;else if((o==="e"||o==="E")&&!s)s=!0,n=!0,this.pos++,this.pos<this.input.length&&(this.input[this.pos]==="+"||this.input[this.pos]==="-")&&this.pos++;else break}let r=this.input.slice(t,this.pos).replace(/_/g,"");return{type:n?"float":"int",value:r,pos:t}}readString(t){let n=this.pos;this.pos++;let s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r===t)return this.pos++,{type:"string",value:s,pos:n};if(r==="\\"){if(this.pos++,this.pos<this.input.length){let o=this.input[this.pos];switch(o){case"n":s+=`
|
|
6
6
|
`;break;case"r":s+="\r";break;case"t":s+=" ";break;case"\\":s+="\\";break;case'"':s+='"';break;case"'":s+="'";break;case"`":s+="`";break;case"0":s+="\0";break;default:s+=o}this.pos++}}else s+=r,this.pos++}throw new Error(`Unterminated string starting at position ${n}`)}readRegex(){let t=this.pos;this.pos++;let n="",s="";for(;this.pos<this.input.length;){let r=this.input[this.pos];if(r==="/"){for(this.pos++;this.pos<this.input.length&&this.input[this.pos]==="i";)s+=this.input[this.pos],this.pos++;return{type:"regex",value:n+(s?`/${s}`:""),pos:t}}r==="\\"?(n+=r,this.pos++,this.pos<this.input.length&&(n+=this.input[this.pos],this.pos++)):(n+=r,this.pos++)}throw new Error(`Unterminated regex starting at position ${t}`)}readIdentifier(){let t=this.pos;for(;this.pos<this.input.length&&this.isIdentChar(this.input[this.pos]);)this.pos++;let n=!1;this.pos<this.input.length&&this.input[this.pos]==="?"&&(n=!0,this.pos++);let s=this.input.slice(t,n?this.pos-1:this.pos);n&&(s+="?");let r=new Map([["true","true"],["false","false"],["null","null"],["and","and"],["or","or"],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["in","in"],["as","as"],["_","_"]]),o=s.replace(/\?$/,""),i=r.get(o);return i!==void 0&&!n?{type:i,value:o,pos:t}:{type:"ident",value:s,pos:t}}};function z(e){return{maxSourceLength:e.limits.maxStringLength,maxTokens:e.limits.maxQueryTokens,maxAstNodes:e.limits.maxQueryElements,maxOperations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth}}var D={PIPE:1,OR:2,AND:3,EQUALITY:4,COMPARISON:5,ADDITIVE:6,MULTIPLICATIVE:7,POWER:8,UNARY:9,POSTFIX:10},ee=class{pos=0;tokens;depth=0;operations=0;astNodes=0;limits;constructor(t,n={}){this.tokens=t,this.limits={maxSourceLength:n.maxSourceLength??1024*1024,maxTokens:n.maxTokens??1e5,maxDepth:n.maxDepth??100,maxOperations:n.maxOperations??1e5,maxAstNodes:n.maxAstNodes??1e5};let s=0;for(let r of t)this.useOperation(),r.type==="("||r.type==="["||r.type==="{"?(s++,s>this.limits.maxDepth&&this.throwDepthLimit()):(r.type===")"||r.type==="]"||r.type==="}")&&(s=Math.max(0,s-1))}parse(){let t=this.parseExpr(0);if(this.peek().type!=="eof")throw new Error(`Unexpected token: ${this.peek().value}`);return t}parseExpr(t){return this.withDepth(()=>this.parseExprInner(t))}parseExprInner(t){let n=this.parsePrefix();for(;;){let s=this.peek(),r=this.getInfixPrec(s.type);if(r<t)break;n=this.parseInfix(n,r)}return n}useOperation(t=1){if(t>this.limits.maxOperations-this.operations)throw new E(`xan: expression parser operation limit exceeded (${this.limits.maxOperations})`,"iterations");this.operations+=t}withDepth(t){this.depth>=this.limits.maxDepth&&this.throwDepthLimit(),this.depth++;try{return t()}finally{this.depth--}}throwDepthLimit(){throw new E(`xan: expression parser depth limit exceeded (${this.limits.maxDepth})`,"recursion")}addAstNode(){if(this.astNodes>=this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements");this.astNodes++}parsePrefix(){let t=this.peek();switch(t.type){case"int":return this.advance(),{type:"int",value:Number.parseInt(t.value,10)};case"float":return this.advance(),{type:"float",value:Number.parseFloat(t.value)};case"string":return this.advance(),{type:"string",value:t.value};case"regex":{this.advance();let n=t.value.split("/"),s=n.length>1?n[n.length-1]:"";return{type:"regex",pattern:n.slice(0,-1).join("/")||t.value,caseInsensitive:s.includes("i")}}case"true":return this.advance(),{type:"bool",value:!0};case"false":return this.advance(),{type:"bool",value:!1};case"null":return this.advance(),{type:"null"};case"_":return this.advance(),{type:"underscore"};case"ident":{let n=t.value,s=n.endsWith("?"),r=s?n.slice(0,-1):n;if(this.advance(),this.peek().type==="(")return this.parseFunctionCall(r);if(this.peek().type==="=>"){this.advance();let o=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:[r],body:o},[r])}return{type:"identifier",name:r,unsure:s}}case"(":{this.advance();let n=this.pos;if(this.peek().type===")"){if(this.advance(),this.peek().type==="=>"){this.advance();let r=this.parseExpr(0);return{type:"lambda",params:[],body:r}}throw new Error("Empty parentheses not allowed")}if(this.peek().type==="ident"){let r=[this.peek().value];this.advance();let o=!0;for(;this.peek().type===",";)if(this.advance(),this.peek().type==="ident")r.push(this.peek().value),this.advance();else{o=!1;break}if(o&&this.peek().type===")"&&this.peekAt(1).type==="=>"){this.advance(),this.advance();let i=this.parseExpr(0);return this.bindLambdaArgs({type:"lambda",params:r,body:i},r)}this.pos=n}let s=this.parseExpr(0);return this.expect(")"),s}case"[":return this.parseList();case"{":return this.parseMap();case"-":{this.advance();let n=this.parseExpr(D.UNARY);return n.type==="int"?{type:"int",value:-n.value}:n.type==="float"?{type:"float",value:-n.value}:{type:"func",name:"neg",args:[{expr:n}]}}case"!":return this.advance(),{type:"func",name:"not",args:[{expr:this.parseExpr(D.UNARY)}]};default:throw new Error(`Unexpected token: ${t.type} (${t.value})`)}}parseFunctionCall(t){this.expect("(");let n=[];if(this.peek().type!==")")do{n.length>0&&this.peek().type===","&&this.advance();let s;if(this.peek().type==="ident"){let o=this.peek().value,i=this.pos+1;i<this.tokens.length&&this.tokens[i].type==="="&&(s=o,this.advance(),this.advance())}let r=this.parseExpr(0);n.push({name:s,expr:r})}while(this.peek().type===",");return this.expect(")"),{type:"func",name:t.toLowerCase(),args:n}}parseList(){this.expect("[");let t=[];if(this.peek().type!=="]")do t.length>0&&this.peek().type===","&&this.advance(),t.push(this.parseExpr(0));while(this.peek().type===",");return this.expect("]"),{type:"list",elements:t}}parseMap(){this.expect("{");let t=[];if(this.peek().type!=="}")do{t.length>0&&this.peek().type===","&&this.advance();let n;if(this.peek().type==="ident")n=this.peek().value,this.advance();else if(this.peek().type==="string")n=this.peek().value,this.advance();else throw new Error(`Expected map key, got ${this.peek().type}`);this.expect(":");let s=this.parseExpr(0);t.push({key:n,value:s})}while(this.peek().type===",");return this.expect("}"),{type:"map",entries:t}}parseInfix(t,n){let s=this.peek(),o=new Map([["+","add"],["-","sub"],["*","mul"],["/","div"],["//","idiv"],["%","mod"],["**","pow"],["++","concat"],["==","=="],["!=","!="],["<","<"],["<=","<="],[">",">"],[">=",">="],["eq","eq"],["ne","ne"],["lt","lt"],["le","le"],["gt","gt"],["ge","ge"],["&&","and"],["and","and"],["||","or"],["or","or"]]).get(s.type);if(o!==void 0){this.advance();let i=this.parseExpr(n+(this.isRightAssoc(s.type)?0:1));return{type:"func",name:o,args:[{expr:t},{expr:i}]}}if(s.type==="|"){this.advance();let i=this.parseExpr(n);return this.handlePipe(t,i)}if(s.type===".")return this.advance(),this.handleDot(t);if(s.type==="[")return this.advance(),this.handleIndexing(t);if(s.type==="in")return this.advance(),{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]};if(s.type==="not in")return this.advance(),{type:"func",name:"not",args:[{expr:{type:"func",name:"contains",args:[{expr:this.parseExpr(n+1)},{expr:t}]}}]};throw new Error(`Unexpected infix token: ${s.type}`)}handlePipe(t,n){if(n.type==="identifier")return{type:"func",name:n.name,args:[{expr:t}]};if(n.type==="func"){let s=this.countUnderscores(n);return s===0?n:s===1?this.fillUnderscore(n,t):{type:"pipeline",exprs:[t,n]}}return this.countUnderscores(n)===1?this.fillUnderscore(n,t):n}handleDot(t){let n=this.peek();if(n.type==="ident"){let s=n.value;if(this.advance(),this.peek().type==="("){let r=this.parseFunctionCall(s);return r.type==="func"&&r.args.unshift({expr:t}),r}return{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}if(n.type==="int"){let s=Number.parseInt(n.value,10);return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"int",value:s}}]}}if(n.type==="string"){let s=n.value;return this.advance(),{type:"func",name:"get",args:[{expr:t},{expr:{type:"string",value:s}}]}}throw new Error(`Expected identifier, number, or string after dot, got ${n.type}`)}handleIndexing(t){if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:{type:"int",value:0}},{expr:s}]}}let n=this.parseExpr(0);if(this.peek().type===":"){if(this.advance(),this.peek().type==="]")return this.advance(),{type:"func",name:"slice",args:[{expr:t},{expr:n}]};let s=this.parseExpr(0);return this.expect("]"),{type:"func",name:"slice",args:[{expr:t},{expr:n},{expr:s}]}}return this.expect("]"),{type:"func",name:"get",args:[{expr:t},{expr:n}]}}countUnderscores(t){let n=[t],s=0;for(;n.length>0;){this.useOperation();let r=n.pop();if(!r)break;if(r.type==="underscore")s++;else if(r.type==="func")for(let o of r.args)n.push(o.expr);else if(r.type==="list")n.push(...r.elements);else if(r.type==="map")for(let o of r.entries)n.push(o.value);if(n.length>this.limits.maxAstNodes)throw new E(`xan: expression AST node limit exceeded (${this.limits.maxAstNodes})`,"array_elements")}return s}fillUnderscore(t,n){return this.withDepth(()=>this.fillUnderscoreInner(t,n))}fillUnderscoreInner(t,n){return this.useOperation(),t.type==="underscore"?n:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.fillUnderscore(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.fillUnderscore(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.fillUnderscore(s.value,n)}))}:t}bindLambdaArgs(t,n){return{...t,body:this.bindLambdaArgsInExpr(t.body,n)}}bindLambdaArgsInExpr(t,n){return this.withDepth(()=>this.bindLambdaArgsInExprInner(t,n))}bindLambdaArgsInExprInner(t,n){return this.useOperation(),t.type==="identifier"&&n.includes(t.name)?{type:"lambdaBinding",name:t.name}:t.type==="func"?{...t,args:t.args.map(s=>({...s,expr:this.bindLambdaArgsInExpr(s.expr,n)}))}:t.type==="list"?{...t,elements:t.elements.map(s=>this.bindLambdaArgsInExpr(s,n))}:t.type==="map"?{...t,entries:t.entries.map(s=>({...s,value:this.bindLambdaArgsInExpr(s.value,n)}))}:t}getInfixPrec(t){switch(t){case"|":return D.PIPE;case"||":case"or":return D.OR;case"&&":case"and":return D.AND;case"==":case"!=":case"eq":case"ne":return D.EQUALITY;case"<":case"<=":case">":case">=":case"lt":case"le":case"gt":case"ge":case"in":case"not in":return D.COMPARISON;case"+":case"-":case"++":return D.ADDITIVE;case"*":case"/":case"//":case"%":return D.MULTIPLICATIVE;case"**":return D.POWER;case".":case"[":return D.POSTFIX;default:return-1}}isRightAssoc(t){return t==="**"}peek(){return this.tokens[this.pos]||{type:"eof",value:"",pos:0}}peekAt(t){return this.tokens[this.pos+t]||{type:"eof",value:"",pos:0}}advance(){return this.useOperation(),this.addAstNode(),this.tokens[this.pos++]}expect(t){let n=this.peek();if(n.type!==t)throw new Error(`Expected ${t}, got ${n.type}`);return this.advance()}};function X(e,t={}){let n=[],r=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize(),o=0,i=()=>r[o]||{type:"eof",value:"",pos:0},p=()=>r[o++];for(;i().type!=="eof";){if(i().type===","&&n.length>0){p();continue}let h=[],m=0,c=o;for(;i().type!=="eof";){let l=i();if((l.type===","||l.type==="as")&&m===0)break;(l.type==="("||l.type==="["||l.type==="{")&&m++,(l.type===")"||l.type==="]"||l.type==="}")&&m--,h.push(p())}h.push({type:"eof",value:"",pos:0});let d=new ee(h,t).parse(),u;if(i().type==="as")if(p(),i().type==="("){p();let l=[];for(;i().type!==")"&&i().type!=="eof";)if((i().type==="ident"||i().type==="string")&&(l.push(i().value),p()),i().type===",")p();else if(i().type!==")"&&i().type!=="eof")throw new Error(`Expected tuple alias, got ${i().type}`);if(i().type!==")")throw new Error("Expected ')' after tuple alias");p(),u=l}else if(i().type==="ident"||i().type==="string")u=i().value,p();else throw new Error(`Expected name after 'as', got ${i().type}`);else u=e.slice(r[c].pos,r[o-1]?.pos||e.length).trim(),d.type==="identifier"&&(u=d.name);n.push({expr:d,name:u})}return n}function B(e,t={}){let s=new G(e,{maxSourceLength:t.maxSourceLength,maxTokens:t.maxTokens}).tokenize();return new ee(s,t).parse()}function R(e,t){return t.length===0?O(e,[]):t.length===1?{type:"Pipe",left:t[0],right:O(e,[])}:{type:"Pipe",left:t[0],right:O(e,t.slice(1))}}var le={add:e=>L("+",e[0],e[1]),sub:e=>L("-",e[0],e[1]),mul:e=>L("*",e[0],e[1]),div:e=>L("/",e[0],e[1]),mod:e=>L("%",e[0],e[1]),idiv:e=>O("floor",[L("/",e[0],e[1])]),pow:e=>R("pow",e),neg:e=>({type:"UnaryOp",op:"-",operand:e[0]}),"==":e=>L("==",e[0],e[1]),"!=":e=>L("!=",e[0],e[1]),"<":e=>L("<",e[0],e[1]),"<=":e=>L("<=",e[0],e[1]),">":e=>L(">",e[0],e[1]),">=":e=>L(">=",e[0],e[1]),eq:e=>L("==",M(e[0]),M(e[1])),ne:e=>L("!=",M(e[0]),M(e[1])),lt:e=>L("<",M(e[0]),M(e[1])),le:e=>L("<=",M(e[0]),M(e[1])),gt:e=>L(">",M(e[0]),M(e[1])),ge:e=>L(">=",M(e[0]),M(e[1])),and:e=>L("and",e[0],e[1]),or:e=>L("or",e[0],e[1]),not:e=>({type:"UnaryOp",op:"not",operand:e[0]}),len:e=>R("length",e),length:e=>R("length",e),upper:e=>R("ascii_upcase",e),lower:e=>R("ascii_downcase",e),trim:e=>R("trim",e),ltrim:e=>e.length===0?O("ltrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("ltrimstr",[{type:"Literal",value:" "}])},rtrim:e=>e.length===0?O("rtrimstr",[{type:"Literal",value:" "}]):{type:"Pipe",left:e[0],right:O("rtrimstr",[{type:"Literal",value:" "}])},split:e=>R("split",e),join:e=>e.length===1?O("join",[{type:"Literal",value:""}]):R("join",e),concat:e=>L("+",e[0],e[1]),startswith:e=>R("startswith",e),endswith:e=>R("endswith",e),contains:e=>R("contains",e),replace:e=>R("gsub",e),substr:e=>e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:L("+",e[1],e[2])},abs:e=>R("fabs",e),floor:e=>R("floor",e),ceil:e=>R("ceil",e),round:e=>R("round",e),sqrt:e=>R("sqrt",e),log:e=>R("log",e),log10:e=>R("log10",e),log2:e=>R("log2",e),exp:e=>R("exp",e),sin:e=>R("sin",e),cos:e=>R("cos",e),tan:e=>R("tan",e),asin:e=>R("asin",e),acos:e=>R("acos",e),atan:e=>R("atan",e),min:e=>R("min",e),max:e=>R("max",e),first:e=>e.length===0?{type:"Index",index:{type:"Literal",value:0}}:{type:"Index",index:{type:"Literal",value:0},base:e[0]},last:e=>e.length===0?{type:"Index",index:{type:"Literal",value:-1}}:{type:"Index",index:{type:"Literal",value:-1},base:e[0]},get:e=>e.length===1?{type:"Index",index:e[0]}:{type:"Index",index:e[1],base:e[0]},slice:e=>e.length===1?{type:"Slice",base:e[0]}:e.length===2?{type:"Slice",base:e[0],start:e[1]}:{type:"Slice",base:e[0],start:e[1],end:e[2]},keys:"keys",values:"values",entries:e=>O("to_entries",e),from_entries:"from_entries",reverse:"reverse",sort:"sort",sort_by:"sort_by",group_by:"group_by",unique:"unique",unique_by:"unique_by",flatten:"flatten",map:e=>({type:"Pipe",left:e[0],right:{type:"Array",elements:e[1]}}),select:e=>O("select",e),empty:()=>O("empty",[]),count:()=>O("length",[]),sum:e=>e.length===0?O("add",[]):{type:"Pipe",left:{type:"Array",elements:e[0]},right:O("add",[])},mean:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},avg:e=>e.length===0?{type:"Pipe",left:{type:"Identity"},right:L("/",O("add",[]),O("length",[]))}:{type:"Pipe",left:{type:"Array",elements:e[0]},right:L("/",O("add",[]),O("length",[]))},type:"type",isnull:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:null}):L("==",e[0],{type:"Literal",value:null}),isempty:e=>e.length===0?L("==",{type:"Identity"},{type:"Literal",value:""}):L("==",e[0],{type:"Literal",value:""}),tonumber:e=>e.length===0?O("tonumber",[]):O("tonumber",e),tostring:e=>e.length===0?O("tostring",[]):O("tostring",e),if:e=>st(e[0],e[1],e[2]),coalesce:e=>{if(e.length===0)return{type:"Literal",value:null};if(e.length===1)return e[0];let t=e[e.length-1];for(let n=e.length-2;n>=0;n--){let s=e[n],r=L("and",L("!=",s,{type:"Literal",value:null}),L("!=",s,{type:"Literal",value:""}));t=st(r,s,t)}return t},index:()=>({type:"Field",name:"_row_index"}),now:()=>O("now",[]),fmt:e=>O("tostring",e),format:e=>O("tostring",e)};Object.setPrototypeOf(le,null);function L(e,t,n){return{type:"BinaryOp",op:e,left:t,right:n}}function O(e,t){return{type:"Call",name:e,args:t}}var mt="then";function st(e,t,n){let s=Xe({type:"Cond",cond:e,elifs:[],else:n||{type:"Literal",value:null}});return s[mt]=t,s}function M(e){return{type:"Pipe",left:e,right:{type:"Call",name:"tostring",args:[]}}}function U(e,t=!0,n={}){let s={nodes:0,operations:0,maxNodes:n.maxAstNodes??1e5,maxOperations:n.maxOperations??1e5,maxDepth:n.maxDepth??100};return rt(e,t,s,0)}function rt(e,t,n,s){if(s>=n.maxDepth)throw new E(`xan: expression conversion depth limit exceeded (${n.maxDepth})`,"recursion");if(++n.nodes>n.maxNodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(++n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations");let r=o=>rt(o,t,n,s+1);switch(e.type){case"int":case"float":return{type:"Literal",value:e.value};case"string":return{type:"Literal",value:e.value};case"bool":return{type:"Literal",value:e.value};case"null":return{type:"Literal",value:null};case"underscore":return{type:"Index",base:{type:"Identity"},index:{type:"Literal",value:"_"}};case"identifier":return t?{type:"Field",name:e.name}:{type:"VarRef",name:e.name};case"lambdaBinding":return{type:"VarRef",name:e.name};case"func":{if(e.args.length>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");let o=e.args.map(p=>r(p.expr));if(e.name==="coalesce"){let p=Math.max(0,o.length-1)*7;if(p>n.maxNodes-n.nodes)throw new E(`xan: expression conversion AST limit exceeded (${n.maxNodes})`,"array_elements");if(n.nodes+=p,n.operations+=o.length,n.operations>n.maxOperations)throw new E(`xan: expression conversion operation limit exceeded (${n.maxOperations})`,"iterations")}let i=Object.hasOwn(le,e.name)?le[e.name]:void 0;return typeof i=="function"?i(o):O(typeof i=="string"?i:e.name,o)}case"list":return e.elements.length===0?{type:"Array"}:{type:"Array",elements:e.elements.reduce((o,i,p)=>{let h=r(i);return p===0?h:{type:"Comma",left:o,right:h}},null)};case"map":return{type:"Object",entries:e.entries.map(o=>({key:o.key,value:r(o.value)}))};case"regex":return{type:"Literal",value:e.pattern};case"slice":return{type:"Slice",start:e.start?r(e.start):void 0,end:e.end?r(e.end):void 0};case"lambda":return r(e.body);case"pipeline":return{type:"Identity"};default:throw new Error(`Unknown moonblade expression type: ${e.type}`)}}function Q(e){return e<2?0:Math.ceil(e*Math.log2(e))}function ue(e,t={}){let n=t.maxArrayElements??1e5,s=t.maxStringLength??10*1024*1024,r=t.maxIterations??1e5,o=t.maxDepth??100;if(K(e)>s)throw new E(`xan: aggregation expression length limit exceeded (${s} bytes)`,"string_length");let i=[],p=0,h=0,m=()=>{if(t.consumeWork?.(),++h>r)throw new E(`xan: aggregation parser operation limit exceeded (${r})`,"iterations")};for(;p<e.length;){for(m();p<e.length&&(e[p]===" "||e[p]===",");)p++;if(p>=e.length)break;let c=p;for(;p<e.length&&/\w/.test(e[p]);)p++;let a=e.slice(c,p);for(;p<e.length&&e[p]===" ";)p++;if(e[p]!=="(")break;p++;let d=1,u=p;for(;p<e.length&&d>0;){if(m(),e[p]==="("?d++:e[p]===")"&&d--,d>o)throw new E(`xan: aggregation parser depth limit exceeded (${o})`,"recursion");d>0&&p++}let l=e.slice(u,p).trim();for(p++;p<e.length&&e[p]===" ";)p++;let f="";if(e.slice(p,p+3).toLowerCase()==="as "){for(p+=3;p<e.length&&e[p]===" ";)p++;let x=p;for(;p<e.length&&/\w/.test(e[p]);)p++;f=e.slice(x,p)}if(f||(f=l?`${a}(${l})`:`${a}()`),i.length>=n)throw new E(`xan: aggregation specification limit exceeded (${n})`,"array_elements");i.push({func:a,expr:l,alias:f})}return i}function ft(e){return/^\w+$/.test(e)}function ht(e,t,n){let s=V(e,t,n);return s.length>0?s[0]:null}function ce(e,t,n={},s={}){let{func:r,expr:o}=t,i=s.maxArrayElements??1e5,p=s.maxStringLength??10*1024*1024,h=s.maxIterations??1e5,m={maxSourceLength:p,maxTokens:i,maxAstNodes:i,maxOperations:h,maxDepth:s.maxDepth??100};if(e.length>i)throw new E(`xan: aggregation input limit exceeded (${i})`,"array_elements");if(r==="count"&&!o)return e.length;let c=ft(o),a=c?null:U(B(o,m),!0,m),d;if(c)d=f=>f[o];else{if(a===null)throw new Error("xan: missing compiled aggregation expression");d=f=>ht(f,a,n)}if(r==="all"||r==="any"){let f=0;for(let x of e){if(s.consumeWork?.(),++f>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let g=!!d(x);if(r==="all"&&!g)return!1;if(r==="any"&&g)return!0}return r==="all"}let u=[],l=0;for(let f of e){if(s.consumeWork?.(),++l>h)throw new E(`xan: aggregation iteration limit exceeded (${h})`,"iterations");let x=d(f);if(x!=null){if(u.length>=i)throw new E(`xan: aggregation value limit exceeded (${i})`,"array_elements");u.push(x)}}switch(r){case"count":{if(c)return u.length;let f=0;for(let x of u)s.consumeWork?.(),x&&f++;return f}case"sum":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return f}case"mean":case"avg":{let f=0;for(let x of u)s.consumeWork?.(),f+=typeof x=="number"?x:Number.parseFloat(String(x));return u.length>0?f/u.length:0}case"min":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.min(f,g)}return f}case"max":{let f=null;for(let x of u){s.consumeWork?.();let g=typeof x=="number"?x:Number.parseFloat(String(x));f=f===null?g:Math.max(f,g)}return f}case"first":return u.length>0?u[0]:null;case"last":return u.length>0?u[u.length-1]:null;case"median":{let f=[];for(let g of u){s.consumeWork?.();let y=typeof g=="number"?g:Number.parseFloat(String(g));Number.isNaN(y)||f.push(y)}if(s.consumeWork?.(Q(f.length)),f.sort((g,y)=>g-y),f.length===0)return null;let x=Math.floor(f.length/2);return f.length%2===0?(f[x-1]+f[x])/2:f[x]}case"mode":{let f=new Map;for(let y of u){s.consumeWork?.();let w=String(y);f.set(w,(f.get(w)||0)+1)}let x=0,g=null;for(let[y,w]of f)s.consumeWork?.(),w>x&&(x=w,g=y);return g}case"cardinality":{let f=new Set;for(let x of u)s.consumeWork?.(),f.add(String(x));return f.size}case"values":return ot(u,!1,p,s);case"distinct_values":return ot(u,!0,p,s);default:return null}}function it(e,t,n={},s={}){let r=F();for(let o of t)b(r,o.alias,ce(e,o,n,s));return r}function ot(e,t,n,s){let r=[],o=t?new Set:null,i=0;for(let p of e){s.consumeWork?.();let h=String(p);if(o?.has(h))continue;o?.add(h);let m=K(h)+(r.length>0?1:0);if(m>n-i)throw new E(`xan: aggregation string limit exceeded (${n} bytes)`,"string_length");r.push(h),i+=m}return t&&(s.consumeWork?.(Q(r.length)),r.sort()),r.join("|")}function lt(e,t){return{maxArrayElements:e.limits.maxArrayElements,maxStringLength:e.limits.maxStringLength,maxIterations:e.limits.maxJqIterations,maxDepth:e.limits.maxQueryDepth,consumeWork:(n=1)=>t.consumeWork(n)}}function at(e,t,n){let s=e.size-(t&&e.has("")?1:0);return n>0?Math.min(s,n):s}async function pe(e,t){let n="",s=[];for(let d of e)d.startsWith("-")||(n?s.push(d):n=d);if(!n)return{stdout:"",stderr:`xan agg: no aggregation expression
|
|
@@ -62,7 +62,7 @@ import{a as $,b as F,c as b,d as j,e as Ze,f as et,g as C,h as tt,i as nt,j as k
|
|
|
62
62
|
`,exitCode:1};i=o[0].headers}let m=[];for(let{headers:c,data:a}of o)for(let d of a){let u=F();for(let l of i)b(u,l,c.includes(l)?d[l]:"");m.push(u)}return{stdout:C(i,m,t),stderr:"",exitCode:0}}async function Be(e,t){let n="",s=[],r=!1,o=!1,i=[];for(let u=0;u<e.length;u++){let l=e[u];(l==="-s"||l==="--select")&&u+1<e.length?s=e[++u].split(","):l==="-v"||l==="--invert"?r=!0:l==="-i"||l==="--ignore-case"?o=!0:l==="-r"||l==="--regex"||l.startsWith("-")||(n?i.push(l):n=l)}if(!n)return{stdout:"",stderr:`xan search: no pattern specified
|
|
63
63
|
`,exitCode:1};let{headers:p,data:h,error:m}=await k(i,t);if(m)return m;let c=s.length>0?s:p,a;try{a=Z(n,o?"i":"")}catch{return{stdout:"",stderr:`xan search: invalid regex pattern '${n}'
|
|
64
64
|
`,exitCode:1}}let d=h.filter(u=>{let l=c.some(f=>{let x=u[f];return x!=null&&a.test(String(x))});return r?!l:l});return{stdout:C(p,d,t),stderr:"",exitCode:0}}async function He(e,t){let n="",s=[];for(let l of e)l.startsWith("-")||(n?s.push(l):n=l);if(!n)return{stdout:"",stderr:`xan flatmap: no expression specified
|
|
65
|
-
`,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-
|
|
65
|
+
`,exitCode:1};let{headers:r,data:o,error:i}=await k(s,t);if(i)return i;let p=z(t),m=X(n,p).map(({expr:l,name:f})=>({alias:typeof f=="string"?f:f[0],ast:U(l,!0,p)})),c={limits:t.limits?{maxIterations:t.limits.maxJqIterations,maxStringLength:t.limits.maxStringLength}:void 0};if(W(r.length,m.length,"xan flatmap")>t.limits.maxArrayElements)throw new E(`xan flatmap: output column limit exceeded (${t.limits.maxArrayElements})`,"array_elements");let a=[...r,...m.map(l=>l.alias)],d=[],u=new $(t,"xan flatmap");for(let l of o){let f=[],x=1;for(let g of m){u.consumeWork();let y=V(l,g.ast,c),w=y.length>0&&Array.isArray(y[0])?y[0]:y;if(w.length>t.limits.maxArrayElements)throw new E(`xan flatmap: expression result limit exceeded (${t.limits.maxArrayElements})`,"array_elements");f.push(w),x=Math.max(x,w.length)}for(let g=0;g<x;g++){u.addRow(a.length);let y=j(l);for(let w=0;w<m.length;w++){let A=f[w][g]??null;b(y,m[w].alias,A)}d.push(y)}}return{stdout:C(a,d,t),stderr:"",exitCode:0}}async function Ke(e,t){let{cmdView:n}=await import("./xan-view-CNGKCABE.js");return n(e,t)}var dt=new Set(["fuzzy-join","glob","hist","input","parallel","plot","progress","range","scrape","tokenize","union-find"]),St=new Set(["agg","behead","cat","count","dedup","drop","enum","explode","f","filter","fixlengths","flatmap","flatten","fmt","frequency","freq","from","groupby","head","headers","implode","join","map","merge","partition","pivot","rename","reverse","sample","search","select","shuffle","slice","sort","split","stats","tail","to","top","transform","transpose","view",...dt]),pt={name:"xan",summary:"CSV toolkit for data manipulation",usage:"xan <COMMAND> [OPTIONS] [FILE]",description:`xan is a collection of commands for working with CSV data.
|
|
66
66
|
It provides a simple, ergonomic interface for common data operations.
|
|
67
67
|
|
|
68
68
|
COMMANDS:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as n}from"./chunk-BIJXTWZ4.js";import{b as $}from"./chunk-
|
|
3
|
+
import{a as n}from"./chunk-BIJXTWZ4.js";import{b as $}from"./chunk-C2BLJ3AE.js";import{l as F}from"./chunk-FUT3X2GJ.js";import{a as S}from"./chunk-CPKBPQ2C.js";import{a as x}from"./chunk-NE4R2FVV.js";import{a as z,b as O}from"./chunk-MUFNRCMY.js";var M={name:"stat",summary:"display file or file system status",usage:"stat [OPTION]... FILE...",options:["-c FORMAT use the specified FORMAT instead of the default"," --help display this help and exit"]},E={format:{short:"c",type:"string"}},I={name:"stat",async execute(l,s){if(O(l))return z(M);let o=x("stat",l,E);if(!o.ok)return o.error;let m=o.result.flags.format??null,u=o.result.positional;if(u.length===0)return{stdout:"",stderr:`stat: missing operand
|
|
4
4
|
`,exitCode:1};let c="",f="",p=!1,d=0,g=Math.min(s.limits.maxOutputSize,s.limits.maxStringLength),h=e=>{let r=S(e);if(r>g-d)throw new F(`stat: output size limit exceeded (${g} bytes)`,"output_size");c+=e,d+=r};for(let e of u){let r=s.fs.resolvePath(s.cwd,e);try{let t=await s.fs.stat(r);if(m){let a=t.mode.toString(8),i=n(t.mode,t.isDirectory),w=new Map([["%n",e],["%N",`'${e}'`],["%s",String(t.size)],["%F",t.isDirectory?"directory":"regular file"],["%a",a],["%A",i],["%u","1000"],["%U","user"],["%g","1000"],["%G","group"]]),A=m.replace(/%[nNsFaAuUgG]/g,y=>w.get(y)??y);h(`${A}
|
|
5
5
|
`)}else{let a=t.mode.toString(8).padStart(4,"0"),i=n(t.mode,t.isDirectory);h(` File: ${e}
|
|
6
6
|
Size: ${t.size} Blocks: ${Math.ceil(t.size/512)}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-3M5OMKFS.js";import"./chunk-O3PNT72D.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as column,b as flagsForFuzzing};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-HSWCKN2X.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-I4IRHQDW.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as cpCommand,b as flagsForFuzzing};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{b as
|
|
3
|
+
import{a as k,b as E}from"./chunk-PEJXCXSY.js";import{d as w}from"./chunk-ENEHPI32.js";import{a as x,b as W,d as F}from"./chunk-CPKBPQ2C.js";import{a as S}from"./chunk-I4IRHQDW.js";import{a as O,b as $,c as g}from"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";function b(s){return encodeURIComponent(s).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16)}`).replace(/%20/g,"+").replace(/%[0-9A-F]{2}/g,e=>e.toLowerCase())}function C(s){let e=s.indexOf("=");if(e>=0){let i=s.slice(0,e),r=s.slice(e+1),o=b(r);return i?`${i}=${o}`:o}return b(s)}function P(s){let e=s.indexOf("=");if(e<0)return null;let i=s.slice(0,e),r=s.slice(e+1),o,t,a=r.match(/;type=([^;]+)$/);a&&(t=a[1],r=r.slice(0,-a[0].length));let n=r.match(/;filename=([^;]+)/);return n&&(o=n[1],r=r.replace(n[0],"")),(r.startsWith("@")||r.startsWith("<"))&&(o=o??r.slice(1).split("/").pop()),{name:i,value:r,filename:o,contentType:t}}function A(s,e){let i=`----CurlFormBoundary${Date.now().toString(36)}`,r=[];for(let o of s){let t=o.value;if(t.startsWith("@")||t.startsWith("<")){let n=t.slice(1);t=e.get(n)??""}let a=`--${i}\r
|
|
4
4
|
`;o.filename?(a+=`Content-Disposition: form-data; name="${o.name}"; filename="${o.filename}"\r
|
|
5
5
|
`,o.contentType&&(a+=`Content-Type: ${o.contentType}\r
|
|
6
6
|
`)):a+=`Content-Disposition: form-data; name="${o.name}"\r
|
|
7
7
|
`,a+=`\r
|
|
8
8
|
${t}\r
|
|
9
9
|
`,r.push(a)}return r.push(`--${i}--\r
|
|
10
|
-
`),{body:r.join(""),boundary:i}}var
|
|
10
|
+
`),{body:r.join(""),boundary:i}}var D={name:"curl",summary:"transfer a URL",usage:"curl [OPTIONS] URL",options:["-X, --request METHOD HTTP method (GET, POST, PUT, DELETE, etc.)","-H, --header HEADER Add header (can be used multiple times)","-d, --data DATA HTTP POST data (DATA=@file reads from file, strips newlines)","-G, --get Append data payloads to URL query string"," --data-raw DATA HTTP POST data (no @ interpretation)"," --data-binary DATA HTTP POST binary data (DATA=@file reads file verbatim)"," --data-urlencode DATA URL-encode and POST data (supports @file and name@file)","-F, --form NAME=VALUE Multipart form data","-u, --user USER:PASS HTTP authentication","-A, --user-agent STR Set User-Agent header","-e, --referer URL Set Referer header","-b, --cookie DATA Send cookies (name=value or @file)","-c, --cookie-jar FILE Save cookies to file","-T, --upload-file FILE Upload file (PUT)","-o, --output FILE Write output to file","-O, --remote-name Write to file named from URL","-D, --dump-header FILE Write response headers to FILE (`-` for stdout)","-I, --head Show headers only (HEAD request)","-i, --include Include response headers in output","-s, --silent Silent mode (no progress)","-S, --show-error Show errors even when silent","-f, --fail Fail silently on HTTP errors (no output)","-L, --location Follow redirects (default)"," --max-redirs NUM Maximum redirects (default: 20)","-m, --max-time SECS Maximum time for request"," --connect-timeout SECS Connection timeout","-w, --write-out FMT Output format after completion","-v, --verbose Verbose output"," --help Display this help and exit","","Note: Network access must be configured via BashEnv network option."," curl is not available by default for security reasons."]};function h(s,e,i){i.allowFile&&e.startsWith("@")?s.dataParts.push({file:{path:e.slice(1),mode:i.binary?"binary":"ascii"}}):s.dataParts.push({value:e}),i.binary&&(s.dataBinary=!0)}function R(s,e){if(e.startsWith("@")){s.dataParts.push({file:{path:e.slice(1),mode:"urlencode"}});return}let i=e.indexOf("@"),r=e.indexOf("=");if(i>0&&(r<0||i<r)){s.dataParts.push({file:{path:e.slice(i+1),mode:"urlencode",name:e.slice(0,i)}});return}s.dataParts.push({value:C(e)})}function M(s){let e={method:"GET",headers:new w,dataParts:[],dataBinary:!1,getMode:!1,formFields:[],useRemoteName:!1,headOnly:!1,includeHeaders:!1,silent:!1,showError:!1,failSilently:!1,followRedirects:!0,verbose:!1},i=!1,r=!1;for(let o=0;o<s.length;o++){let t=s[o];if(t==="-X"||t==="--request")e.method=s[++o]??"GET",r=!0;else if(t.startsWith("-X"))e.method=t.slice(2),r=!0;else if(t.startsWith("--request="))e.method=t.slice(10),r=!0;else if(t==="-H"||t==="--header"){let a=s[++o];if(a){let n=a.indexOf(":");if(n>0){let l=a.slice(0,n).trim(),d=a.slice(n+1).trim();e.headers.append(l,d)}}}else if(t.startsWith("--header=")){let a=t.slice(9),n=a.indexOf(":");if(n>0){let l=a.slice(0,n).trim(),d=a.slice(n+1).trim();e.headers.append(l,d)}}else if(t==="-G"||t==="--get")e.getMode=!0,r||(e.method="GET");else if(t==="-d"||t==="--data")h(e,s[++o]??"",{binary:!1,allowFile:!0}),i=!0;else if(t==="--data-raw")h(e,s[++o]??"",{binary:!1,allowFile:!1}),i=!0;else if(t.startsWith("-d"))h(e,t.slice(2),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data="))h(e,t.slice(7),{binary:!1,allowFile:!0}),i=!0;else if(t.startsWith("--data-raw="))h(e,t.slice(11),{binary:!1,allowFile:!1}),i=!0;else if(t==="--data-binary")h(e,s[++o]??"",{binary:!0,allowFile:!0}),i=!0;else if(t.startsWith("--data-binary="))h(e,t.slice(14),{binary:!0,allowFile:!0}),i=!0;else if(t==="--data-urlencode")R(e,s[++o]??""),i=!0;else if(t.startsWith("--data-urlencode="))R(e,t.slice(17)),i=!0;else if(t==="-F"||t==="--form"){let a=s[++o]??"",n=P(a);n&&e.formFields.push(n),i=!0}else if(t.startsWith("--form=")){let a=t.slice(7),n=P(a);n&&e.formFields.push(n),i=!0}else if(t==="-u"||t==="--user")e.user=s[++o];else if(t.startsWith("-u"))e.user=t.slice(2);else if(t.startsWith("--user="))e.user=t.slice(7);else if(t==="-A"||t==="--user-agent")e.headers.set("User-Agent",s[++o]??"");else if(t.startsWith("-A"))e.headers.set("User-Agent",t.slice(2));else if(t.startsWith("--user-agent="))e.headers.set("User-Agent",t.slice(13));else if(t==="-e"||t==="--referer")e.headers.set("Referer",s[++o]??"");else if(t.startsWith("-e"))e.headers.set("Referer",t.slice(2));else if(t.startsWith("--referer="))e.headers.set("Referer",t.slice(10));else if(t==="-b"||t==="--cookie")e.headers.set("Cookie",s[++o]??"");else if(t.startsWith("-b"))e.headers.set("Cookie",t.slice(2));else if(t.startsWith("--cookie="))e.headers.set("Cookie",t.slice(9));else if(t==="-c"||t==="--cookie-jar")e.cookieJar=s[++o];else if(t.startsWith("--cookie-jar="))e.cookieJar=t.slice(13);else if(t==="-T"||t==="--upload-file")e.uploadFile=s[++o],e.method==="GET"&&(e.method="PUT");else if(t.startsWith("--upload-file="))e.uploadFile=t.slice(14),e.method==="GET"&&(e.method="PUT");else if(t==="-m"||t==="--max-time"){let a=parseFloat(s[++o]??"0");!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--max-time=")){let a=parseFloat(t.slice(11));!Number.isNaN(a)&&a>0&&(e.timeoutMs=a*1e3)}else if(t==="--connect-timeout"){let a=parseFloat(s[++o]??"0");!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t.startsWith("--connect-timeout=")){let a=parseFloat(t.slice(18));!Number.isNaN(a)&&a>0&&e.timeoutMs===void 0&&(e.timeoutMs=a*1e3)}else if(t==="-o"||t==="--output")e.outputFile=s[++o];else if(t.startsWith("--output="))e.outputFile=t.slice(9);else if(t==="-D"||t==="--dump-header"){let a=s[++o];if(a===void 0)return{stdout:"",stderr:`curl: option ${t}: requires parameter
|
|
11
11
|
`,exitCode:1};if(a==="")return{stdout:"",stderr:`curl: option ${t}: blank argument where content is expected
|
|
12
12
|
`,exitCode:1};e.dumpHeader=a}else if(t.startsWith("--dump-header=")){let a=t.slice(14);if(a==="")return{stdout:"",stderr:`curl: option --dump-header: blank argument where content is expected
|
|
13
13
|
`,exitCode:1};e.dumpHeader=a}else if(t.startsWith("-D")&&t.length>2)e.dumpHeader=t.slice(2);else if(t==="-O"||t==="--remote-name")e.useRemoteName=!0;else if(t==="-I"||t==="--head")e.headOnly=!0,e.method="HEAD",r=!0;else if(t==="-i"||t==="--include")e.includeHeaders=!0;else if(t==="-s"||t==="--silent")e.silent=!0;else if(t==="-S"||t==="--show-error")e.showError=!0;else if(t==="-f"||t==="--fail")e.failSilently=!0;else if(t==="-L"||t==="--location")e.followRedirects=!0;else if(t==="--max-redirs"){let a=s[++o];if(a===void 0||!/^\d+$/.test(a))return{stdout:"",stderr:`curl: option --max-redirs: expected a non-negative integer
|
|
14
14
|
`,exitCode:2};let n=Number(a);if(!Number.isSafeInteger(n))return{stdout:"",stderr:`curl: option --max-redirs: value is out of range
|
|
15
15
|
`,exitCode:2};e.maxRedirects=n}else if(t.startsWith("--max-redirs=")){let a=t.slice(13);if(!/^\d+$/.test(a)||!Number.isSafeInteger(Number(a)))return{stdout:"",stderr:`curl: option --max-redirs: expected a non-negative integer
|
|
16
|
-
`,exitCode:2};e.maxRedirects=Number(a)}else if(t==="-w"||t==="--write-out")e.writeOut=s[++o];else if(t.startsWith("--write-out="))e.writeOut=t.slice(12);else if(t==="-v"||t==="--verbose")e.verbose=!0;else{if(t.startsWith("--")&&t!=="--")return
|
|
17
|
-
`)}function
|
|
18
|
-
${
|
|
16
|
+
`,exitCode:2};e.maxRedirects=Number(a)}else if(t==="-w"||t==="--write-out")e.writeOut=s[++o];else if(t.startsWith("--write-out="))e.writeOut=t.slice(12);else if(t==="-v"||t==="--verbose")e.verbose=!0;else{if(t.startsWith("--")&&t!=="--")return g("curl",t);if(t.startsWith("-")&&t!=="-")for(let a of t.slice(1))switch(a){case"s":e.silent=!0;break;case"S":e.showError=!0;break;case"f":e.failSilently=!0;break;case"L":e.followRedirects=!0;break;case"I":e.headOnly=!0,e.method="HEAD",r=!0;break;case"i":e.includeHeaders=!0;break;case"O":e.useRemoteName=!0;break;case"v":e.verbose=!0;break;case"G":e.getMode=!0,r||(e.method="GET");break;default:return g("curl",`-${a}`)}else t.startsWith("-")||(e.url=t)}}return i&&!r&&!e.getMode&&(e.method="POST"),e}function N(s){return Object.entries(s).map(([e,i])=>`${e}: ${i}`).join(`\r
|
|
17
|
+
`)}function m(s,e,i){return`HTTP/1.1 ${s} ${e}\r
|
|
18
|
+
${N(i)}\r
|
|
19
19
|
\r
|
|
20
|
-
`}function
|
|
21
|
-
`),i}async function
|
|
20
|
+
`}function L(s){try{return new URL(s).pathname.split("/").pop()||"index.html"}catch{return"index.html"}}function v(s,e){let i=s;return i=i.replace(/%\{http_code\}/g,String(e.status)),i=i.replace(/%\{content_type\}/g,e.headers["content-type"]||""),i=i.replace(/%\{url_effective\}/g,e.url),i=i.replace(/%\{size_download\}/g,String(e.bodyLength)),i=i.replace(/\\n/g,`
|
|
21
|
+
`),i}var U=new TextEncoder,B=new TextDecoder("utf8",{ignoreBOM:!0});async function I(s,e){if(s.dataParts.length===0)return;let i=[],r=!1,o=!1;for(let l of s.dataParts)if(l.file){if(l.file.mode==="binary"){o=!0,l.file.path==="-"?(i.push(k(r?F:e.stdin,"binary")),r=!0):i.push(await e.fs.readFileBuffer(e.fs.resolvePath(e.cwd,l.file.path)));continue}let d=l.file.path==="-"?W(r?F:e.stdin):await e.fs.readFile(e.fs.resolvePath(e.cwd,l.file.path));if(l.file.path==="-"&&(r=!0),l.file.mode==="ascii")i.push(d.replace(/[\r\n]/g,""));else{let p=b(d);i.push(l.file.name?`${l.file.name}=${p}`:p)}}else i.push(l.value??"");if(!o)return i.join("&");let t=i.length-1;for(let l of i)t+=typeof l=="string"?x(l):l.byteLength;let a=new Uint8Array(t),n=0;for(let l=0;l<i.length;l+=1){l>0&&(a[n]=38,n+=1);let d=i[l];typeof d=="string"?n+=U.encodeInto(d,a.subarray(n)).written:(a.set(d,n),n+=d.byteLength)}return a}async function q(s,e,i){if(s.uploadFile){let r=e.fs.resolvePath(e.cwd,s.uploadFile);return{body:await e.fs.readFile(r)}}if(s.formFields.length>0){let r=new Map;for(let a of s.formFields)if(a.value.startsWith("@")||a.value.startsWith("<")){let n=e.fs.resolvePath(e.cwd,a.value.slice(1));try{let l=await e.fs.readFile(n);r.set(a.value.slice(1),l)}catch{r.set(a.value.slice(1),"")}}let{body:o,boundary:t}=A(s.formFields,r);return{body:o,contentType:`multipart/form-data; boundary=${t}`}}return i!==void 0&&!s.getMode?{body:i,contentType:"application/x-www-form-urlencoded"}:{}}function j(s,e){if(!e)return s;let i=s.indexOf("#"),r=i===-1?s:s.slice(0,i),o=i===-1?"":s.slice(i),t=r.endsWith("?")||r.endsWith("&")?"":r.includes("?")?"&":"?";return`${r}${t}${e}${o}`}function G(s,e){let i=new w(s.headers);if(s.user){let r=Buffer.from(s.user).toString("base64");i.set("Authorization",`Basic ${r}`)}return e&&!i.has("Content-Type")&&i.set("Content-Type",e),i}async function _(s,e,i){if(!s.cookieJar)return;let r=e["set-cookie"];if(!r)return;let o=i.fs.resolvePath(i.cwd,s.cookieJar);await i.fs.writeFile(o,r)}function J(s){return E(s,"binary")}function X(s,e,i){let r="";if(s.verbose){r+=`> ${s.method} ${i}
|
|
22
22
|
`;for(let[o,t]of s.headers)r+=`> ${o}: ${t}
|
|
23
23
|
`;r+=`>
|
|
24
24
|
`,r+=`< HTTP/1.1 ${e.status} ${e.statusText}
|
|
25
25
|
`;for(let[o,t]of Object.entries(e.headers))r+=`< ${o}: ${t}
|
|
26
26
|
`;r+=`<
|
|
27
|
-
`}return s.includeHeaders&&!s.verbose&&(r+=
|
|
27
|
+
`}return s.includeHeaders&&!s.verbose&&(r+=m(e.status,e.statusText,e.headers)),s.headOnly?s.includeHeaders||s.verbose||(r+=m(e.status,e.statusText,e.headers)):r+=J(e.body),s.writeOut&&(r+=v(s.writeOut,{status:e.status,headers:e.headers,url:e.url,bodyLength:e.body.byteLength})),r}var ce={name:"curl",async execute(s,e){if($(s))return O(D);let i=M(s);if("exitCode"in i)return i;let r=i;if(!r.url)return{stdout:"",stderr:`curl: no URL specified
|
|
28
28
|
`,exitCode:2};if(!e.fetch)return{stdout:"",stderr:`curl: internal error: fetch not available
|
|
29
|
-
`,exitCode:1};let o=r.url;o.match(/^https?:\/\//)||(o=`https://${o}`);try{let t=await
|
|
30
|
-
`:"",
|
|
31
|
-
`:"",exitCode:n}}}};export{
|
|
29
|
+
`,exitCode:1};let o=r.url;o.match(/^https?:\/\//)||(o=`https://${o}`);try{let t=await I(r,e);r.getMode&&(o=j(o,t instanceof Uint8Array?B.decode(t):t));let{body:a,contentType:n}=await q(r,e,t),l=G(r,n);if(r.dumpHeader!==void 0&&r.dumpHeader!=="-"){let u=e.fs.resolvePath(e.cwd,r.dumpHeader);await e.fs.writeFile(u,"")}let d=await e.fetch(o,{method:r.method,headers:l,body:a,followRedirects:r.followRedirects,timeoutMs:r.timeoutMs,maxRedirects:r.maxRedirects,signal:e.signal});await _(r,d.headers,e);let p=m(d.status,d.statusText,d.headers),c="";if(d.redirectChain)for(let u of d.redirectChain)c+=m(u.status,u.statusText,u.headers);if(c+=p,r.dumpHeader!==void 0&&r.dumpHeader!=="-"){let u=e.fs.resolvePath(e.cwd,r.dumpHeader);await e.fs.writeFile(u,c)}if(r.failSilently&&d.status>=400){let u=r.showError||!r.silent?`curl: (22) The requested URL returned error: ${d.status}
|
|
30
|
+
`:"",y=r.dumpHeader==="-"?c:"";return{stdout:y,stderr:u,exitCode:22,stdoutKind:y?"bytes":void 0}}let H=!!(r.outputFile||r.useRemoteName),f=H&&!r.verbose?"":X(r,d,o);if(H){let u=r.outputFile||L(o),y=e.fs.resolvePath(e.cwd,u);if(await e.fs.writeFile(y,r.headOnly?"":d.body),r.verbose?f=(r.dumpHeader==="-"?c:"")+f:r.dumpHeader==="-"?f=c:f="",r.writeOut){let T=v(r.writeOut,{status:d.status,headers:d.headers,url:d.url,bodyLength:d.body.byteLength});r.verbose?f+=T:r.dumpHeader==="-"?f=c+T:f=T}}else r.dumpHeader==="-"&&(f=c+f);return{stdout:f,stderr:"",exitCode:0,stdoutKind:"bytes"}}catch(t){let a=S(t),n=1;return a.includes("Network access denied")?n=7:a.includes("HTTP method")&&a.includes("not allowed")?n=3:a.includes("Redirect target not in allow-list")||a.includes("Too many redirects")?n=47:a.includes("aborted")&&(n=28),{stdout:"",stderr:!r.silent||r.showError?`curl: (${n}) ${a}
|
|
31
|
+
`:"",exitCode:n}}}};export{ce as curlCommand};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-CTS7QXCJ.js";import"./chunk-2UV6ZFHK.js";import"./chunk-O3PNT72D.js";import"./chunk-7JZKVC3F.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as cutCommand,b as flagsForFuzzing};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-3ASHUC7C.js";import"./chunk-CPKBPQ2C.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as diffCommand,b as flagsForFuzzing};
|