just-bash 3.1.0 → 3.2.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 +23 -0
- package/README.md +72 -9
- package/dist/Bash.d.ts +12 -4
- package/dist/abort-signals.d.ts +10 -0
- package/dist/bin/chunks/alias-3R4G6HQY.js +3 -0
- package/dist/bin/chunks/awk2-7UZLEPVX.js +3 -0
- package/dist/bin/chunks/base64-W6FVFNXJ.js +3 -0
- package/dist/bin/chunks/basename-C4CRGDXP.js +3 -0
- package/dist/bin/chunks/bash-CFCBBWVH.js +3 -0
- package/dist/bin/chunks/cat-5YECZSFQ.js +3 -0
- package/dist/bin/chunks/chmod-45TMYSW2.js +3 -0
- package/dist/bin/chunks/chunk-23OI2XDJ.js +20 -0
- package/dist/bin/chunks/chunk-2OQ5HPZE.js +7 -0
- package/dist/bin/chunks/chunk-2YLY6FJA.js +10 -0
- package/dist/bin/chunks/chunk-3HUI54BW.js +143 -0
- package/dist/bin/chunks/chunk-3OYRDLJJ.js +101 -0
- package/dist/bin/chunks/chunk-3PCPQIUD.js +3 -0
- package/dist/bin/chunks/chunk-3VSWQCPN.js +18 -0
- package/dist/bin/chunks/chunk-43E7AR6A.js +3 -0
- package/dist/bin/chunks/chunk-46CDVHZ3.js +5 -0
- package/dist/bin/chunks/chunk-4SQKKW2M.js +3 -0
- package/dist/bin/chunks/chunk-5SKEZPTU.js +12 -0
- package/dist/bin/chunks/chunk-6D75E4LV.js +3 -0
- package/dist/bin/chunks/chunk-6SAZRW7E.js +15 -0
- package/dist/bin/chunks/chunk-7FGDUBSN.js +14 -0
- package/dist/bin/chunks/chunk-7I6MNC5I.js +3 -0
- package/dist/bin/chunks/chunk-B7RRNV3A.js +22 -0
- package/dist/bin/chunks/chunk-BCJ42NCM.js +15 -0
- package/dist/bin/chunks/chunk-BNYIXXC2.js +3 -0
- package/dist/bin/chunks/chunk-BPWZ7ADB.js +8 -0
- package/dist/bin/chunks/chunk-BWRQ5HYX.js +9 -0
- package/dist/bin/chunks/chunk-CB4SODHK.js +34 -0
- package/dist/bin/chunks/chunk-CC2AQ6B7.js +15 -0
- package/dist/bin/chunks/chunk-CPKBPQ2C.js +3 -0
- package/dist/bin/chunks/chunk-CPTQXTBJ.js +3 -0
- package/dist/bin/chunks/chunk-D3MUBZ4P.js +65 -0
- package/dist/bin/chunks/chunk-DN2YCFOR.js +3 -0
- package/dist/bin/chunks/chunk-DSZQ22OX.js +12 -0
- package/dist/bin/chunks/chunk-E5VZGTZ6.js +10 -0
- package/dist/bin/chunks/chunk-ETWDDV6I.js +10 -0
- package/dist/bin/chunks/chunk-GEUCQ4AB.js +10 -0
- package/dist/bin/chunks/chunk-H4BRFPKY.js +3 -0
- package/dist/bin/chunks/chunk-IAAPXDHN.js +11 -0
- package/dist/bin/chunks/chunk-ISW2U76N.js +17 -0
- package/dist/bin/chunks/chunk-JQER3HUP.js +20 -0
- package/dist/bin/chunks/chunk-K5KT6DMM.js +4 -0
- package/dist/bin/chunks/chunk-KG2KXL4Y.js +3 -0
- package/dist/bin/chunks/chunk-LCP3IKI7.js +9 -0
- package/dist/bin/chunks/chunk-LGERQ5TD.js +22 -0
- package/dist/bin/chunks/chunk-LNFTLSWJ.js +22 -0
- package/dist/bin/chunks/chunk-LUHU7UUN.js +7 -0
- package/dist/bin/chunks/chunk-LXFMIXGA.js +3 -0
- package/dist/bin/chunks/chunk-MYTNZ7MA.js +7 -0
- package/dist/bin/chunks/chunk-MZM7RVYU.js +8 -0
- package/dist/bin/chunks/chunk-NGD6G5ZG.js +9 -0
- package/dist/bin/chunks/chunk-NJ67YJRE.js +6 -0
- package/dist/bin/chunks/chunk-NQQ3X7MZ.js +36 -0
- package/dist/bin/chunks/chunk-O74FSWB4.js +4 -0
- package/dist/bin/chunks/chunk-OKU677H3.js +87 -0
- package/dist/bin/chunks/chunk-P6NPCASY.js +11 -0
- package/dist/bin/chunks/chunk-PKWK3LQM.js +22 -0
- package/dist/bin/chunks/chunk-PQPFDJFF.js +34 -0
- package/dist/bin/chunks/chunk-PRKSLEHG.js +291 -0
- package/dist/bin/chunks/chunk-PUZGSIMN.js +15 -0
- package/dist/bin/chunks/chunk-Q3LE3Y66.js +13 -0
- package/dist/bin/chunks/chunk-QAYU7HPM.js +7 -0
- package/dist/bin/chunks/chunk-QES5OSUC.js +3 -0
- package/dist/bin/chunks/chunk-QF7PPON7.js +16 -0
- package/dist/bin/chunks/chunk-QK6BXSHU.js +13 -0
- package/dist/bin/chunks/chunk-RYQB6GQ7.js +11 -0
- package/dist/bin/chunks/chunk-SSK3N7FN.js +3 -0
- package/dist/bin/chunks/chunk-TL4JI2SL.js +38 -0
- package/dist/bin/chunks/chunk-TPU3OX2A.js +3 -0
- package/dist/bin/chunks/chunk-TW2IJRUF.js +3 -0
- package/dist/bin/chunks/chunk-TZ3S7MY6.js +12 -0
- package/dist/bin/chunks/chunk-VGR3NA3H.js +13 -0
- package/dist/bin/chunks/chunk-VLWZ6L7C.js +4 -0
- package/dist/bin/chunks/chunk-VTAIIBJT.js +16 -0
- package/dist/bin/chunks/chunk-VTHA5UK5.js +7 -0
- package/dist/bin/chunks/chunk-VY2K25J4.js +16 -0
- package/dist/bin/chunks/chunk-W4U4QOZF.js +7 -0
- package/dist/bin/chunks/chunk-WDV2ECOC.js +3 -0
- package/dist/bin/chunks/chunk-WFVCEB5T.js +3 -0
- package/dist/bin/chunks/chunk-WSLBBXPJ.js +12 -0
- package/dist/bin/chunks/chunk-WWOUFMMY.js +3 -0
- package/dist/bin/chunks/chunk-WYTPLN2M.js +11 -0
- package/dist/bin/chunks/chunk-X5VUGFUL.js +3 -0
- package/dist/bin/chunks/chunk-X63MJBLH.js +26 -0
- package/dist/bin/chunks/chunk-XAAXPEOP.js +6 -0
- package/dist/bin/chunks/chunk-XEQ7KSRM.js +5 -0
- package/dist/bin/chunks/chunk-YIANER7Y.js +8 -0
- package/dist/bin/chunks/chunk-YMELOXDK.js +13 -0
- package/dist/bin/chunks/chunk-YTL6DXBO.js +11 -0
- package/dist/bin/chunks/chunk-YYZSYLJO.js +6 -0
- package/dist/bin/chunks/chunk-ZXIW4JPL.js +22 -0
- package/dist/bin/chunks/clear-OE52K3TM.js +3 -0
- package/dist/bin/chunks/column-7VBJL757.js +3 -0
- package/dist/bin/chunks/comm-URDMZCXL.js +3 -0
- package/dist/bin/chunks/cp-MF5GADQN.js +3 -0
- package/dist/bin/chunks/curl-FS5LAEYI.js +30 -0
- package/dist/bin/chunks/cut-QOTYBJJJ.js +3 -0
- package/dist/bin/chunks/date-FJUBX7TJ.js +3 -0
- package/dist/bin/chunks/diff-YXZZCUSQ.js +3 -0
- package/dist/bin/chunks/dirname-TPUFCYF6.js +3 -0
- package/dist/bin/chunks/du-A3UGHIKJ.js +3 -0
- package/dist/bin/chunks/echo-4OUEL7QB.js +3 -0
- package/dist/bin/chunks/env-2TSVF4W7.js +3 -0
- package/dist/bin/chunks/expand-P6SNTBGZ.js +3 -0
- package/dist/bin/chunks/expr-56X7LYOS.js +3 -0
- package/dist/bin/chunks/file-SQSOBJLR.js +3 -0
- package/dist/bin/chunks/find-XY2NTAT5.js +3 -0
- package/dist/bin/chunks/flag-coverage-WGSE667D.js +3 -0
- package/dist/bin/chunks/fold-YEY7X54W.js +3 -0
- package/dist/bin/chunks/grep-CMT2H2S7.js +3 -0
- package/dist/bin/chunks/gzip-DJSFJOY6.js +3 -0
- package/dist/bin/chunks/head-KPRH4HKC.js +3 -0
- package/dist/bin/chunks/help-HVIDHJ6M.js +3 -0
- package/dist/bin/chunks/history-3HAU45KT.js +3 -0
- package/dist/bin/chunks/hostname-2I76DUQL.js +3 -0
- package/dist/bin/chunks/html-to-markdown-WUBAMB4O.js +3 -0
- package/dist/bin/chunks/join-UQKXU2QP.js +3 -0
- package/dist/bin/chunks/jq-ACCMBTSD.js +3 -0
- package/dist/bin/chunks/js-exec-4KNUPGHA.js +99 -0
- package/dist/bin/chunks/js-exec-worker.js +187 -110
- package/dist/bin/chunks/ln-XSDIE6SU.js +3 -0
- package/dist/bin/chunks/ls-FTHYNINH.js +3 -0
- package/dist/bin/chunks/md5sum-Z6KAYGDK.js +3 -0
- package/dist/bin/chunks/mkdir-74BP5NTG.js +3 -0
- package/dist/bin/chunks/mv-YG75IRRE.js +3 -0
- package/dist/bin/chunks/nl-XHWFVVKH.js +3 -0
- package/dist/bin/chunks/od-A7CW5RMS.js +3 -0
- package/dist/bin/chunks/paste-YJLYVJMP.js +3 -0
- package/dist/bin/chunks/printf-F2KOCULO.js +3 -0
- package/dist/bin/chunks/pwd-YKLNXWZI.js +3 -0
- package/dist/bin/chunks/python3-AYUQQRCR.js +14 -0
- package/dist/bin/chunks/readlink-HMHVGSAM.js +3 -0
- package/dist/bin/chunks/rev-CZTQCNOZ.js +3 -0
- package/dist/bin/chunks/rg-JRKJ6I4X.js +3 -0
- package/dist/bin/chunks/rm-3PLW4O4B.js +3 -0
- package/dist/bin/chunks/rmdir-DCJ3XJRR.js +3 -0
- package/dist/bin/chunks/sed-QJ2LNV2N.js +3 -0
- package/dist/bin/chunks/seq-Q4LZ6EXV.js +3 -0
- package/dist/bin/chunks/sha1sum-CATBXX76.js +3 -0
- package/dist/bin/chunks/sha256sum-YGSNBVY3.js +3 -0
- package/dist/bin/chunks/sleep-FUDWGDCE.js +3 -0
- package/dist/bin/chunks/sort-M3DO25D5.js +3 -0
- package/dist/bin/chunks/split-7IYQYKOW.js +3 -0
- package/dist/bin/chunks/sqlite3-ZXF6BGDW.js +3 -0
- package/dist/bin/chunks/sqlite3-worker.js +316 -173
- package/dist/bin/chunks/stat-Y5D3VPLG.js +3 -0
- package/dist/bin/chunks/strings-J2X2Z6N2.js +3 -0
- package/dist/bin/chunks/tac-DG4BMYM5.js +3 -0
- package/dist/bin/chunks/tail-QISQLA3I.js +3 -0
- package/dist/bin/chunks/tar-TB2XWXF6.js +3 -0
- package/dist/bin/chunks/tee-L4HKV5PD.js +3 -0
- package/dist/bin/chunks/time-LF7BTSK5.js +3 -0
- package/dist/bin/chunks/timeout-TDOV6JDA.js +3 -0
- package/dist/bin/chunks/touch-TVQAUQOG.js +3 -0
- package/dist/bin/chunks/tr-AR6EK7JH.js +3 -0
- package/dist/bin/chunks/tree-ZGP6NPGS.js +3 -0
- package/dist/bin/chunks/true-KFTJGQLQ.js +3 -0
- package/dist/bin/chunks/undici-JES22UVU.js +141 -0
- package/dist/bin/chunks/unexpand-JPOQORZF.js +3 -0
- package/dist/bin/chunks/uniq-K5VRDP4Q.js +3 -0
- package/dist/bin/chunks/wc-VSQBRD6B.js +3 -0
- package/dist/bin/chunks/which-4TPGVSBZ.js +3 -0
- package/dist/bin/chunks/whoami-B5HDVKW6.js +3 -0
- package/dist/bin/chunks/worker.js +212 -105
- package/dist/bin/chunks/xan-D6US4ZGL.js +3 -0
- package/dist/bin/chunks/xan-view-QGKWT354.js +3 -0
- package/dist/bin/chunks/xargs-HMISWW4I.js +3 -0
- package/dist/bin/chunks/yq-EYV7HLKK.js +3 -0
- package/dist/bin/just-bash.js +412 -387
- package/dist/bin/shell/chunks/alias-3R4G6HQY.js +3 -0
- package/dist/bin/shell/chunks/awk2-7UZLEPVX.js +3 -0
- package/dist/bin/shell/chunks/base64-W6FVFNXJ.js +3 -0
- package/dist/bin/shell/chunks/basename-C4CRGDXP.js +3 -0
- package/dist/bin/shell/chunks/bash-CFCBBWVH.js +3 -0
- package/dist/bin/shell/chunks/cat-5YECZSFQ.js +3 -0
- package/dist/bin/shell/chunks/chmod-45TMYSW2.js +3 -0
- package/dist/bin/shell/chunks/chunk-23OI2XDJ.js +20 -0
- package/dist/bin/shell/chunks/chunk-2OQ5HPZE.js +7 -0
- package/dist/bin/shell/chunks/chunk-2YLY6FJA.js +10 -0
- package/dist/bin/shell/chunks/chunk-3HUI54BW.js +143 -0
- package/dist/bin/shell/chunks/chunk-3OYRDLJJ.js +101 -0
- package/dist/bin/shell/chunks/chunk-3PCPQIUD.js +3 -0
- package/dist/bin/shell/chunks/chunk-3VSWQCPN.js +18 -0
- package/dist/bin/shell/chunks/chunk-43E7AR6A.js +3 -0
- package/dist/bin/shell/chunks/chunk-46CDVHZ3.js +5 -0
- package/dist/bin/shell/chunks/chunk-4SQKKW2M.js +3 -0
- package/dist/bin/shell/chunks/chunk-5SKEZPTU.js +12 -0
- package/dist/bin/shell/chunks/chunk-6D75E4LV.js +3 -0
- package/dist/bin/shell/chunks/chunk-6SAZRW7E.js +15 -0
- package/dist/bin/shell/chunks/chunk-7FGDUBSN.js +14 -0
- package/dist/bin/shell/chunks/chunk-7I6MNC5I.js +3 -0
- package/dist/bin/shell/chunks/chunk-B7RRNV3A.js +22 -0
- package/dist/bin/shell/chunks/chunk-BCJ42NCM.js +15 -0
- package/dist/bin/shell/chunks/chunk-BNYIXXC2.js +3 -0
- package/dist/bin/shell/chunks/chunk-BPWZ7ADB.js +8 -0
- package/dist/bin/shell/chunks/chunk-BWRQ5HYX.js +9 -0
- package/dist/bin/shell/chunks/chunk-CB4SODHK.js +34 -0
- package/dist/bin/shell/chunks/chunk-CC2AQ6B7.js +15 -0
- package/dist/bin/shell/chunks/chunk-CPKBPQ2C.js +3 -0
- package/dist/bin/shell/chunks/chunk-CPTQXTBJ.js +3 -0
- package/dist/bin/shell/chunks/chunk-D3MUBZ4P.js +65 -0
- package/dist/bin/shell/chunks/chunk-DN2YCFOR.js +3 -0
- package/dist/bin/shell/chunks/chunk-DSZQ22OX.js +12 -0
- package/dist/bin/shell/chunks/chunk-E5VZGTZ6.js +10 -0
- package/dist/bin/shell/chunks/chunk-ETWDDV6I.js +10 -0
- package/dist/bin/shell/chunks/chunk-GEUCQ4AB.js +10 -0
- package/dist/bin/shell/chunks/chunk-H4BRFPKY.js +3 -0
- package/dist/bin/shell/chunks/chunk-IAAPXDHN.js +11 -0
- package/dist/bin/shell/chunks/chunk-ISW2U76N.js +17 -0
- package/dist/bin/shell/chunks/chunk-JQER3HUP.js +20 -0
- package/dist/bin/shell/chunks/chunk-K5KT6DMM.js +4 -0
- package/dist/bin/shell/chunks/chunk-KG2KXL4Y.js +3 -0
- package/dist/bin/shell/chunks/chunk-LCP3IKI7.js +9 -0
- package/dist/bin/shell/chunks/chunk-LGERQ5TD.js +22 -0
- package/dist/bin/shell/chunks/chunk-LNFTLSWJ.js +22 -0
- package/dist/bin/shell/chunks/chunk-LUHU7UUN.js +7 -0
- package/dist/bin/shell/chunks/chunk-LXFMIXGA.js +3 -0
- package/dist/bin/shell/chunks/chunk-MYTNZ7MA.js +7 -0
- package/dist/bin/shell/chunks/chunk-MZM7RVYU.js +8 -0
- package/dist/bin/shell/chunks/chunk-NGD6G5ZG.js +9 -0
- package/dist/bin/shell/chunks/chunk-NJ67YJRE.js +6 -0
- package/dist/bin/shell/chunks/chunk-NQQ3X7MZ.js +36 -0
- package/dist/bin/shell/chunks/chunk-O74FSWB4.js +4 -0
- package/dist/bin/shell/chunks/chunk-OKU677H3.js +87 -0
- package/dist/bin/shell/chunks/chunk-P6NPCASY.js +11 -0
- package/dist/bin/shell/chunks/chunk-PKWK3LQM.js +22 -0
- package/dist/bin/shell/chunks/chunk-PQPFDJFF.js +34 -0
- package/dist/bin/shell/chunks/chunk-PRKSLEHG.js +291 -0
- package/dist/bin/shell/chunks/chunk-PUZGSIMN.js +15 -0
- package/dist/bin/shell/chunks/chunk-Q3LE3Y66.js +13 -0
- package/dist/bin/shell/chunks/chunk-QAYU7HPM.js +7 -0
- package/dist/bin/shell/chunks/chunk-QES5OSUC.js +3 -0
- package/dist/bin/shell/chunks/chunk-QF7PPON7.js +16 -0
- package/dist/bin/shell/chunks/chunk-QK6BXSHU.js +13 -0
- package/dist/bin/shell/chunks/chunk-RYQB6GQ7.js +11 -0
- package/dist/bin/shell/chunks/chunk-SSK3N7FN.js +3 -0
- package/dist/bin/shell/chunks/chunk-TL4JI2SL.js +38 -0
- package/dist/bin/shell/chunks/chunk-TPU3OX2A.js +3 -0
- package/dist/bin/shell/chunks/chunk-TW2IJRUF.js +3 -0
- package/dist/bin/shell/chunks/chunk-TZ3S7MY6.js +12 -0
- package/dist/bin/shell/chunks/chunk-VGR3NA3H.js +13 -0
- package/dist/bin/shell/chunks/chunk-VLWZ6L7C.js +4 -0
- package/dist/bin/shell/chunks/chunk-VTAIIBJT.js +16 -0
- package/dist/bin/shell/chunks/chunk-VTHA5UK5.js +7 -0
- package/dist/bin/shell/chunks/chunk-VY2K25J4.js +16 -0
- package/dist/bin/shell/chunks/chunk-W4U4QOZF.js +7 -0
- package/dist/bin/shell/chunks/chunk-WDV2ECOC.js +3 -0
- package/dist/bin/shell/chunks/chunk-WFVCEB5T.js +3 -0
- package/dist/bin/shell/chunks/chunk-WSLBBXPJ.js +12 -0
- package/dist/bin/shell/chunks/chunk-WWOUFMMY.js +3 -0
- package/dist/bin/shell/chunks/chunk-WYTPLN2M.js +11 -0
- package/dist/bin/shell/chunks/chunk-X5VUGFUL.js +3 -0
- package/dist/bin/shell/chunks/chunk-X63MJBLH.js +26 -0
- package/dist/bin/shell/chunks/chunk-XAAXPEOP.js +6 -0
- package/dist/bin/shell/chunks/chunk-XEQ7KSRM.js +5 -0
- package/dist/bin/shell/chunks/chunk-YIANER7Y.js +8 -0
- package/dist/bin/shell/chunks/chunk-YMELOXDK.js +13 -0
- package/dist/bin/shell/chunks/chunk-YTL6DXBO.js +11 -0
- package/dist/bin/shell/chunks/chunk-YYZSYLJO.js +6 -0
- package/dist/bin/shell/chunks/chunk-ZXIW4JPL.js +22 -0
- package/dist/bin/shell/chunks/clear-OE52K3TM.js +3 -0
- package/dist/bin/shell/chunks/column-7VBJL757.js +3 -0
- package/dist/bin/shell/chunks/comm-URDMZCXL.js +3 -0
- package/dist/bin/shell/chunks/cp-MF5GADQN.js +3 -0
- package/dist/bin/shell/chunks/curl-FS5LAEYI.js +30 -0
- package/dist/bin/shell/chunks/cut-QOTYBJJJ.js +3 -0
- package/dist/bin/shell/chunks/date-FJUBX7TJ.js +3 -0
- package/dist/bin/shell/chunks/diff-YXZZCUSQ.js +3 -0
- package/dist/bin/shell/chunks/dirname-TPUFCYF6.js +3 -0
- package/dist/bin/shell/chunks/du-A3UGHIKJ.js +3 -0
- package/dist/bin/shell/chunks/echo-4OUEL7QB.js +3 -0
- package/dist/bin/shell/chunks/env-2TSVF4W7.js +3 -0
- package/dist/bin/shell/chunks/expand-P6SNTBGZ.js +3 -0
- package/dist/bin/shell/chunks/expr-56X7LYOS.js +3 -0
- package/dist/bin/shell/chunks/file-SQSOBJLR.js +3 -0
- package/dist/bin/shell/chunks/find-XY2NTAT5.js +3 -0
- package/dist/bin/shell/chunks/flag-coverage-WGSE667D.js +3 -0
- package/dist/bin/shell/chunks/fold-YEY7X54W.js +3 -0
- package/dist/bin/shell/chunks/grep-CMT2H2S7.js +3 -0
- package/dist/bin/shell/chunks/gzip-DJSFJOY6.js +3 -0
- package/dist/bin/shell/chunks/head-KPRH4HKC.js +3 -0
- package/dist/bin/shell/chunks/help-HVIDHJ6M.js +3 -0
- package/dist/bin/shell/chunks/history-3HAU45KT.js +3 -0
- package/dist/bin/shell/chunks/hostname-2I76DUQL.js +3 -0
- package/dist/bin/shell/chunks/html-to-markdown-WUBAMB4O.js +3 -0
- package/dist/bin/shell/chunks/join-UQKXU2QP.js +3 -0
- package/dist/bin/shell/chunks/jq-ACCMBTSD.js +3 -0
- package/dist/bin/shell/chunks/js-exec-4KNUPGHA.js +99 -0
- package/dist/bin/shell/chunks/ln-XSDIE6SU.js +3 -0
- package/dist/bin/shell/chunks/ls-FTHYNINH.js +3 -0
- package/dist/bin/shell/chunks/md5sum-Z6KAYGDK.js +3 -0
- package/dist/bin/shell/chunks/mkdir-74BP5NTG.js +3 -0
- package/dist/bin/shell/chunks/mv-YG75IRRE.js +3 -0
- package/dist/bin/shell/chunks/nl-XHWFVVKH.js +3 -0
- package/dist/bin/shell/chunks/od-A7CW5RMS.js +3 -0
- package/dist/bin/shell/chunks/paste-YJLYVJMP.js +3 -0
- package/dist/bin/shell/chunks/printf-F2KOCULO.js +3 -0
- package/dist/bin/shell/chunks/pwd-YKLNXWZI.js +3 -0
- package/dist/bin/shell/chunks/python3-AYUQQRCR.js +14 -0
- package/dist/bin/shell/chunks/readlink-HMHVGSAM.js +3 -0
- package/dist/bin/shell/chunks/rev-CZTQCNOZ.js +3 -0
- package/dist/bin/shell/chunks/rg-JRKJ6I4X.js +3 -0
- package/dist/bin/shell/chunks/rm-3PLW4O4B.js +3 -0
- package/dist/bin/shell/chunks/rmdir-DCJ3XJRR.js +3 -0
- package/dist/bin/shell/chunks/sed-QJ2LNV2N.js +3 -0
- package/dist/bin/shell/chunks/seq-Q4LZ6EXV.js +3 -0
- package/dist/bin/shell/chunks/sha1sum-CATBXX76.js +3 -0
- package/dist/bin/shell/chunks/sha256sum-YGSNBVY3.js +3 -0
- package/dist/bin/shell/chunks/sleep-FUDWGDCE.js +3 -0
- package/dist/bin/shell/chunks/sort-M3DO25D5.js +3 -0
- package/dist/bin/shell/chunks/split-7IYQYKOW.js +3 -0
- package/dist/bin/shell/chunks/sqlite3-ZXF6BGDW.js +3 -0
- package/dist/bin/shell/chunks/stat-Y5D3VPLG.js +3 -0
- package/dist/bin/shell/chunks/strings-J2X2Z6N2.js +3 -0
- package/dist/bin/shell/chunks/tac-DG4BMYM5.js +3 -0
- package/dist/bin/shell/chunks/tail-QISQLA3I.js +3 -0
- package/dist/bin/shell/chunks/tar-TB2XWXF6.js +3 -0
- package/dist/bin/shell/chunks/tee-L4HKV5PD.js +3 -0
- package/dist/bin/shell/chunks/time-LF7BTSK5.js +3 -0
- package/dist/bin/shell/chunks/timeout-TDOV6JDA.js +3 -0
- package/dist/bin/shell/chunks/touch-TVQAUQOG.js +3 -0
- package/dist/bin/shell/chunks/tr-AR6EK7JH.js +3 -0
- package/dist/bin/shell/chunks/tree-ZGP6NPGS.js +3 -0
- package/dist/bin/shell/chunks/true-KFTJGQLQ.js +3 -0
- package/dist/bin/shell/chunks/undici-JES22UVU.js +141 -0
- package/dist/bin/shell/chunks/unexpand-JPOQORZF.js +3 -0
- package/dist/bin/shell/chunks/uniq-K5VRDP4Q.js +3 -0
- package/dist/bin/shell/chunks/wc-VSQBRD6B.js +3 -0
- package/dist/bin/shell/chunks/which-4TPGVSBZ.js +3 -0
- package/dist/bin/shell/chunks/whoami-B5HDVKW6.js +3 -0
- package/dist/bin/shell/chunks/xan-D6US4ZGL.js +3 -0
- package/dist/bin/shell/chunks/xan-view-QGKWT354.js +3 -0
- package/dist/bin/shell/chunks/xargs-HMISWW4I.js +3 -0
- package/dist/bin/shell/chunks/yq-EYV7HLKK.js +3 -0
- package/dist/bin/shell/shell.js +413 -391
- package/dist/bounded-builder.d.ts +37 -0
- package/dist/browser.d.ts +3 -3
- package/dist/bundle/browser.js +869 -832
- package/dist/bundle/chunks/alias-T5TO5GWK.js +2 -0
- package/dist/bundle/chunks/awk2-IPNBFNH2.js +2 -0
- package/dist/bundle/chunks/base64-OXGTKKDA.js +2 -0
- package/dist/bundle/chunks/basename-SJZQ5W65.js +2 -0
- package/dist/bundle/chunks/bash-HIEWVHJ2.js +2 -0
- package/dist/bundle/chunks/cat-636HYSH4.js +2 -0
- package/dist/bundle/chunks/chmod-4CIOYX5Q.js +2 -0
- package/dist/bundle/chunks/chunk-273265WK.js +6 -0
- package/dist/bundle/chunks/chunk-2KNTH3KH.js +9 -0
- package/dist/bundle/chunks/chunk-2VWG4LDT.js +11 -0
- package/dist/bundle/chunks/chunk-3DHFIWMM.js +15 -0
- package/dist/bundle/chunks/chunk-5ATEFZLC.js +4 -0
- package/dist/bundle/chunks/chunk-5HXWWNWH.js +11 -0
- package/dist/bundle/chunks/chunk-5KGKXQF6.js +142 -0
- package/dist/bundle/chunks/chunk-5VCAQBXL.js +17 -0
- package/dist/bundle/chunks/chunk-65Z4QURM.js +12 -0
- package/dist/bundle/chunks/chunk-6D3WD6YU.js +3 -0
- package/dist/bundle/chunks/chunk-6IUGGJ2Y.js +8 -0
- package/dist/bundle/chunks/chunk-6R4OQQWP.js +16 -0
- package/dist/bundle/chunks/chunk-6WGIZV3E.js +13 -0
- package/dist/bundle/chunks/chunk-AFFAMSJT.js +14 -0
- package/dist/bundle/chunks/chunk-AH7VTVWU.js +2 -0
- package/dist/bundle/chunks/chunk-AI5LSBJC.js +2 -0
- package/dist/bundle/chunks/chunk-AMLHAS2N.js +15 -0
- package/dist/bundle/chunks/chunk-ANCQ4SCV.js +2 -0
- package/dist/bundle/chunks/chunk-B3NGH6KE.js +5 -0
- package/dist/bundle/chunks/chunk-B5Z5HTFY.js +14 -0
- package/dist/bundle/chunks/chunk-BRJERIF4.js +2 -0
- package/dist/bundle/chunks/chunk-CHHWTPDH.js +3 -0
- package/dist/bundle/chunks/chunk-CN3HTJTZ.js +11 -0
- package/dist/bundle/chunks/chunk-D3W7DTI6.js +9 -0
- package/dist/bundle/chunks/chunk-E3D4WVAH.js +21 -0
- package/dist/bundle/chunks/chunk-EAQUR2NP.js +25 -0
- package/dist/bundle/chunks/chunk-EFORKKSH.js +8 -0
- package/dist/bundle/chunks/chunk-EJFBIRMD.js +6 -0
- package/dist/bundle/chunks/chunk-ELHOZMBD.js +10 -0
- package/dist/bundle/chunks/chunk-EQQGPAXI.js +9 -0
- package/dist/bundle/chunks/chunk-EWWPEE2G.js +37 -0
- package/dist/bundle/chunks/chunk-FBXMKFE2.js +2 -0
- package/dist/bundle/chunks/chunk-FIMO5HLX.js +2 -0
- package/dist/bundle/chunks/chunk-FT6ODGOU.js +2 -0
- package/dist/bundle/chunks/chunk-G4SEENI7.js +6 -0
- package/dist/bundle/chunks/chunk-GN6CQ3J4.js +2 -0
- package/dist/bundle/chunks/chunk-HW6ZCMM5.js +9 -0
- package/dist/bundle/chunks/chunk-IBRT3OJS.js +2 -0
- package/dist/bundle/chunks/chunk-INDA53JL.js +21 -0
- package/dist/bundle/chunks/chunk-INHMNORI.js +6 -0
- package/dist/bundle/chunks/chunk-J2OBOJ64.js +2 -0
- package/dist/bundle/chunks/chunk-JCPCQREJ.js +15 -0
- package/dist/bundle/chunks/chunk-JYQ6MII2.js +33 -0
- package/dist/bundle/chunks/chunk-K3XJ2WT4.js +2 -0
- package/dist/bundle/chunks/chunk-KIGPB52X.js +2 -0
- package/dist/bundle/chunks/chunk-KKVPMNSS.js +5 -0
- package/dist/bundle/chunks/chunk-LGLR6TFP.js +7 -0
- package/dist/bundle/chunks/chunk-LJRVJXUI.js +2 -0
- package/dist/bundle/chunks/chunk-LVDUF74R.js +7 -0
- package/dist/bundle/chunks/chunk-MAWVZWRK.js +12 -0
- package/dist/bundle/chunks/chunk-MF4F4ZPP.js +7 -0
- package/dist/bundle/chunks/chunk-MFGH46GH.js +14 -0
- package/dist/bundle/chunks/chunk-N4TGZ6H7.js +7 -0
- package/dist/bundle/chunks/chunk-NCUTH6QL.js +2 -0
- package/dist/bundle/chunks/chunk-NNH4ERNJ.js +100 -0
- package/dist/bundle/chunks/chunk-NOPXHH6G.js +290 -0
- package/dist/bundle/chunks/chunk-OQ7C4FYO.js +2 -0
- package/dist/bundle/chunks/chunk-ORDZCFFT.js +2 -0
- package/dist/bundle/chunks/chunk-OTYP7VVT.js +21 -0
- package/dist/bundle/chunks/chunk-P5BOIHWV.js +6 -0
- package/dist/bundle/chunks/chunk-PJWSSENQ.js +5 -0
- package/dist/bundle/chunks/chunk-PMYUC5JF.js +12 -0
- package/dist/bundle/chunks/chunk-POIWRLUV.js +6 -0
- package/dist/bundle/chunks/chunk-PPDMRIJ7.js +11 -0
- package/dist/bundle/chunks/chunk-QTLI5LUD.js +21 -0
- package/dist/bundle/chunks/chunk-R2FBRMDU.js +14 -0
- package/dist/bundle/chunks/chunk-RAHPENCM.js +35 -0
- package/dist/bundle/chunks/chunk-SELXJ5KQ.js +10 -0
- package/dist/bundle/chunks/chunk-T2RHALUC.js +64 -0
- package/dist/bundle/chunks/chunk-UB6T3UHL.js +8 -0
- package/dist/bundle/chunks/chunk-UBTKJ6MG.js +4 -0
- package/dist/bundle/chunks/chunk-UHHCL65P.js +3 -0
- package/dist/bundle/chunks/chunk-UK4BO5W3.js +2 -0
- package/dist/bundle/chunks/chunk-UTKGYVUZ.js +7 -0
- package/dist/bundle/chunks/chunk-VECGTAPW.js +10 -0
- package/dist/bundle/chunks/chunk-VOSNSQE2.js +2 -0
- package/dist/bundle/chunks/chunk-WENIVVEE.js +19 -0
- package/dist/bundle/chunks/chunk-WHHRIZS3.js +10 -0
- package/dist/bundle/chunks/chunk-WZQNMEQW.js +2 -0
- package/dist/bundle/chunks/chunk-XVL654YD.js +33 -0
- package/dist/bundle/chunks/chunk-Y3DGIAIG.js +21 -0
- package/dist/bundle/chunks/chunk-Y62SXZKJ.js +12 -0
- package/dist/bundle/chunks/chunk-YOUUMJLJ.js +10 -0
- package/dist/bundle/chunks/chunk-YUSFCOM7.js +2 -0
- package/dist/bundle/chunks/clear-KPIUNI6K.js +2 -0
- package/dist/bundle/chunks/column-LKMDIDCH.js +2 -0
- package/dist/bundle/chunks/comm-DTWKU2MC.js +2 -0
- package/dist/bundle/chunks/cp-FKTQRFYJ.js +2 -0
- package/dist/bundle/chunks/curl-DEHFBW27.js +29 -0
- package/dist/bundle/chunks/cut-RWPUW5FY.js +2 -0
- package/dist/bundle/chunks/date-FN2DXAEE.js +2 -0
- package/dist/bundle/chunks/diff-CSARC7WF.js +2 -0
- package/dist/bundle/chunks/dirname-Z2ZMOOW2.js +2 -0
- package/dist/bundle/chunks/du-PR3M44X6.js +2 -0
- package/dist/bundle/chunks/echo-HZOVZAPR.js +2 -0
- package/dist/bundle/chunks/env-VUUMB47B.js +2 -0
- package/dist/bundle/chunks/expand-2BPPGGSM.js +2 -0
- package/dist/bundle/chunks/expr-SHRJJ4PX.js +2 -0
- package/dist/bundle/chunks/file-YC4YEI4P.js +2 -0
- package/dist/bundle/chunks/find-DWWMZFO5.js +2 -0
- package/dist/bundle/chunks/flag-coverage-THYQHOT3.js +2 -0
- package/dist/bundle/chunks/fold-QJBPHRFJ.js +2 -0
- package/dist/bundle/chunks/grep-S6SNTIHZ.js +2 -0
- package/dist/bundle/chunks/gzip-BTI6CWY4.js +2 -0
- package/dist/bundle/chunks/head-UCOA3VQC.js +2 -0
- package/dist/bundle/chunks/help-QDDMBDU7.js +2 -0
- package/dist/bundle/chunks/history-3N762S3K.js +2 -0
- package/dist/bundle/chunks/hostname-CESD3CQR.js +2 -0
- package/dist/bundle/chunks/html-to-markdown-NUF6QEX4.js +2 -0
- package/dist/bundle/chunks/join-KQ4Z5OD4.js +2 -0
- package/dist/bundle/chunks/jq-D6N4QCAJ.js +2 -0
- package/dist/bundle/chunks/js-exec-PNUEDFT5.js +98 -0
- package/dist/bundle/chunks/js-exec-worker.js +187 -110
- package/dist/bundle/chunks/ln-VYDFOFNO.js +2 -0
- package/dist/bundle/chunks/ls-R5CQLZQM.js +2 -0
- package/dist/bundle/chunks/md5sum-JEDX55KS.js +2 -0
- package/dist/bundle/chunks/mkdir-WDDKK2P3.js +2 -0
- package/dist/bundle/chunks/mv-XSJA2FNL.js +2 -0
- package/dist/bundle/chunks/nl-RFXH2GNX.js +2 -0
- package/dist/bundle/chunks/od-YXD2NNIU.js +2 -0
- package/dist/bundle/chunks/paste-ZU3EODNI.js +2 -0
- package/dist/bundle/chunks/printf-QHD2JRWQ.js +2 -0
- package/dist/bundle/chunks/pwd-76BPYV5F.js +2 -0
- package/dist/bundle/chunks/python3-QDNG2UXX.js +13 -0
- package/dist/bundle/chunks/readlink-IY6QKK2P.js +2 -0
- package/dist/bundle/chunks/rev-EPOS3MFH.js +2 -0
- package/dist/bundle/chunks/rg-OUJZ5DH6.js +2 -0
- package/dist/bundle/chunks/rm-JQ4GDKDD.js +2 -0
- package/dist/bundle/chunks/rmdir-WZKAT6M5.js +2 -0
- package/dist/bundle/chunks/sed-TZIPJOGL.js +2 -0
- package/dist/bundle/chunks/seq-5R2GKXC6.js +2 -0
- package/dist/bundle/chunks/sha1sum-BLPZJ6MP.js +2 -0
- package/dist/bundle/chunks/sha256sum-VJZ4PHQ4.js +2 -0
- package/dist/bundle/chunks/sleep-VPYWSKDR.js +2 -0
- package/dist/bundle/chunks/sort-PV2NEQHF.js +2 -0
- package/dist/bundle/chunks/split-KNDNAFPT.js +2 -0
- package/dist/bundle/chunks/sqlite3-WWZJZW37.js +2 -0
- package/dist/bundle/chunks/sqlite3-worker.js +316 -173
- package/dist/bundle/chunks/stat-MLNSW25G.js +2 -0
- package/dist/bundle/chunks/strings-WTD7Q2EF.js +2 -0
- package/dist/bundle/chunks/tac-YXC4HBTR.js +2 -0
- package/dist/bundle/chunks/tail-G3W6PNG3.js +2 -0
- package/dist/bundle/chunks/tar-GLX6QUHW.js +2 -0
- package/dist/bundle/chunks/tee-OOWSWHRQ.js +2 -0
- package/dist/bundle/chunks/time-NERE2JJ2.js +2 -0
- package/dist/bundle/chunks/timeout-SYQCWBMZ.js +2 -0
- package/dist/bundle/chunks/touch-W4DF6Z4T.js +2 -0
- package/dist/bundle/chunks/tr-3KPFH3J4.js +2 -0
- package/dist/bundle/chunks/tree-7OOL2MH6.js +2 -0
- package/dist/bundle/chunks/true-QUBPEGGU.js +2 -0
- package/dist/bundle/chunks/undici-HCLAUJT3.js +140 -0
- package/dist/bundle/chunks/unexpand-YD5BWFH4.js +2 -0
- package/dist/bundle/chunks/uniq-OVOW532K.js +2 -0
- package/dist/bundle/chunks/wc-RUR7HE5O.js +2 -0
- package/dist/bundle/chunks/which-UWVKETYW.js +2 -0
- package/dist/bundle/chunks/whoami-KR6E7UIR.js +2 -0
- package/dist/bundle/chunks/worker.js +212 -105
- package/dist/bundle/chunks/xan-KKPV2TJ3.js +2 -0
- package/dist/bundle/chunks/xan-view-47P277LZ.js +2 -0
- package/dist/bundle/chunks/xargs-L7TJHOJT.js +2 -0
- package/dist/bundle/chunks/yq-ZGB3W46S.js +2 -0
- package/dist/bundle/index.cjs +1450 -1263
- package/dist/bundle/index.js +407 -386
- package/dist/commands/alias/alias.d.ts +3 -3
- package/dist/commands/awk/awk2.d.ts +3 -3
- package/dist/commands/awk/builtins.d.ts +1 -1
- package/dist/commands/awk/interpreter/context.d.ts +13 -0
- package/dist/commands/awk/lexer.d.ts +2 -1
- package/dist/commands/awk/parser2-print.d.ts +3 -0
- package/dist/commands/awk/parser2.d.ts +15 -0
- package/dist/commands/base64/base64.d.ts +2 -2
- package/dist/commands/basename/basename.d.ts +2 -2
- package/dist/commands/bash/bash.d.ts +3 -3
- package/dist/commands/cat/cat.d.ts +2 -2
- package/dist/commands/chmod/chmod.d.ts +2 -2
- package/dist/commands/clear/clear.d.ts +2 -2
- package/dist/commands/column/column.d.ts +2 -2
- package/dist/commands/comm/comm.d.ts +2 -2
- package/dist/commands/compression/codec-budget.d.ts +35 -0
- package/dist/commands/cp/cp.d.ts +2 -2
- package/dist/commands/curl/curl.d.ts +2 -2
- package/dist/commands/curl/form.d.ts +3 -1
- package/dist/commands/curl/types.d.ts +30 -25
- package/dist/commands/cut/cut.d.ts +2 -2
- package/dist/commands/date/date.d.ts +2 -2
- package/dist/commands/diff/diff.d.ts +2 -2
- package/dist/commands/dirname/dirname.d.ts +2 -2
- package/dist/commands/du/du.d.ts +2 -2
- package/dist/commands/echo/echo.d.ts +2 -2
- package/dist/commands/env/env.d.ts +3 -3
- package/dist/commands/expand/expand.d.ts +2 -2
- package/dist/commands/expand/unexpand.d.ts +2 -2
- package/dist/commands/expr/expr.d.ts +2 -2
- package/dist/commands/file/file.d.ts +2 -2
- package/dist/commands/find/find.d.ts +2 -2
- package/dist/commands/find/matcher.d.ts +0 -16
- package/dist/commands/find/types.d.ts +3 -2
- package/dist/commands/fold/fold.d.ts +2 -2
- package/dist/commands/grep/grep.d.ts +4 -4
- package/dist/commands/gzip/gzip.d.ts +4 -4
- package/dist/commands/head/head-tail-shared.d.ts +2 -2
- package/dist/commands/head/head.d.ts +2 -2
- package/dist/commands/help/help.d.ts +2 -2
- package/dist/commands/history/history.d.ts +2 -2
- package/dist/commands/hostname/hostname.d.ts +2 -2
- package/dist/commands/html-to-markdown/html-to-markdown.d.ts +2 -2
- package/dist/commands/join/join.d.ts +2 -2
- package/dist/commands/jq/jq.d.ts +3 -3
- package/dist/commands/js-exec/fetch-polyfill.d.ts +1 -1
- package/dist/commands/js-exec/js-exec-worker.d.ts +1 -0
- package/dist/commands/js-exec/js-exec.d.ts +5 -3
- package/dist/commands/ln/ln.d.ts +2 -2
- package/dist/commands/ls/ls.d.ts +2 -2
- package/dist/commands/md5sum/checksum.d.ts +2 -2
- package/dist/commands/md5sum/md5sum.d.ts +2 -2
- package/dist/commands/md5sum/sha1sum.d.ts +2 -2
- package/dist/commands/md5sum/sha256sum.d.ts +2 -2
- package/dist/commands/mkdir/mkdir.d.ts +2 -2
- package/dist/commands/mv/mv.d.ts +2 -2
- package/dist/commands/nl/nl.d.ts +2 -2
- package/dist/commands/od/od.d.ts +2 -2
- package/dist/commands/paste/paste.d.ts +2 -2
- package/dist/commands/printf/escapes.d.ts +5 -3
- package/dist/commands/printf/printf.d.ts +2 -2
- package/dist/commands/printf/strftime.d.ts +6 -1
- package/dist/commands/pwd/pwd.d.ts +2 -2
- package/dist/commands/python3/python3.d.ts +3 -3
- package/dist/commands/python3/worker.d.ts +2 -0
- package/dist/commands/query-engine/builtins/control-builtins.d.ts +1 -1
- package/dist/commands/query-engine/builtins/path-builtins.d.ts +1 -1
- package/dist/commands/query-engine/evaluator.d.ts +15 -1
- package/dist/commands/query-engine/json-output.d.ts +11 -0
- package/dist/commands/query-engine/parser.d.ts +6 -1
- package/dist/commands/query-engine/safe-object.d.ts +9 -8
- package/dist/commands/query-engine/value-operations.d.ts +4 -1
- package/dist/commands/readlink/readlink.d.ts +2 -2
- package/dist/commands/registry.d.ts +5 -5
- package/dist/commands/rev/rev.d.ts +2 -2
- package/dist/commands/rg/rg-search.d.ts +2 -2
- package/dist/commands/rg/rg.d.ts +2 -2
- package/dist/commands/rm/rm.d.ts +2 -2
- package/dist/commands/rmdir/rmdir.d.ts +2 -2
- package/dist/commands/search-engine/matcher.d.ts +6 -0
- package/dist/commands/sed/lexer.d.ts +3 -1
- package/dist/commands/sed/parser.d.ts +4 -1
- package/dist/commands/sed/sed.d.ts +2 -2
- package/dist/commands/seq/seq.d.ts +2 -2
- package/dist/commands/sleep/sleep.d.ts +2 -2
- package/dist/commands/sort/sort.d.ts +2 -2
- package/dist/commands/split/split.d.ts +2 -2
- package/dist/commands/sqlite3/formatters.d.ts +2 -0
- package/dist/commands/sqlite3/sqlite3.d.ts +3 -2
- package/dist/commands/sqlite3/worker.d.ts +5 -0
- package/dist/commands/sqlite3/worker.js +316 -173
- package/dist/commands/stat/stat.d.ts +2 -2
- package/dist/commands/strings/strings.d.ts +2 -2
- package/dist/commands/tac/tac.d.ts +2 -2
- package/dist/commands/tail/tail.d.ts +2 -2
- package/dist/commands/tar/archive.d.ts +29 -14
- package/dist/commands/tar/bzip2-compress.d.ts +2 -1
- package/dist/commands/tar/tar.d.ts +2 -2
- package/dist/commands/tee/tee.d.ts +2 -2
- package/dist/commands/time/time.d.ts +2 -2
- package/dist/commands/timeout/timeout.d.ts +2 -2
- package/dist/commands/touch/touch.d.ts +2 -2
- package/dist/commands/tr/tr.d.ts +2 -2
- package/dist/commands/tree/tree.d.ts +2 -2
- package/dist/commands/true/true.d.ts +3 -3
- package/dist/commands/uniq/uniq.d.ts +2 -2
- package/dist/commands/wc/wc.d.ts +2 -2
- package/dist/commands/which/which.d.ts +2 -2
- package/dist/commands/whoami/whoami.d.ts +2 -2
- package/dist/commands/worker-request-controller.d.ts +36 -0
- package/dist/commands/xan/aggregation.d.ts +13 -3
- package/dist/commands/xan/bounded-output.d.ts +4 -0
- package/dist/commands/xan/column-selection.d.ts +2 -1
- package/dist/commands/xan/csv.d.ts +29 -4
- package/dist/commands/xan/moonblade-parser.d.ts +11 -2
- package/dist/commands/xan/moonblade-to-jq.d.ts +2 -2
- package/dist/commands/xan/moonblade-tokenizer.d.ts +8 -1
- package/dist/commands/xan/xan-agg.d.ts +5 -5
- package/dist/commands/xan/xan-columns.d.ts +5 -5
- package/dist/commands/xan/xan-core.d.ts +7 -7
- package/dist/commands/xan/xan-data.d.ts +8 -8
- package/dist/commands/xan/xan-filter.d.ts +5 -5
- package/dist/commands/xan/xan-map.d.ts +3 -3
- package/dist/commands/xan/xan-reshape.d.ts +6 -6
- package/dist/commands/xan/xan-simple.d.ts +7 -7
- package/dist/commands/xan/xan-view.d.ts +3 -3
- package/dist/commands/xan/xan.d.ts +2 -2
- package/dist/commands/xargs/xargs.d.ts +2 -2
- package/dist/commands/yq/formats.d.ts +5 -4
- package/dist/commands/yq/yq.d.ts +3 -3
- package/dist/custom-commands.d.ts +25 -2
- package/dist/encoding.d.ts +5 -3
- package/dist/execution-output.d.ts +28 -0
- package/dist/execution-scope.d.ts +89 -0
- package/dist/fatal-execution-error.d.ts +5 -0
- package/dist/fs/identity.d.ts +9 -0
- package/dist/fs/in-memory-fs/in-memory-fs.d.ts +24 -1
- package/dist/fs/interface.d.ts +4 -0
- package/dist/fs/overlay-fs/overlay-fs.d.ts +13 -0
- package/dist/fs/path-utils.d.ts +2 -0
- package/dist/fs/read-write-fs/read-write-fs.d.ts +11 -0
- package/dist/fs/real-fs-utils.d.ts +1 -1
- package/dist/fs/traversal.d.ts +98 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/interpreter/alias-expansion.d.ts +4 -0
- package/dist/interpreter/builtins/declare-array-parsing.d.ts +6 -2
- package/dist/interpreter/builtins/index.d.ts +0 -1
- package/dist/interpreter/builtins/variable-assignment.d.ts +4 -1
- package/dist/interpreter/conditionals.d.ts +1 -1
- package/dist/interpreter/defense-aware-command-context.d.ts +2 -2
- package/dist/interpreter/errors.d.ts +7 -17
- package/dist/interpreter/expansion/brace-range.d.ts +5 -1
- package/dist/interpreter/expansion/pattern-removal.d.ts +2 -3
- package/dist/interpreter/expansion/pattern-replacement.d.ts +4 -0
- package/dist/interpreter/expansion/tilde.d.ts +2 -0
- package/dist/interpreter/helpers/array.d.ts +16 -3
- package/dist/interpreter/helpers/bounded-array.d.ts +2 -0
- package/dist/interpreter/helpers/condition.d.ts +2 -5
- package/dist/interpreter/helpers/ifs.d.ts +3 -3
- package/dist/interpreter/helpers/quoting.d.ts +2 -0
- package/dist/interpreter/helpers/string-compare.d.ts +1 -1
- package/dist/interpreter/interpreter.d.ts +4 -8
- package/dist/interpreter/redirections.d.ts +5 -2
- package/dist/interpreter/simple-command-assignments.d.ts +7 -0
- package/dist/interpreter/state-transaction.d.ts +7 -0
- package/dist/interpreter/types.d.ts +24 -8
- package/dist/limits.d.ts +76 -17
- package/dist/network/dns-pin.d.ts +23 -32
- package/dist/network/fetch.d.ts +4 -0
- package/dist/network/types.d.ts +10 -1
- package/dist/parser/parser.d.ts +5 -2
- package/dist/parser/types.d.ts +10 -1
- package/dist/source-limit.d.ts +2 -0
- package/dist/timers.d.ts +12 -0
- package/dist/types.d.ts +43 -7
- package/dist/utils/file-reader.d.ts +5 -3
- package/package.json +10 -5
- package/dist/bin/chunks/alias-YRVAW27Y.js +0 -3
- package/dist/bin/chunks/awk2-UFCNQFCV.js +0 -3
- package/dist/bin/chunks/base64-EGKVQIBC.js +0 -3
- package/dist/bin/chunks/basename-F3AQ4KAQ.js +0 -3
- package/dist/bin/chunks/bash-BEG4JB7K.js +0 -3
- package/dist/bin/chunks/cat-NBL6MU5H.js +0 -3
- package/dist/bin/chunks/chmod-S564JCJW.js +0 -3
- package/dist/bin/chunks/chunk-2AIXTPH2.js +0 -9
- package/dist/bin/chunks/chunk-2GG3NVC4.js +0 -10
- package/dist/bin/chunks/chunk-2ZAK22BG.js +0 -9
- package/dist/bin/chunks/chunk-3WIMLJM7.js +0 -8
- package/dist/bin/chunks/chunk-47WZ2U6M.js +0 -9
- package/dist/bin/chunks/chunk-4BNS566Q.js +0 -4
- package/dist/bin/chunks/chunk-52FZYTIX.js +0 -34
- package/dist/bin/chunks/chunk-5KX5YUWT.js +0 -37
- package/dist/bin/chunks/chunk-5XSZHUEI.js +0 -15
- package/dist/bin/chunks/chunk-63LSI3D6.js +0 -17
- package/dist/bin/chunks/chunk-6FYCU7QB.js +0 -3
- package/dist/bin/chunks/chunk-6JKLDBRW.js +0 -18
- package/dist/bin/chunks/chunk-6WJQNLR2.js +0 -7
- package/dist/bin/chunks/chunk-7HK63L6Y.js +0 -3
- package/dist/bin/chunks/chunk-7NDRU2ZN.js +0 -5
- package/dist/bin/chunks/chunk-7VCQWCSH.js +0 -15
- package/dist/bin/chunks/chunk-AFAD5U2A.js +0 -8
- package/dist/bin/chunks/chunk-AZH64XMJ.js +0 -3
- package/dist/bin/chunks/chunk-BKQLXMS6.js +0 -36
- package/dist/bin/chunks/chunk-BPZJYOUA.js +0 -33
- package/dist/bin/chunks/chunk-BZP56QBM.js +0 -24
- package/dist/bin/chunks/chunk-C6JOQKE2.js +0 -22
- package/dist/bin/chunks/chunk-CX5CEEGI.js +0 -11
- package/dist/bin/chunks/chunk-D7YFPDMV.js +0 -22
- package/dist/bin/chunks/chunk-DHIKZU63.js +0 -3
- package/dist/bin/chunks/chunk-DWECIBLJ.js +0 -3
- package/dist/bin/chunks/chunk-FEENTUVZ.js +0 -18
- package/dist/bin/chunks/chunk-FYCT4DWY.js +0 -6
- package/dist/bin/chunks/chunk-G7ZWT7BT.js +0 -9
- package/dist/bin/chunks/chunk-GTO74SFS.js +0 -7
- package/dist/bin/chunks/chunk-HMCRB24D.js +0 -15
- package/dist/bin/chunks/chunk-HWNCK5BB.js +0 -10
- package/dist/bin/chunks/chunk-HZR3FOJM.js +0 -288
- package/dist/bin/chunks/chunk-ISLENKSH.js +0 -7
- package/dist/bin/chunks/chunk-IX7LKVVH.js +0 -15
- package/dist/bin/chunks/chunk-JDFKEXLG.js +0 -12
- package/dist/bin/chunks/chunk-JJC4ENJL.js +0 -13
- package/dist/bin/chunks/chunk-JSZBZ2XU.js +0 -3
- package/dist/bin/chunks/chunk-JXLDT4KX.js +0 -4
- package/dist/bin/chunks/chunk-KMZUSEWI.js +0 -12
- package/dist/bin/chunks/chunk-KWCO3YXP.js +0 -17
- package/dist/bin/chunks/chunk-LNVSXNT7.js +0 -3
- package/dist/bin/chunks/chunk-LX2H4DPL.js +0 -6
- package/dist/bin/chunks/chunk-MLUOPG3W.js +0 -3
- package/dist/bin/chunks/chunk-MNWK4UIM.js +0 -22
- package/dist/bin/chunks/chunk-MP77TJMM.js +0 -6
- package/dist/bin/chunks/chunk-MTK7VLZG.js +0 -12
- package/dist/bin/chunks/chunk-N3FQJLPZ.js +0 -17
- package/dist/bin/chunks/chunk-N6YW4W3Z.js +0 -29
- package/dist/bin/chunks/chunk-NMMVECGD.js +0 -14
- package/dist/bin/chunks/chunk-NXYVRP6D.js +0 -11
- package/dist/bin/chunks/chunk-NYIPFY36.js +0 -3
- package/dist/bin/chunks/chunk-OVVMB2JI.js +0 -7
- package/dist/bin/chunks/chunk-OXZSG3ZZ.js +0 -7
- package/dist/bin/chunks/chunk-PKE7GKU5.js +0 -3
- package/dist/bin/chunks/chunk-PSJORJRS.js +0 -6
- package/dist/bin/chunks/chunk-R36DS2UF.js +0 -20
- package/dist/bin/chunks/chunk-RKBWTGBZ.js +0 -7
- package/dist/bin/chunks/chunk-RO3XCUVQ.js +0 -141
- package/dist/bin/chunks/chunk-RVGYO2OU.js +0 -3
- package/dist/bin/chunks/chunk-SF2OLINE.js +0 -12
- package/dist/bin/chunks/chunk-TIRU5FOD.js +0 -101
- package/dist/bin/chunks/chunk-TKYWUEON.js +0 -13
- package/dist/bin/chunks/chunk-UI7CV277.js +0 -20
- package/dist/bin/chunks/chunk-UNWZQG7U.js +0 -3
- package/dist/bin/chunks/chunk-UOMNSQEZ.js +0 -10
- package/dist/bin/chunks/chunk-W5OBQVJ2.js +0 -6
- package/dist/bin/chunks/chunk-WDWNEHHE.js +0 -9
- package/dist/bin/chunks/chunk-WHUKZ3K3.js +0 -85
- package/dist/bin/chunks/chunk-XHCCSVP6.js +0 -9
- package/dist/bin/chunks/chunk-XPTYN6UE.js +0 -8
- package/dist/bin/chunks/chunk-XRUDFQG5.js +0 -7
- package/dist/bin/chunks/chunk-Y2IUEWQD.js +0 -11
- package/dist/bin/chunks/chunk-Y5OWCEDV.js +0 -64
- package/dist/bin/chunks/chunk-ZFUVUYWG.js +0 -15
- package/dist/bin/chunks/chunk-ZZP3RSWL.js +0 -4
- package/dist/bin/chunks/clear-FGNEKYDU.js +0 -3
- package/dist/bin/chunks/column-QLGOK3XM.js +0 -3
- package/dist/bin/chunks/comm-PLYUTVP3.js +0 -3
- package/dist/bin/chunks/cp-HYXTMN3D.js +0 -3
- package/dist/bin/chunks/curl-DCSPNPEW.js +0 -27
- package/dist/bin/chunks/cut-JNQTCQY7.js +0 -3
- package/dist/bin/chunks/date-OFYBOAUE.js +0 -3
- package/dist/bin/chunks/diff-LZ4WRLIF.js +0 -3
- package/dist/bin/chunks/dirname-VCINTLPD.js +0 -3
- package/dist/bin/chunks/du-4LRQIGRG.js +0 -3
- package/dist/bin/chunks/echo-KCOHTNDF.js +0 -3
- package/dist/bin/chunks/env-FNVYNLGB.js +0 -3
- package/dist/bin/chunks/expand-CB7FG7LQ.js +0 -3
- package/dist/bin/chunks/expr-6A2XZORA.js +0 -3
- package/dist/bin/chunks/file-GRZLWDVH.js +0 -3
- package/dist/bin/chunks/find-5OZWMYCV.js +0 -3
- package/dist/bin/chunks/flag-coverage-CAST5CDE.js +0 -3
- package/dist/bin/chunks/fold-7YEITA5L.js +0 -3
- package/dist/bin/chunks/grep-KKBXRB73.js +0 -3
- package/dist/bin/chunks/gzip-ZJP5VIAQ.js +0 -3
- package/dist/bin/chunks/head-B6GFQHKF.js +0 -3
- package/dist/bin/chunks/help-CGUEOGXQ.js +0 -3
- package/dist/bin/chunks/history-AQQWW3QB.js +0 -3
- package/dist/bin/chunks/hostname-USNWOQCK.js +0 -3
- package/dist/bin/chunks/html-to-markdown-3HJ7L7NL.js +0 -3
- package/dist/bin/chunks/join-WRM6S6CO.js +0 -3
- package/dist/bin/chunks/jq-3V5HDGLJ.js +0 -3
- package/dist/bin/chunks/js-exec-F7JAZ4ZQ.js +0 -98
- package/dist/bin/chunks/ln-LP4HMCSM.js +0 -3
- package/dist/bin/chunks/ls-KBNHNZWQ.js +0 -3
- package/dist/bin/chunks/md5sum-ZNYCDRQL.js +0 -3
- package/dist/bin/chunks/mkdir-P4DKRCDX.js +0 -3
- package/dist/bin/chunks/mv-QQK4FQX6.js +0 -3
- package/dist/bin/chunks/nl-6TVYE4ZB.js +0 -3
- package/dist/bin/chunks/od-Y3E3QXOL.js +0 -3
- package/dist/bin/chunks/paste-LYNFXXCM.js +0 -3
- package/dist/bin/chunks/printf-MR3FXCDE.js +0 -3
- package/dist/bin/chunks/pwd-FCNDA467.js +0 -3
- package/dist/bin/chunks/python3-R5OFWJIH.js +0 -13
- package/dist/bin/chunks/readlink-25V57VOL.js +0 -3
- package/dist/bin/chunks/rev-AJECDD4L.js +0 -3
- package/dist/bin/chunks/rg-DZKA632H.js +0 -3
- package/dist/bin/chunks/rm-ECNUFR66.js +0 -3
- package/dist/bin/chunks/rmdir-DLOHIA7Q.js +0 -3
- package/dist/bin/chunks/sed-IGRH7EGG.js +0 -3
- package/dist/bin/chunks/seq-UXDJE6FB.js +0 -3
- package/dist/bin/chunks/sha1sum-5QZSNFY3.js +0 -3
- package/dist/bin/chunks/sha256sum-DI7JAVAU.js +0 -3
- package/dist/bin/chunks/sleep-RPGCUUGX.js +0 -3
- package/dist/bin/chunks/sort-HQPAFL76.js +0 -3
- package/dist/bin/chunks/split-F6FSB5KI.js +0 -3
- package/dist/bin/chunks/sqlite3-7TRACAE7.js +0 -3
- package/dist/bin/chunks/stat-BD6KT3BP.js +0 -3
- package/dist/bin/chunks/strings-6PE3YMPO.js +0 -3
- package/dist/bin/chunks/tac-NERJXVOM.js +0 -3
- package/dist/bin/chunks/tail-24F643A4.js +0 -3
- package/dist/bin/chunks/tar-5HK3VMV2.js +0 -3
- package/dist/bin/chunks/tee-5B7P2QRJ.js +0 -3
- package/dist/bin/chunks/time-FN6VJGRS.js +0 -3
- package/dist/bin/chunks/timeout-ZARIAF3K.js +0 -3
- package/dist/bin/chunks/touch-DFGSVIX7.js +0 -3
- package/dist/bin/chunks/tr-QQZYZ3CH.js +0 -3
- package/dist/bin/chunks/tree-6D7SMPUR.js +0 -3
- package/dist/bin/chunks/true-SKL4L7JP.js +0 -3
- package/dist/bin/chunks/unexpand-3JWOSSBQ.js +0 -3
- package/dist/bin/chunks/uniq-Q5UH5NL3.js +0 -3
- package/dist/bin/chunks/wc-4HXNTHY3.js +0 -3
- package/dist/bin/chunks/which-LCXKCLFC.js +0 -3
- package/dist/bin/chunks/whoami-TZDZDU7T.js +0 -3
- package/dist/bin/chunks/xan-TCTFON2Q.js +0 -3
- package/dist/bin/chunks/xan-view-XBMA362V.js +0 -3
- package/dist/bin/chunks/xargs-VTFN762K.js +0 -3
- package/dist/bin/chunks/yq-OB6PB5GY.js +0 -3
- package/dist/bin/shell/chunks/alias-YRVAW27Y.js +0 -3
- package/dist/bin/shell/chunks/awk2-UFCNQFCV.js +0 -3
- package/dist/bin/shell/chunks/base64-EGKVQIBC.js +0 -3
- package/dist/bin/shell/chunks/basename-F3AQ4KAQ.js +0 -3
- package/dist/bin/shell/chunks/bash-BEG4JB7K.js +0 -3
- package/dist/bin/shell/chunks/cat-NBL6MU5H.js +0 -3
- package/dist/bin/shell/chunks/chmod-S564JCJW.js +0 -3
- package/dist/bin/shell/chunks/chunk-2AIXTPH2.js +0 -9
- package/dist/bin/shell/chunks/chunk-2GG3NVC4.js +0 -10
- package/dist/bin/shell/chunks/chunk-2ZAK22BG.js +0 -9
- package/dist/bin/shell/chunks/chunk-3WIMLJM7.js +0 -8
- package/dist/bin/shell/chunks/chunk-47WZ2U6M.js +0 -9
- package/dist/bin/shell/chunks/chunk-4BNS566Q.js +0 -4
- package/dist/bin/shell/chunks/chunk-52FZYTIX.js +0 -34
- package/dist/bin/shell/chunks/chunk-5KX5YUWT.js +0 -37
- package/dist/bin/shell/chunks/chunk-5XSZHUEI.js +0 -15
- package/dist/bin/shell/chunks/chunk-63LSI3D6.js +0 -17
- package/dist/bin/shell/chunks/chunk-6FYCU7QB.js +0 -3
- package/dist/bin/shell/chunks/chunk-6JKLDBRW.js +0 -18
- package/dist/bin/shell/chunks/chunk-6WJQNLR2.js +0 -7
- package/dist/bin/shell/chunks/chunk-7HK63L6Y.js +0 -3
- package/dist/bin/shell/chunks/chunk-7NDRU2ZN.js +0 -5
- package/dist/bin/shell/chunks/chunk-7VCQWCSH.js +0 -15
- package/dist/bin/shell/chunks/chunk-AFAD5U2A.js +0 -8
- package/dist/bin/shell/chunks/chunk-AZH64XMJ.js +0 -3
- package/dist/bin/shell/chunks/chunk-BKQLXMS6.js +0 -36
- package/dist/bin/shell/chunks/chunk-BPZJYOUA.js +0 -33
- package/dist/bin/shell/chunks/chunk-BZP56QBM.js +0 -24
- package/dist/bin/shell/chunks/chunk-C6JOQKE2.js +0 -22
- package/dist/bin/shell/chunks/chunk-CX5CEEGI.js +0 -11
- package/dist/bin/shell/chunks/chunk-D7YFPDMV.js +0 -22
- package/dist/bin/shell/chunks/chunk-DHIKZU63.js +0 -3
- package/dist/bin/shell/chunks/chunk-DWECIBLJ.js +0 -3
- package/dist/bin/shell/chunks/chunk-FEENTUVZ.js +0 -18
- package/dist/bin/shell/chunks/chunk-FYCT4DWY.js +0 -6
- package/dist/bin/shell/chunks/chunk-G7ZWT7BT.js +0 -9
- package/dist/bin/shell/chunks/chunk-GTO74SFS.js +0 -7
- package/dist/bin/shell/chunks/chunk-HMCRB24D.js +0 -15
- package/dist/bin/shell/chunks/chunk-HWNCK5BB.js +0 -10
- package/dist/bin/shell/chunks/chunk-HZR3FOJM.js +0 -288
- package/dist/bin/shell/chunks/chunk-ISLENKSH.js +0 -7
- package/dist/bin/shell/chunks/chunk-IX7LKVVH.js +0 -15
- package/dist/bin/shell/chunks/chunk-JDFKEXLG.js +0 -12
- package/dist/bin/shell/chunks/chunk-JJC4ENJL.js +0 -13
- package/dist/bin/shell/chunks/chunk-JSZBZ2XU.js +0 -3
- package/dist/bin/shell/chunks/chunk-JXLDT4KX.js +0 -4
- package/dist/bin/shell/chunks/chunk-KMZUSEWI.js +0 -12
- package/dist/bin/shell/chunks/chunk-KWCO3YXP.js +0 -17
- package/dist/bin/shell/chunks/chunk-LNVSXNT7.js +0 -3
- package/dist/bin/shell/chunks/chunk-LX2H4DPL.js +0 -6
- package/dist/bin/shell/chunks/chunk-MLUOPG3W.js +0 -3
- package/dist/bin/shell/chunks/chunk-MNWK4UIM.js +0 -22
- package/dist/bin/shell/chunks/chunk-MP77TJMM.js +0 -6
- package/dist/bin/shell/chunks/chunk-MTK7VLZG.js +0 -12
- package/dist/bin/shell/chunks/chunk-N3FQJLPZ.js +0 -17
- package/dist/bin/shell/chunks/chunk-N6YW4W3Z.js +0 -29
- package/dist/bin/shell/chunks/chunk-NMMVECGD.js +0 -14
- package/dist/bin/shell/chunks/chunk-NXYVRP6D.js +0 -11
- package/dist/bin/shell/chunks/chunk-NYIPFY36.js +0 -3
- package/dist/bin/shell/chunks/chunk-OVVMB2JI.js +0 -7
- package/dist/bin/shell/chunks/chunk-OXZSG3ZZ.js +0 -7
- package/dist/bin/shell/chunks/chunk-PKE7GKU5.js +0 -3
- package/dist/bin/shell/chunks/chunk-PSJORJRS.js +0 -6
- package/dist/bin/shell/chunks/chunk-R36DS2UF.js +0 -20
- package/dist/bin/shell/chunks/chunk-RKBWTGBZ.js +0 -7
- package/dist/bin/shell/chunks/chunk-RO3XCUVQ.js +0 -141
- package/dist/bin/shell/chunks/chunk-RVGYO2OU.js +0 -3
- package/dist/bin/shell/chunks/chunk-SF2OLINE.js +0 -12
- package/dist/bin/shell/chunks/chunk-TIRU5FOD.js +0 -101
- package/dist/bin/shell/chunks/chunk-TKYWUEON.js +0 -13
- package/dist/bin/shell/chunks/chunk-UI7CV277.js +0 -20
- package/dist/bin/shell/chunks/chunk-UNWZQG7U.js +0 -3
- package/dist/bin/shell/chunks/chunk-UOMNSQEZ.js +0 -10
- package/dist/bin/shell/chunks/chunk-W5OBQVJ2.js +0 -6
- package/dist/bin/shell/chunks/chunk-WDWNEHHE.js +0 -9
- package/dist/bin/shell/chunks/chunk-WHUKZ3K3.js +0 -85
- package/dist/bin/shell/chunks/chunk-XHCCSVP6.js +0 -9
- package/dist/bin/shell/chunks/chunk-XPTYN6UE.js +0 -8
- package/dist/bin/shell/chunks/chunk-XRUDFQG5.js +0 -7
- package/dist/bin/shell/chunks/chunk-Y2IUEWQD.js +0 -11
- package/dist/bin/shell/chunks/chunk-Y5OWCEDV.js +0 -64
- package/dist/bin/shell/chunks/chunk-ZFUVUYWG.js +0 -15
- package/dist/bin/shell/chunks/chunk-ZZP3RSWL.js +0 -4
- package/dist/bin/shell/chunks/clear-FGNEKYDU.js +0 -3
- package/dist/bin/shell/chunks/column-QLGOK3XM.js +0 -3
- package/dist/bin/shell/chunks/comm-PLYUTVP3.js +0 -3
- package/dist/bin/shell/chunks/cp-HYXTMN3D.js +0 -3
- package/dist/bin/shell/chunks/curl-DCSPNPEW.js +0 -27
- package/dist/bin/shell/chunks/cut-JNQTCQY7.js +0 -3
- package/dist/bin/shell/chunks/date-OFYBOAUE.js +0 -3
- package/dist/bin/shell/chunks/diff-LZ4WRLIF.js +0 -3
- package/dist/bin/shell/chunks/dirname-VCINTLPD.js +0 -3
- package/dist/bin/shell/chunks/du-4LRQIGRG.js +0 -3
- package/dist/bin/shell/chunks/echo-KCOHTNDF.js +0 -3
- package/dist/bin/shell/chunks/env-FNVYNLGB.js +0 -3
- package/dist/bin/shell/chunks/expand-CB7FG7LQ.js +0 -3
- package/dist/bin/shell/chunks/expr-6A2XZORA.js +0 -3
- package/dist/bin/shell/chunks/file-GRZLWDVH.js +0 -3
- package/dist/bin/shell/chunks/find-5OZWMYCV.js +0 -3
- package/dist/bin/shell/chunks/flag-coverage-CAST5CDE.js +0 -3
- package/dist/bin/shell/chunks/fold-7YEITA5L.js +0 -3
- package/dist/bin/shell/chunks/grep-KKBXRB73.js +0 -3
- package/dist/bin/shell/chunks/gzip-ZJP5VIAQ.js +0 -3
- package/dist/bin/shell/chunks/head-B6GFQHKF.js +0 -3
- package/dist/bin/shell/chunks/help-CGUEOGXQ.js +0 -3
- package/dist/bin/shell/chunks/history-AQQWW3QB.js +0 -3
- package/dist/bin/shell/chunks/hostname-USNWOQCK.js +0 -3
- package/dist/bin/shell/chunks/html-to-markdown-3HJ7L7NL.js +0 -3
- package/dist/bin/shell/chunks/join-WRM6S6CO.js +0 -3
- package/dist/bin/shell/chunks/jq-3V5HDGLJ.js +0 -3
- package/dist/bin/shell/chunks/js-exec-F7JAZ4ZQ.js +0 -98
- package/dist/bin/shell/chunks/ln-LP4HMCSM.js +0 -3
- package/dist/bin/shell/chunks/ls-KBNHNZWQ.js +0 -3
- package/dist/bin/shell/chunks/md5sum-ZNYCDRQL.js +0 -3
- package/dist/bin/shell/chunks/mkdir-P4DKRCDX.js +0 -3
- package/dist/bin/shell/chunks/mv-QQK4FQX6.js +0 -3
- package/dist/bin/shell/chunks/nl-6TVYE4ZB.js +0 -3
- package/dist/bin/shell/chunks/od-Y3E3QXOL.js +0 -3
- package/dist/bin/shell/chunks/paste-LYNFXXCM.js +0 -3
- package/dist/bin/shell/chunks/printf-MR3FXCDE.js +0 -3
- package/dist/bin/shell/chunks/pwd-FCNDA467.js +0 -3
- package/dist/bin/shell/chunks/python3-R5OFWJIH.js +0 -13
- package/dist/bin/shell/chunks/readlink-25V57VOL.js +0 -3
- package/dist/bin/shell/chunks/rev-AJECDD4L.js +0 -3
- package/dist/bin/shell/chunks/rg-DZKA632H.js +0 -3
- package/dist/bin/shell/chunks/rm-ECNUFR66.js +0 -3
- package/dist/bin/shell/chunks/rmdir-DLOHIA7Q.js +0 -3
- package/dist/bin/shell/chunks/sed-IGRH7EGG.js +0 -3
- package/dist/bin/shell/chunks/seq-UXDJE6FB.js +0 -3
- package/dist/bin/shell/chunks/sha1sum-5QZSNFY3.js +0 -3
- package/dist/bin/shell/chunks/sha256sum-DI7JAVAU.js +0 -3
- package/dist/bin/shell/chunks/sleep-RPGCUUGX.js +0 -3
- package/dist/bin/shell/chunks/sort-HQPAFL76.js +0 -3
- package/dist/bin/shell/chunks/split-F6FSB5KI.js +0 -3
- package/dist/bin/shell/chunks/sqlite3-7TRACAE7.js +0 -3
- package/dist/bin/shell/chunks/stat-BD6KT3BP.js +0 -3
- package/dist/bin/shell/chunks/strings-6PE3YMPO.js +0 -3
- package/dist/bin/shell/chunks/tac-NERJXVOM.js +0 -3
- package/dist/bin/shell/chunks/tail-24F643A4.js +0 -3
- package/dist/bin/shell/chunks/tar-5HK3VMV2.js +0 -3
- package/dist/bin/shell/chunks/tee-5B7P2QRJ.js +0 -3
- package/dist/bin/shell/chunks/time-FN6VJGRS.js +0 -3
- package/dist/bin/shell/chunks/timeout-ZARIAF3K.js +0 -3
- package/dist/bin/shell/chunks/touch-DFGSVIX7.js +0 -3
- package/dist/bin/shell/chunks/tr-QQZYZ3CH.js +0 -3
- package/dist/bin/shell/chunks/tree-6D7SMPUR.js +0 -3
- package/dist/bin/shell/chunks/true-SKL4L7JP.js +0 -3
- package/dist/bin/shell/chunks/unexpand-3JWOSSBQ.js +0 -3
- package/dist/bin/shell/chunks/uniq-Q5UH5NL3.js +0 -3
- package/dist/bin/shell/chunks/wc-4HXNTHY3.js +0 -3
- package/dist/bin/shell/chunks/which-LCXKCLFC.js +0 -3
- package/dist/bin/shell/chunks/whoami-TZDZDU7T.js +0 -3
- package/dist/bin/shell/chunks/xan-TCTFON2Q.js +0 -3
- package/dist/bin/shell/chunks/xan-view-XBMA362V.js +0 -3
- package/dist/bin/shell/chunks/xargs-VTFN762K.js +0 -3
- package/dist/bin/shell/chunks/yq-OB6PB5GY.js +0 -3
- package/dist/bundle/chunks/alias-RTYYYW3D.js +0 -2
- package/dist/bundle/chunks/awk2-SREAOJRG.js +0 -2
- package/dist/bundle/chunks/base64-WIGL46P3.js +0 -2
- package/dist/bundle/chunks/basename-UB3CIYNI.js +0 -2
- package/dist/bundle/chunks/bash-F4KHPMTX.js +0 -2
- package/dist/bundle/chunks/cat-LPZ6XNHG.js +0 -2
- package/dist/bundle/chunks/chmod-TFEPA42X.js +0 -2
- package/dist/bundle/chunks/chunk-27JIFWUR.js +0 -3
- package/dist/bundle/chunks/chunk-2VDTE5BV.js +0 -14
- package/dist/bundle/chunks/chunk-2VJJEDV2.js +0 -8
- package/dist/bundle/chunks/chunk-4I3HOE5Z.js +0 -21
- package/dist/bundle/chunks/chunk-4JLVZKHC.js +0 -8
- package/dist/bundle/chunks/chunk-4WKZNNJK.js +0 -2
- package/dist/bundle/chunks/chunk-55LZFN6S.js +0 -36
- package/dist/bundle/chunks/chunk-5MV7Q5QB.js +0 -5
- package/dist/bundle/chunks/chunk-6L65G6A7.js +0 -17
- package/dist/bundle/chunks/chunk-6NYPZ4NX.js +0 -8
- package/dist/bundle/chunks/chunk-6Y4TGEZL.js +0 -140
- package/dist/bundle/chunks/chunk-7CSMHFIJ.js +0 -33
- package/dist/bundle/chunks/chunk-AAGO7IQ5.js +0 -11
- package/dist/bundle/chunks/chunk-AX2X3SZS.js +0 -11
- package/dist/bundle/chunks/chunk-AXMYAPFA.js +0 -9
- package/dist/bundle/chunks/chunk-BU36VZYL.js +0 -4
- package/dist/bundle/chunks/chunk-BZUGFHVS.js +0 -2
- package/dist/bundle/chunks/chunk-CJFAMHFC.js +0 -7
- package/dist/bundle/chunks/chunk-CN5XGDNN.js +0 -6
- package/dist/bundle/chunks/chunk-CQV3EITV.js +0 -2
- package/dist/bundle/chunks/chunk-DVJY2RAX.js +0 -2
- package/dist/bundle/chunks/chunk-FLMHFDSN.js +0 -5
- package/dist/bundle/chunks/chunk-GE6OQDB2.js +0 -10
- package/dist/bundle/chunks/chunk-GHB6M7KA.js +0 -2
- package/dist/bundle/chunks/chunk-GRQJA2J7.js +0 -21
- package/dist/bundle/chunks/chunk-H2TS57O5.js +0 -5
- package/dist/bundle/chunks/chunk-H7WISVP3.js +0 -6
- package/dist/bundle/chunks/chunk-HAIOEUEV.js +0 -63
- package/dist/bundle/chunks/chunk-HBVMHTO5.js +0 -2
- package/dist/bundle/chunks/chunk-IZ6KBTV7.js +0 -100
- package/dist/bundle/chunks/chunk-J3LJZWL2.js +0 -6
- package/dist/bundle/chunks/chunk-JA7M2FXG.js +0 -16
- package/dist/bundle/chunks/chunk-JNYYVLEL.js +0 -35
- package/dist/bundle/chunks/chunk-JTMQLUCH.js +0 -16
- package/dist/bundle/chunks/chunk-K5JMLDHX.js +0 -13
- package/dist/bundle/chunks/chunk-KAPG5ONA.js +0 -2
- package/dist/bundle/chunks/chunk-KSBHIW2H.js +0 -19
- package/dist/bundle/chunks/chunk-KTL5PAHY.js +0 -5
- package/dist/bundle/chunks/chunk-KTPCYKBB.js +0 -3
- package/dist/bundle/chunks/chunk-KWGBQNTV.js +0 -32
- package/dist/bundle/chunks/chunk-MFDPAVC6.js +0 -14
- package/dist/bundle/chunks/chunk-MFRETFZB.js +0 -6
- package/dist/bundle/chunks/chunk-MIZIUC5M.js +0 -8
- package/dist/bundle/chunks/chunk-MJLETYZI.js +0 -14
- package/dist/bundle/chunks/chunk-MTHXXA6H.js +0 -6
- package/dist/bundle/chunks/chunk-NGPDJCUE.js +0 -5
- package/dist/bundle/chunks/chunk-OVH44QKR.js +0 -11
- package/dist/bundle/chunks/chunk-PDUL32DM.js +0 -16
- package/dist/bundle/chunks/chunk-PYDWFCTN.js +0 -11
- package/dist/bundle/chunks/chunk-QAJKDPNS.js +0 -2
- package/dist/bundle/chunks/chunk-QM4DZQWX.js +0 -287
- package/dist/bundle/chunks/chunk-R4IFXNY5.js +0 -28
- package/dist/bundle/chunks/chunk-R4QNMLOB.js +0 -12
- package/dist/bundle/chunks/chunk-RBQG6ZUG.js +0 -3
- package/dist/bundle/chunks/chunk-RCXNPPJY.js +0 -17
- package/dist/bundle/chunks/chunk-S2BIZAWY.js +0 -7
- package/dist/bundle/chunks/chunk-SAI2SPQQ.js +0 -8
- package/dist/bundle/chunks/chunk-SETW5JBN.js +0 -9
- package/dist/bundle/chunks/chunk-SJYEXC2Z.js +0 -14
- package/dist/bundle/chunks/chunk-SY4HAUHP.js +0 -2
- package/dist/bundle/chunks/chunk-TA74ENH7.js +0 -14
- package/dist/bundle/chunks/chunk-TC2WHAIS.js +0 -2
- package/dist/bundle/chunks/chunk-VACKIICN.js +0 -5
- package/dist/bundle/chunks/chunk-VBLMIJON.js +0 -6
- package/dist/bundle/chunks/chunk-WKPK7M56.js +0 -10
- package/dist/bundle/chunks/chunk-WM5IJFMP.js +0 -8
- package/dist/bundle/chunks/chunk-WPGQVBSY.js +0 -6
- package/dist/bundle/chunks/chunk-WVRWIZF5.js +0 -23
- package/dist/bundle/chunks/chunk-XEKXHOPO.js +0 -2
- package/dist/bundle/chunks/chunk-XPK7ZFVA.js +0 -12
- package/dist/bundle/chunks/chunk-XZUZRAAC.js +0 -10
- package/dist/bundle/chunks/chunk-Y4LIDHSD.js +0 -7
- package/dist/bundle/chunks/chunk-YRNR2VHY.js +0 -21
- package/dist/bundle/chunks/chunk-YS4NUBYX.js +0 -9
- package/dist/bundle/chunks/chunk-YWOZZRSK.js +0 -2
- package/dist/bundle/chunks/chunk-ZDIT6ST5.js +0 -7
- package/dist/bundle/chunks/clear-HKGFEOF6.js +0 -2
- package/dist/bundle/chunks/column-PVOEF65J.js +0 -2
- package/dist/bundle/chunks/comm-5QMYEAJL.js +0 -2
- package/dist/bundle/chunks/cp-BISAAS7A.js +0 -2
- package/dist/bundle/chunks/curl-PAWGO3EH.js +0 -26
- package/dist/bundle/chunks/cut-NDMV7SPO.js +0 -2
- package/dist/bundle/chunks/date-XKUEQ4WF.js +0 -2
- package/dist/bundle/chunks/diff-TT4M7WM3.js +0 -2
- package/dist/bundle/chunks/dirname-MPHRFUTI.js +0 -2
- package/dist/bundle/chunks/du-572XNP42.js +0 -2
- package/dist/bundle/chunks/echo-NDWZZHPO.js +0 -2
- package/dist/bundle/chunks/env-DLFRY633.js +0 -2
- package/dist/bundle/chunks/expand-T2TH4TBQ.js +0 -2
- package/dist/bundle/chunks/expr-YLACLCSM.js +0 -2
- package/dist/bundle/chunks/file-IPZJC3FQ.js +0 -2
- package/dist/bundle/chunks/find-T5TGGXUU.js +0 -2
- package/dist/bundle/chunks/flag-coverage-OHLSWDU5.js +0 -2
- package/dist/bundle/chunks/fold-XR2JMFCW.js +0 -2
- package/dist/bundle/chunks/grep-VUESTEZ7.js +0 -2
- package/dist/bundle/chunks/gzip-HF3D26QX.js +0 -2
- package/dist/bundle/chunks/head-AEMOMQSZ.js +0 -2
- package/dist/bundle/chunks/help-HZ6M2CKN.js +0 -2
- package/dist/bundle/chunks/history-WYYKSLSZ.js +0 -2
- package/dist/bundle/chunks/hostname-C4HQXXUP.js +0 -2
- package/dist/bundle/chunks/html-to-markdown-LXXMVQ3V.js +0 -2
- package/dist/bundle/chunks/join-YIABB6WR.js +0 -2
- package/dist/bundle/chunks/jq-OPEF5OPR.js +0 -2
- package/dist/bundle/chunks/js-exec-SR6IMNWM.js +0 -97
- package/dist/bundle/chunks/ln-4LGSXXGD.js +0 -2
- package/dist/bundle/chunks/ls-ZJGQER7M.js +0 -2
- package/dist/bundle/chunks/md5sum-LU7RVIB7.js +0 -2
- package/dist/bundle/chunks/mkdir-MEPGZOB6.js +0 -2
- package/dist/bundle/chunks/mv-W5BIQ646.js +0 -2
- package/dist/bundle/chunks/nl-Q2L5XQWZ.js +0 -2
- package/dist/bundle/chunks/od-RDSM4TQJ.js +0 -2
- package/dist/bundle/chunks/paste-ABCY7E6C.js +0 -2
- package/dist/bundle/chunks/printf-JPOOWRJC.js +0 -2
- package/dist/bundle/chunks/pwd-WE6EN5AV.js +0 -2
- package/dist/bundle/chunks/python3-JPCH6LLN.js +0 -12
- package/dist/bundle/chunks/readlink-OPJF4DL5.js +0 -2
- package/dist/bundle/chunks/rev-GCV6X22K.js +0 -2
- package/dist/bundle/chunks/rg-EBMD72T4.js +0 -2
- package/dist/bundle/chunks/rm-SSGETQVQ.js +0 -2
- package/dist/bundle/chunks/rmdir-OC4ZLPYA.js +0 -2
- package/dist/bundle/chunks/sed-DX2SGXMF.js +0 -2
- package/dist/bundle/chunks/seq-M5EC7Q57.js +0 -2
- package/dist/bundle/chunks/sha1sum-O6DM3TPQ.js +0 -2
- package/dist/bundle/chunks/sha256sum-WPVZLZPS.js +0 -2
- package/dist/bundle/chunks/sleep-HZ4QEFOK.js +0 -2
- package/dist/bundle/chunks/sort-VW2NIZHW.js +0 -2
- package/dist/bundle/chunks/split-NBMH43M2.js +0 -2
- package/dist/bundle/chunks/sqlite3-UE3PJTDQ.js +0 -2
- package/dist/bundle/chunks/stat-CD34IZ4P.js +0 -2
- package/dist/bundle/chunks/strings-MCXFXPDL.js +0 -2
- package/dist/bundle/chunks/tac-BQ7EDZW2.js +0 -2
- package/dist/bundle/chunks/tail-GJMTLMNE.js +0 -2
- package/dist/bundle/chunks/tar-WIZ3PDF4.js +0 -2
- package/dist/bundle/chunks/tee-SGANDVNY.js +0 -2
- package/dist/bundle/chunks/time-FCZCDIAM.js +0 -2
- package/dist/bundle/chunks/timeout-VDIEAB4R.js +0 -2
- package/dist/bundle/chunks/touch-UA33VN3N.js +0 -2
- package/dist/bundle/chunks/tr-JNNR5JMS.js +0 -2
- package/dist/bundle/chunks/tree-YLD52CNT.js +0 -2
- package/dist/bundle/chunks/true-FHQXJXBE.js +0 -2
- package/dist/bundle/chunks/unexpand-2TKXAENW.js +0 -2
- package/dist/bundle/chunks/uniq-DMFKT3AB.js +0 -2
- package/dist/bundle/chunks/wc-TZFYWFLA.js +0 -2
- package/dist/bundle/chunks/which-XEM24D5D.js +0 -2
- package/dist/bundle/chunks/whoami-XMTX52VE.js +0 -2
- package/dist/bundle/chunks/xan-LKYWG2QQ.js +0 -2
- package/dist/bundle/chunks/xan-view-YATJ4KAA.js +0 -2
- package/dist/bundle/chunks/xargs-VDP7DLOU.js +0 -2
- package/dist/bundle/chunks/yq-TVZ7R3O7.js +0 -2
- package/dist/interpreter/helpers/statements.d.ts +0 -20
- package/dist/interpreter/helpers/tilde.d.ts +0 -13
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as U,b as z}from"./chunk-KAPG5ONA.js";import{a as I}from"./chunk-VACKIICN.js";import{a as A}from"./chunk-7CSMHFIJ.js";import{c as P}from"./chunk-XEKXHOPO.js";import{k}from"./chunk-SAI2SPQQ.js";import{a as L}from"./chunk-FOCWZZDE.js";import{a as te,b as ne,c as W}from"./chunk-QAYAQNCG.js";var H=new Map([["alnum","a-zA-Z0-9"],["alpha","a-zA-Z"],["ascii","\\x00-\\x7F"],["blank"," \\t"],["cntrl","\\x00-\\x1F\\x7F"],["digit","0-9"],["graph","!-~"],["lower","a-z"],["print"," -~"],["punct","!-/:-@\\[-`{-~"],["space"," \\t\\n\\r\\f\\v"],["upper","A-Z"],["word","a-zA-Z0-9_"],["xdigit","0-9A-Fa-f"]]);function V(i){let e="",t=0,n=!1;for(;t<i.length;){if(i[t]==="["&&!n){if(i[t+1]==="["&&i[t+2]===":"){let s=i.indexOf(":]]",t+3);if(s!==-1){let a=i.slice(t+3,s),r=H.get(a);if(r){e+=`[${r}]`,t=s+3;continue}}}if(i[t+1]==="^"&&i[t+2]==="["&&i[t+3]===":"){let s=i.indexOf(":]]",t+4);if(s!==-1){let a=i.slice(t+4,s),r=H.get(a);if(r){e+=`[^${r}]`,t=s+3;continue}}}e+="[",t++,n=!0,t<i.length&&i[t]==="^"&&(e+="^",t++),t<i.length&&i[t]==="]"&&(e+="\\]",t++);continue}if(n){if(i[t]==="]"){e+="]",t++,n=!1;continue}if(i[t]==="["&&i[t+1]===":"){let s=i.indexOf(":]",t+2);if(s!==-1){let a=i.slice(t+2,s),r=H.get(a);if(r){e+=r,t=s+2;continue}}}if(i[t]==="\\"&&t+1<i.length){e+=i[t]+i[t+1],t+=2;continue}e+=i[t],t++;continue}if(i[t]==="\\"&&t+1<i.length){let s=i[t+1];if(s==="+"||s==="?"||s==="|"){e+=s,t+=2;continue}if(s==="("||s===")"){e+=s,t+=2;continue}if(s==="{"||s==="}"){e+=s,t+=2;continue}if(s==="t"){e+=" ",t+=2;continue}if(s==="n"){e+=`
|
|
3
|
-
`,t+=2;continue}if(s==="r"){e+="\r",t+=2;continue}e+=i[t]+s,t+=2;continue}if(i[t]==="+"||i[t]==="?"||i[t]==="|"||i[t]==="("||i[t]===")"){e+=`\\${i[t]}`,t++;continue}if(i[t]==="^"&&!(e===""||e.endsWith("("))){e+="\\^",t++;continue}if(i[t]==="$"){let s=t===i.length-1,a=t+2<i.length&&i[t+1]==="\\"&&i[t+2]===")";if(!s&&!a){e+="\\$",t++;continue}}e+=i[t],t++}return e}function X(i){let e="",t=!1;for(let n=0;n<i.length;n++)i[n]==="["&&!t?(t=!0,e+="[",n++,n<i.length&&i[n]==="^"&&(e+="^",n++),n<i.length&&i[n]==="]"&&(e+="]",n++),n--):i[n]==="]"&&t?(t=!1,e+="]"):!t&&i[n]==="{"&&i[n+1]===","?(e+="{0,",n++):e+=i[n];return e}function ie(i){let e="";for(let t=0;t<i.length;t++){let n=i[t],s=n.charCodeAt(0);n==="\\"?e+="\\\\":n===" "?e+="\\t":n===`
|
|
4
|
-
`?e+=`$
|
|
5
|
-
`:n==="\r"?e+="\\r":n==="\x07"?e+="\\a":n==="\b"?e+="\\b":n==="\f"?e+="\\f":n==="\v"?e+="\\v":s<32||s>=127?e+=`\\${s.toString(8).padStart(3,"0")}`:e+=n}return`${e}$`}var pe=1e4;function re(i,e,t){return{patternSpace:"",holdSpace:"",lineNumber:0,totalLines:i,deleted:!1,printed:!1,quit:!1,quitSilent:!1,exitCode:void 0,errorMessage:void 0,appendBuffer:[],substitutionMade:!1,lineNumberOutput:[],nCommandOutput:[],restartCycle:!1,inDRestartedCycle:!1,currentFilename:e,pendingFileReads:[],pendingFileWrites:[],rangeStates:t||new Map,linesConsumedInCycle:0}}function me(i){return typeof i=="object"&&"first"in i&&"step"in i}function ge(i){return typeof i=="object"&&"offset"in i}function N(i,e,t,n,s){if(i==="$")return e===t;if(typeof i=="number")return e===i;if(me(i)){let{first:a,step:r}=i;return r===0?e===a:(e-a)%r===0&&e>=a}if(typeof i=="object"&&"pattern"in i)try{let a=i.pattern;a===""&&s?.lastPattern?a=s.lastPattern:a!==""&&s&&(s.lastPattern=a);let r=X(V(a));return A(r).test(n)}catch{return!1}return!1}function G(i){let e=t=>t===void 0?"undefined":t==="$"?"$":typeof t=="number"?String(t):"pattern"in t?`/${t.pattern}/`:"first"in t?`${t.first}~${t.step}`:"unknown";return`${e(i.start)},${e(i.end)}`}function be(i,e,t,n,s,a){if(!i||!i.start&&!i.end)return!0;let r=i.start,l=i.end;if(r!==void 0&&l===void 0)return N(r,e,t,n,a);if(r!==void 0&&l!==void 0){let c=typeof r=="object"&&"pattern"in r,f=typeof l=="object"&&"pattern"in l,p=ge(l);if(p&&s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active){let E=d.startLine||e;return e>=E+l.offset&&(d.active=!1,s.set(g,d)),!0}else return N(r,e,t,n,a)?(d.active=!0,d.startLine=e,s.set(g,d),l.offset===0&&(d.active=!1,s.set(g,d)),!0):!1}if(!c&&!f&&!p){let g=typeof r=="number"?r:r==="$"?t:1,d=typeof l=="number"?l:t;if(g<=d)return e>=g&&e<=d;if(s){let E=G(i),u=s.get(E);return u||(u={active:!1},s.set(E,u)),!u.completed&&e>=g?(u.completed=!0,s.set(E,u),!0):!1}return!1}if(s){let g=G(i),d=s.get(g);if(d||(d={active:!1},s.set(g,d)),d.active)return N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0;{if(d.completed)return!1;let E=!1;return typeof r=="number"?E=e>=r:E=N(r,e,t,n,a),E?(d.active=!0,d.startLine=e,s.set(g,d),N(l,e,t,n,a)&&(d.active=!1,typeof r=="number"&&(d.completed=!0),s.set(g,d)),!0):!1}}return N(r,e,t,n,a)}return!0}function w(i,e,t,n,s,a){let r=be(i,e,t,n,s,a);return i?.negated?!r:r}function Ee(i,e,t,n){let s="",a=0,r=!1;for(;a<=i.length;){e.lastIndex=a;let l=e.exec(i);if(!l){s+=i.slice(a);break}if(l.index!==a){s+=i.slice(a,l.index),a=l.index,r=!1;continue}let c=l[0],f=l.slice(1);if(r&&c.length===0){if(a<i.length)s+=i[a],a++;else break;r=!1;continue}if(s+=n(c,f),r=!1,c.length===0)if(a<i.length)s+=i[a],a++;else break;else a+=c.length,r=!0}return s}function j(i,e,t){let n="",s=0;for(;s<i.length;){if(i[s]==="\\"&&s+1<i.length){let a=i[s+1];if(a==="&"){n+="&",s+=2;continue}if(a==="n"){n+=`
|
|
6
|
-
`,s+=2;continue}if(a==="t"){n+=" ",s+=2;continue}if(a==="r"){n+="\r",s+=2;continue}let r=parseInt(a,10);if(r===0){n+=e,s+=2;continue}if(r>=1&&r<=9){n+=t[r-1]||"",s+=2;continue}n+=a,s+=2;continue}if(i[s]==="&"){n+=e,s++;continue}n+=i[s],s++}return n}function se(i,e,t){if(e>0&&i.length>e)throw new k(`sed: ${t} size limit exceeded (${e} bytes)`,"string_length")}function ve(i,e,t){let{lineNumber:n,totalLines:s,patternSpace:a}=e;if(i.type==="label"){e.coverage?.hit(`sed:cmd:${i.type}`);return}if(w(i.address,n,s,a,e.rangeStates,e))switch(e.coverage?.hit(`sed:cmd:${i.type}`),i.type){case"substitute":{let r=i,l="";r.global&&(l+="g"),r.ignoreCase&&(l+="i");let c=r.pattern;c===""&&e.lastPattern?c=e.lastPattern:c!==""&&(e.lastPattern=c);let f=X(r.extendedRegex?c:V(c));try{let p=A(f,l),x=p.test(e.patternSpace);if(p.lastIndex=0,x){if(e.substitutionMade=!0,r.nthOccurrence&&r.nthOccurrence>0&&!r.global){let g=0,d=r.nthOccurrence,E=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=E.replace(e.patternSpace,(u,...h)=>{if(g++,g===d){let b=h.slice(0,-2);return j(r.replacement,u,b)}return u})}else if(r.global){let g=A(f,`g${r.ignoreCase?"i":""}`);e.patternSpace=Ee(e.patternSpace,g,r.replacement,(d,E)=>j(r.replacement,d,E))}else e.patternSpace=p.replace(e.patternSpace,(g,...d)=>{let E=d.slice(0,-2);return j(r.replacement,g,E)});r.printOnMatch&&e.lineNumberOutput.push(e.patternSpace)}}catch{}break}case"print":e.lineNumberOutput.push(e.patternSpace);break;case"printFirstLine":{let r=e.patternSpace.indexOf(`
|
|
7
|
-
`);r!==-1?e.lineNumberOutput.push(e.patternSpace.slice(0,r)):e.lineNumberOutput.push(e.patternSpace);break}case"delete":e.deleted=!0;break;case"deleteFirstLine":{let r=e.patternSpace.indexOf(`
|
|
8
|
-
`);r!==-1?(e.patternSpace=e.patternSpace.slice(r+1),e.restartCycle=!0,e.inDRestartedCycle=!0):e.deleted=!0;break}case"zap":e.patternSpace="";break;case"append":e.appendBuffer.push(i.text);break;case"insert":e.appendBuffer.unshift(`__INSERT__${i.text}`);break;case"change":e.deleted=!0,e.changedText=i.text;break;case"hold":e.holdSpace=e.patternSpace;break;case"holdAppend":e.holdSpace?e.holdSpace+=`
|
|
9
|
-
${e.patternSpace}`:e.holdSpace=e.patternSpace,se(e.holdSpace,t?.maxStringLength??0,"hold space");break;case"get":e.patternSpace=e.holdSpace;break;case"getAppend":e.patternSpace+=`
|
|
10
|
-
${e.holdSpace}`,se(e.patternSpace,t?.maxStringLength??0,"pattern space");break;case"exchange":{let r=e.patternSpace;e.patternSpace=e.holdSpace,e.holdSpace=r;break}case"next":e.printed=!0;break;case"quit":e.quit=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"quitSilent":e.quit=!0,e.quitSilent=!0,i.exitCode!==void 0&&(e.exitCode=i.exitCode);break;case"list":{let r=ie(e.patternSpace);e.lineNumberOutput.push(r);break}case"printFilename":e.currentFilename&&e.lineNumberOutput.push(e.currentFilename);break;case"version":{let r=[4,8,0];if(i.minVersion){let l=i.minVersion.split("."),c=[],f=!1;for(let p of l){let x=parseInt(p,10);if(Number.isNaN(x)||x<0){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: invalid version string: ${i.minVersion}`,f=!0;break}c.push(x)}if(!f){for(;c.length<3;)c.push(0);for(let p=0;p<3;p++){if(c[p]>r[p]){e.quit=!0,e.exitCode=1,e.errorMessage=`sed: this is not GNU sed version ${i.minVersion}`;break}if(c[p]<r[p])break}}}break}case"readFile":e.pendingFileReads.push({filename:i.filename,wholeFile:!0});break;case"readFileLine":e.pendingFileReads.push({filename:i.filename,wholeFile:!1});break;case"writeFile":e.pendingFileWrites.push({filename:i.filename,content:`${e.patternSpace}
|
|
11
|
-
`});break;case"writeFirstLine":{let r=e.patternSpace.indexOf(`
|
|
12
|
-
`),l=r!==-1?e.patternSpace.slice(0,r):e.patternSpace;e.pendingFileWrites.push({filename:i.filename,content:`${l}
|
|
13
|
-
`});break}case"execute":e.errorMessage="sed: e command (shell execution) is not supported in sandboxed environment",e.quit=!0;break;case"transliterate":e.patternSpace=Ce(e.patternSpace,i);break;case"lineNumber":e.lineNumberOutput.push(String(e.lineNumber));break;case"branch":break;case"branchOnSubst":break;case"branchOnNoSubst":break;case"group":break}}function Ce(i,e){let t="";for(let n of i){let s=e.source.indexOf(n);s!==-1?t+=e.dest[s]:t+=n}return t}function Z(i,e,t,n){let s=new Map;for(let c=0;c<i.length;c++){let f=i[c];f.type==="label"&&s.set(f.name,c)}let a=n?.maxIterations??pe,r=0,l=0;for(;l<i.length;){if(r++,r>a)throw new k(`sed: command execution exceeded maximum iterations (${a})`,"iterations");if(e.deleted||e.quit||e.quitSilent||e.restartCycle)break;let c=i[l];if(c.type==="next"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:next"),e.nCommandOutput.push(e.patternSpace),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let f=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace=f,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1,e.substitutionMade=!1}else{e.quit=!0,e.deleted=!0;break}l++;continue}if(c.type==="nextAppend"){if(w(c.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e))if(e.coverage?.hit("sed:cmd:nextAppend"),t&&t.currentLineIndex+e.linesConsumedInCycle+1<t.lines.length){e.linesConsumedInCycle++;let f=t.lines[t.currentLineIndex+e.linesConsumedInCycle];e.patternSpace+=`
|
|
14
|
-
${f}`,e.lineNumber=t.currentLineIndex+e.linesConsumedInCycle+1}else{e.quit=!0;break}l++;continue}if(c.type==="branch"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)){if(e.coverage?.hit("sed:cmd:branch"),f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="branchOnSubst"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnSubst"),e.substitutionMade)){if(e.substitutionMade=!1,f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="branchOnNoSubst"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:branchOnNoSubst"),!e.substitutionMade)){if(f.label){let p=s.get(f.label);if(p!==void 0){l=p;continue}e.branchRequest=f.label;break}break}l++;continue}if(c.type==="group"){let f=c;if(w(f.address,e.lineNumber,e.totalLines,e.patternSpace,e.rangeStates,e)&&(e.coverage?.hit("sed:cmd:group"),Z(f.commands,e,t,n),e.branchRequest)){let p=s.get(e.branchRequest);if(p!==void 0){e.branchRequest=void 0,l=p;continue}break}l++;continue}ve(c,e,n),l++}return e.linesConsumedInCycle}var o;(function(i){i.NUMBER="NUMBER",i.DOLLAR="DOLLAR",i.PATTERN="PATTERN",i.STEP="STEP",i.RELATIVE_OFFSET="RELATIVE_OFFSET",i.LBRACE="LBRACE",i.RBRACE="RBRACE",i.SEMICOLON="SEMICOLON",i.NEWLINE="NEWLINE",i.COMMA="COMMA",i.NEGATION="NEGATION",i.COMMAND="COMMAND",i.SUBSTITUTE="SUBSTITUTE",i.TRANSLITERATE="TRANSLITERATE",i.LABEL_DEF="LABEL_DEF",i.BRANCH="BRANCH",i.BRANCH_ON_SUBST="BRANCH_ON_SUBST",i.BRANCH_ON_NO_SUBST="BRANCH_ON_NO_SUBST",i.TEXT_CMD="TEXT_CMD",i.FILE_READ="FILE_READ",i.FILE_READ_LINE="FILE_READ_LINE",i.FILE_WRITE="FILE_WRITE",i.FILE_WRITE_LINE="FILE_WRITE_LINE",i.EXECUTE="EXECUTE",i.VERSION="VERSION",i.EOF="EOF",i.ERROR="ERROR"})(o||(o={}));var _=class{input;pos=0;line=1;column=1;constructor(e){this.input=e}tokenize(){let e=[];for(;this.pos<this.input.length;){let t=this.nextToken();t&&e.push(t)}return e.push(this.makeToken(o.EOF,"")),e}makeToken(e,t,n){return{type:e,value:t,line:this.line,column:this.column,...n}}peek(e=0){return this.input[this.pos+e]||""}advance(){let e=this.input[this.pos++]||"";return e===`
|
|
15
|
-
`?(this.line++,this.column=1):this.column++,e}readEscapedString(e){let t="";for(;this.pos<this.input.length&&this.peek()!==e;)if(this.peek()==="\\"){this.advance();let n=this.advance();n==="n"?t+=`
|
|
16
|
-
`:n==="t"?t+=" ":t+=n}else{if(this.peek()===`
|
|
17
|
-
`)return null;t+=this.advance()}return t}skipWhitespace(){for(;this.pos<this.input.length;){let e=this.peek();if(e===" "||e===" "||e==="\r")this.advance();else if(e==="#")for(;this.pos<this.input.length&&this.peek()!==`
|
|
18
|
-
`;)this.advance();else break}}nextToken(){if(this.skipWhitespace(),this.pos>=this.input.length)return null;let e=this.line,t=this.column,n=this.peek();return n===`
|
|
19
|
-
`?(this.advance(),{type:o.NEWLINE,value:`
|
|
20
|
-
`,line:e,column:t}):n===";"?(this.advance(),{type:o.SEMICOLON,value:";",line:e,column:t}):n==="{"?(this.advance(),{type:o.LBRACE,value:"{",line:e,column:t}):n==="}"?(this.advance(),{type:o.RBRACE,value:"}",line:e,column:t}):n===","?(this.advance(),{type:o.COMMA,value:",",line:e,column:t}):n==="!"?(this.advance(),{type:o.NEGATION,value:"!",line:e,column:t}):n==="$"?(this.advance(),{type:o.DOLLAR,value:"$",line:e,column:t}):this.isDigit(n)?this.readNumber():n==="+"&&this.isDigit(this.input[this.pos+1]||"")?this.readRelativeOffset():n==="/"?this.readPattern():n===":"?this.readLabelDef():this.readCommand()}readNumber(){let e=this.line,t=this.column,n="";for(;this.isDigit(this.peek());)n+=this.advance();if(this.peek()==="~"){this.advance();let s="";for(;this.isDigit(this.peek());)s+=this.advance();let a=parseInt(n,10),r=parseInt(s,10)||0;return{type:o.STEP,value:`${a}~${r}`,first:a,step:r,line:e,column:t}}return{type:o.NUMBER,value:parseInt(n,10),line:e,column:t}}readRelativeOffset(){let e=this.line,t=this.column;this.advance();let n="";for(;this.isDigit(this.peek());)n+=this.advance();let s=parseInt(n,10)||0;return{type:o.RELATIVE_OFFSET,value:`+${s}`,offset:s,line:e,column:t}}readPattern(){let e=this.line,t=this.column;this.advance();let n="",s=!1;for(;this.pos<this.input.length;){let a=this.peek();if(a==="/"&&!s)break;if(a==="\\")n+=this.advance(),this.pos<this.input.length&&this.peek()!==`
|
|
21
|
-
`&&(n+=this.advance());else{if(a===`
|
|
22
|
-
`)break;a==="["&&!s?(s=!0,n+=this.advance(),this.peek()==="^"&&(n+=this.advance()),this.peek()==="]"&&(n+=this.advance())):a==="]"&&s?(s=!1,n+=this.advance()):n+=this.advance()}}return this.peek()==="/"&&this.advance(),{type:o.PATTERN,value:n,pattern:n,line:e,column:t}}readLabelDef(){let e=this.line,t=this.column;for(this.advance();this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
|
|
23
|
-
`||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:o.LABEL_DEF,value:n,label:n,line:e,column:t}}readCommand(){let e=this.line,t=this.column,n=this.advance();switch(n){case"s":return this.readSubstitute(e,t);case"y":return this.readTransliterate(e,t);case"a":case"i":case"c":return this.readTextCommand(n,e,t);case"b":return this.readBranch(o.BRANCH,"b",e,t);case"t":return this.readBranch(o.BRANCH_ON_SUBST,"t",e,t);case"T":return this.readBranch(o.BRANCH_ON_NO_SUBST,"T",e,t);case"r":return this.readFileCommand(o.FILE_READ,"r",e,t);case"R":return this.readFileCommand(o.FILE_READ_LINE,"R",e,t);case"w":return this.readFileCommand(o.FILE_WRITE,"w",e,t);case"W":return this.readFileCommand(o.FILE_WRITE_LINE,"W",e,t);case"e":return this.readExecute(e,t);case"p":case"P":case"d":case"D":case"h":case"H":case"g":case"G":case"x":case"n":case"N":case"q":case"Q":case"z":case"=":case"l":case"F":return{type:o.COMMAND,value:n,line:e,column:t};case"v":return this.readVersion(e,t);default:return{type:o.ERROR,value:n,line:e,column:t}}}readSubstitute(e,t){let n=this.advance();if(!n||n===`
|
|
24
|
-
`)return{type:o.ERROR,value:"s",line:e,column:t};let s="",a=!1;for(;this.pos<this.input.length;){let c=this.peek();if(c===n&&!a)break;if(c==="\\")this.advance(),this.pos<this.input.length&&this.peek()!==`
|
|
25
|
-
`?this.peek()===n&&!a?s+=this.advance():(s+="\\",s+=this.advance()):s+="\\";else{if(c===`
|
|
26
|
-
`)break;c==="["&&!a?(a=!0,s+=this.advance(),this.peek()==="^"&&(s+=this.advance()),this.peek()==="]"&&(s+=this.advance())):c==="]"&&a?(a=!1,s+=this.advance()):s+=this.advance()}}if(this.peek()!==n)return{type:o.ERROR,value:"unterminated substitution pattern",line:e,column:t};this.advance();let r="";for(;this.pos<this.input.length&&this.peek()!==n;)if(this.peek()==="\\")if(this.advance(),this.pos<this.input.length){let c=this.peek();c==="\\"?(this.advance(),this.pos<this.input.length&&this.peek()===`
|
|
27
|
-
`?(r+=`
|
|
28
|
-
`,this.advance()):r+="\\"):c===`
|
|
29
|
-
`?(r+=`
|
|
30
|
-
`,this.advance()):r+=`\\${this.advance()}`}else r+="\\";else{if(this.peek()===`
|
|
31
|
-
`)break;r+=this.advance()}this.peek()===n&&this.advance();let l="";for(;this.pos<this.input.length;){let c=this.peek();if(c==="g"||c==="i"||c==="p"||c==="I"||this.isDigit(c))l+=this.advance();else break}return{type:o.SUBSTITUTE,value:`s${n}${s}${n}${r}${n}${l}`,pattern:s,replacement:r,flags:l,line:e,column:t}}readTransliterate(e,t){let n=this.advance();if(!n||n===`
|
|
32
|
-
`)return{type:o.ERROR,value:"y",line:e,column:t};let s=this.readEscapedString(n);if(s===null||this.peek()!==n)return{type:o.ERROR,value:"unterminated transliteration source",line:e,column:t};this.advance();let a=this.readEscapedString(n);if(a===null||this.peek()!==n)return{type:o.ERROR,value:"unterminated transliteration dest",line:e,column:t};this.advance();let r=this.peek();for(;r===" "||r===" ";)this.advance(),r=this.peek();return r!==""&&r!==";"&&r!==`
|
|
33
|
-
`&&r!=="}"?{type:o.ERROR,value:"extra text at the end of a transform command",line:e,column:t}:{type:o.TRANSLITERATE,value:`y${n}${s}${n}${a}${n}`,source:s,dest:a,line:e,column:t}}readTextCommand(e,t,n){let s=!1;this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===`
|
|
34
|
-
`||this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&(s=!0,this.advance()),(this.peek()===" "||this.peek()===" ")&&this.advance(),this.peek()==="\\"&&this.pos+1<this.input.length&&(this.input[this.pos+1]===" "||this.input[this.pos+1]===" ")&&this.advance(),s&&this.peek()===`
|
|
35
|
-
`&&this.advance();let a="";for(;this.pos<this.input.length;){let r=this.peek();if(r===`
|
|
36
|
-
`){if(a.endsWith("\\")){a=`${a.slice(0,-1)}
|
|
37
|
-
`,this.advance();continue}break}if(r==="\\"&&this.pos+1<this.input.length){let l=this.input[this.pos+1];if(l==="n"){a+=`
|
|
38
|
-
`,this.advance(),this.advance();continue}if(l==="t"){a+=" ",this.advance(),this.advance();continue}if(l==="r"){a+="\r",this.advance(),this.advance();continue}}a+=this.advance()}return{type:o.TEXT_CMD,value:e,text:a,line:t,column:n}}readBranch(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let a="";for(;this.pos<this.input.length;){let r=this.peek();if(r===" "||r===" "||r===`
|
|
39
|
-
`||r===";"||r==="}"||r==="{")break;a+=this.advance()}return{type:e,value:t,label:a||void 0,line:n,column:s}}readVersion(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===" "||s===" "||s===`
|
|
40
|
-
`||s===";"||s==="}"||s==="{")break;n+=this.advance()}return{type:o.VERSION,value:"v",label:n||void 0,line:e,column:t}}readFileCommand(e,t,n,s){for(;this.peek()===" "||this.peek()===" ";)this.advance();let a="";for(;this.pos<this.input.length;){let r=this.peek();if(r===`
|
|
41
|
-
`||r===";")break;a+=this.advance()}return{type:e,value:t,filename:a.trim(),line:n,column:s}}readExecute(e,t){for(;this.peek()===" "||this.peek()===" ";)this.advance();let n="";for(;this.pos<this.input.length;){let s=this.peek();if(s===`
|
|
42
|
-
`||s===";")break;n+=this.advance()}return{type:o.EXECUTE,value:"e",command:n.trim()||void 0,line:e,column:t}}isDigit(e){return e>="0"&&e<="9"}};var K=class{scripts;tokens=[];pos=0;extendedRegex=!1;constructor(e,t=!1){this.scripts=e,this.extendedRegex=t}parse(){let e=[];for(let t of this.scripts){let n=new _(t);for(this.tokens=n.tokenize(),this.pos=0;!this.isAtEnd();){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let s=this.pos,a=this.parseCommand();if(a.error)return{commands:[],error:a.error};if(a.command&&e.push(a.command),this.pos===s&&!this.isAtEnd())return{commands:[],error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}}return{commands:e}}parseCommand(){let e=this.parseAddressRange();if(e?.error)return{command:null,error:e.error};let t=e?.address;for(this.check(o.NEGATION)&&(this.advance(),t&&(t.negated=!0));this.check(o.NEWLINE)||this.check(o.SEMICOLON);)this.advance();if(this.isAtEnd())return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null};let n=this.peek();switch(n.type){case o.COMMAND:return this.parseSimpleCommand(n,t);case o.SUBSTITUTE:return this.parseSubstituteFromToken(n,t);case o.TRANSLITERATE:return this.parseTransliterateFromToken(n,t);case o.LABEL_DEF:return this.advance(),{command:{type:"label",name:n.label||""}};case o.BRANCH:return this.advance(),{command:{type:"branch",address:t,label:n.label}};case o.BRANCH_ON_SUBST:return this.advance(),{command:{type:"branchOnSubst",address:t,label:n.label}};case o.BRANCH_ON_NO_SUBST:return this.advance(),{command:{type:"branchOnNoSubst",address:t,label:n.label}};case o.TEXT_CMD:return this.advance(),this.parseTextCommand(n,t);case o.FILE_READ:return this.advance(),{command:{type:"readFile",address:t,filename:n.filename||""}};case o.FILE_READ_LINE:return this.advance(),{command:{type:"readFileLine",address:t,filename:n.filename||""}};case o.FILE_WRITE:return this.advance(),{command:{type:"writeFile",address:t,filename:n.filename||""}};case o.FILE_WRITE_LINE:return this.advance(),{command:{type:"writeFirstLine",address:t,filename:n.filename||""}};case o.EXECUTE:return this.advance(),{command:{type:"execute",address:t,command:n.command}};case o.VERSION:return this.advance(),{command:{type:"version",address:t,minVersion:n.label}};case o.LBRACE:return this.parseGroup(t);case o.RBRACE:return{command:null};case o.ERROR:return{command:null,error:`invalid command: ${n.value}`};default:return t&&(t.start!==void 0||t.end!==void 0)?{command:null,error:"command expected"}:{command:null}}}parseSimpleCommand(e,t){this.advance();let n=e.value;switch(n){case"p":return{command:{type:"print",address:t}};case"P":return{command:{type:"printFirstLine",address:t}};case"d":return{command:{type:"delete",address:t}};case"D":return{command:{type:"deleteFirstLine",address:t}};case"h":return{command:{type:"hold",address:t}};case"H":return{command:{type:"holdAppend",address:t}};case"g":return{command:{type:"get",address:t}};case"G":return{command:{type:"getAppend",address:t}};case"x":return{command:{type:"exchange",address:t}};case"n":return{command:{type:"next",address:t}};case"N":return{command:{type:"nextAppend",address:t}};case"q":return{command:{type:"quit",address:t}};case"Q":return{command:{type:"quitSilent",address:t}};case"z":return{command:{type:"zap",address:t}};case"=":return{command:{type:"lineNumber",address:t}};case"l":return{command:{type:"list",address:t}};case"F":return{command:{type:"printFilename",address:t}};default:return{command:null,error:`unknown command: ${n}`}}}parseSubstituteFromToken(e,t){this.advance();let n=e.flags||"",s,a=n.match(/(\d+)/);return a&&(s=parseInt(a[1],10)),{command:{type:"substitute",address:t,pattern:e.pattern||"",replacement:e.replacement||"",global:n.includes("g"),ignoreCase:n.includes("i")||n.includes("I"),printOnMatch:n.includes("p"),nthOccurrence:s,extendedRegex:this.extendedRegex}}}parseTransliterateFromToken(e,t){this.advance();let n=e.source||"",s=e.dest||"";return n.length!==s.length?{command:null,error:"transliteration sets must have same length"}:{command:{type:"transliterate",address:t,source:n,dest:s}}}parseTextCommand(e,t){let n=e.value,s=e.text||"";switch(n){case"a":return{command:{type:"append",address:t,text:s}};case"i":return{command:{type:"insert",address:t,text:s}};case"c":return{command:{type:"change",address:t,text:s}};default:return{command:null,error:`unknown text command: ${n}`}}}parseGroup(e){this.advance();let t=[];for(;!this.isAtEnd()&&!this.check(o.RBRACE);){if(this.check(o.NEWLINE)||this.check(o.SEMICOLON)){this.advance();continue}let n=this.pos,s=this.parseCommand();if(s.error)return{command:null,error:s.error};if(s.command&&t.push(s.command),this.pos===n&&!this.isAtEnd())return{command:null,error:`unknown command: '${this.peek()?.value??this.peek()?.type}'`}}return this.check(o.RBRACE)?(this.advance(),{command:{type:"group",address:e,commands:t}}):{command:null,error:"unmatched brace in grouped commands"}}parseAddressRange(){if(this.check(o.COMMA))return{error:"expected context address"};let e=this.parseAddress();if(e===void 0)return;let t;if(this.check(o.RELATIVE_OFFSET))t={offset:this.advance().offset||0};else if(this.check(o.COMMA)&&(this.advance(),t=this.parseAddress(),t===void 0))return{error:"expected context address"};return{address:{start:e,end:t}}}parseAddress(){let e=this.peek();switch(e.type){case o.NUMBER:return this.advance(),e.value;case o.DOLLAR:return this.advance(),"$";case o.PATTERN:return this.advance(),{pattern:e.pattern||e.value};case o.STEP:return this.advance(),{first:e.first||0,step:e.step||0};case o.RELATIVE_OFFSET:return this.advance(),{offset:e.offset||0};default:return}}peek(){return this.tokens[this.pos]||{type:o.EOF,value:"",line:0,column:0}}advance(){return this.isAtEnd()||this.pos++,this.tokens[this.pos-1]}check(e){return this.peek().type===e}isAtEnd(){return this.peek().type===o.EOF}};function ae(i,e=!1){let t=!1,n=!1,s=[];for(let c=0;c<i.length;c++){let f=i[c];if(s.length===0&&c===0){let p=f.match(/^#([nr]+)\s*(?:\n|$)/i);if(p){let x=p[1].toLowerCase();x.includes("n")&&(t=!0),x.includes("r")&&(n=!0),f=f.slice(p[0].length)}}if(s.length>0&&s[s.length-1].endsWith("\\")){let p=s[s.length-1];s[s.length-1]=`${p}
|
|
43
|
-
${f}`}else s.push(f)}let a=s.join(`
|
|
44
|
-
`),l=new K([a],e||n).parse();if(!l.error&&l.commands.length>0){let c=xe(l.commands);if(c)return{commands:[],error:c,silentMode:t,extendedRegexMode:n}}return{...l,silentMode:t,extendedRegexMode:n}}function xe(i){let e=new Set;ce(i,e);let t=oe(i,e);if(t)return`undefined label '${t}'`}function ce(i,e){for(let t of i)t.type==="label"?e.add(t.name):t.type==="group"&&ce(t.commands,e)}function oe(i,e){for(let t of i){if((t.type==="branch"||t.type==="branchOnSubst"||t.type==="branchOnNoSubst")&&t.label&&!e.has(t.label))return t.label;if(t.type==="group"){let n=oe(t.commands,e);if(n)return n}}}var ke={name:"sed",summary:"stream editor for filtering and transforming text",usage:"sed [OPTION]... {script} [input-file]...",options:["-n, --quiet, --silent suppress automatic printing of pattern space","-e script add the script to commands to be executed","-f script-file read script from file","-i, --in-place edit files in place","-E, -r, --regexp-extended use extended regular expressions"," --help display this help and exit"],description:`Commands:
|
|
45
|
-
s/regexp/replacement/[flags] substitute
|
|
46
|
-
d delete pattern space
|
|
47
|
-
p print pattern space
|
|
48
|
-
a\\ text append text after line
|
|
49
|
-
i\\ text insert text before line
|
|
50
|
-
c\\ text change (replace) line with text
|
|
51
|
-
h copy pattern space to hold space
|
|
52
|
-
H append pattern space to hold space
|
|
53
|
-
g copy hold space to pattern space
|
|
54
|
-
G append hold space to pattern space
|
|
55
|
-
x exchange pattern and hold spaces
|
|
56
|
-
n read next line into pattern space
|
|
57
|
-
N append next line to pattern space
|
|
58
|
-
y/source/dest/ transliterate characters
|
|
59
|
-
= print line number
|
|
60
|
-
l list pattern space (escape special chars)
|
|
61
|
-
b [label] branch to label
|
|
62
|
-
t [label] branch on substitution
|
|
63
|
-
T [label] branch if no substitution
|
|
64
|
-
:label define label
|
|
65
|
-
q quit
|
|
66
|
-
Q quit without printing
|
|
67
|
-
|
|
68
|
-
Addresses:
|
|
69
|
-
N line number
|
|
70
|
-
$ last line
|
|
71
|
-
/regexp/ lines matching regexp
|
|
72
|
-
N,M range from line N to M
|
|
73
|
-
first~step every step-th line starting at first`};async function Q(i,e,t,n={}){let{limits:s,filename:a,fs:r,cwd:l,coverage:c,requireDefenseContext:f}=n;U(f,"sed","processing entry");let p=(R,m)=>z(f,"sed",R,m),x=i.endsWith(`
|
|
74
|
-
`),g=i.split(`
|
|
75
|
-
`);g.length>0&&g[g.length-1]===""&&g.pop();let d=g.length,E="",u,h=!1,b=s?.maxStringLength??0,v=R=>{if(E+=R,b>0&&E.length>b)throw new k(`sed: output size limit exceeded (${b} bytes)`,"string_length")},O="",J,le=new Map,T=new Map,B=new Map,D=new Map,ue=s?{maxIterations:s.maxSedIterations,maxStringLength:b}:void 0;for(let R=0;R<g.length;R++){let m={...re(d,a,le),patternSpace:g[R],holdSpace:O,lastPattern:J,lineNumber:R+1,totalLines:d,substitutionMade:!1,coverage:c},F={lines:g,currentLineIndex:R},Y=0,he=1e4;m.linesConsumedInCycle=0;do{if(Y++,Y>he)break;if(m.restartCycle=!1,m.pendingFileReads=[],m.pendingFileWrites=[],Z(e,m,F,ue),r&&l){for(let C of m.pendingFileReads){let S=r.resolvePath(l,C.filename);try{if(C.wholeFile){let y=await p("read command file",()=>r.readFile(S));m.appendBuffer.push(y.replace(/\n$/,""))}else{if(!T.has(S)){let de=await p("read command file line cache",()=>r.readFile(S));T.set(S,de.split(`
|
|
76
|
-
`)),B.set(S,0)}let y=T.get(S),M=B.get(S);y&&M!==void 0&&M<y.length&&(m.appendBuffer.push(y[M]),B.set(S,M+1))}}catch(y){if(y instanceof I)throw y}}for(let C of m.pendingFileWrites){let S=r.resolvePath(l,C.filename),y=D.get(S)||"";D.set(S,y+C.content)}}}while(m.restartCycle&&!m.deleted&&!m.quit&&!m.quitSilent);if(R+=m.linesConsumedInCycle,O=m.holdSpace,J=m.lastPattern,!t)for(let C of m.nCommandOutput)v(`${C}
|
|
77
|
-
`);let fe=m.lineNumberOutput.length>0;for(let C of m.lineNumberOutput)v(`${C}
|
|
78
|
-
`);let ee=[],q=[];for(let C of m.appendBuffer)C.startsWith("__INSERT__")?ee.push(C.slice(10)):q.push(C);for(let C of ee)v(`${C}
|
|
79
|
-
`);let $=!1;!m.deleted&&!m.quitSilent?t?m.printed&&(v(`${m.patternSpace}
|
|
80
|
-
`),$=!0):(v(`${m.patternSpace}
|
|
81
|
-
`),$=!0):m.changedText!==void 0&&(v(`${m.changedText}
|
|
82
|
-
`),$=!0);for(let C of q)v(`${C}
|
|
83
|
-
`);if(h=(fe||$)&&q.length===0,m.quit||m.quitSilent){if(m.exitCode!==void 0&&(u=m.exitCode),m.errorMessage)return{output:"",exitCode:u||1,errorMessage:m.errorMessage};break}}if(r&&l)for(let[R,m]of D)try{await p("flush pending file writes",()=>r.writeFile(R,m))}catch(F){if(F instanceof I)throw F}return!x&&h&&E.endsWith(`
|
|
84
|
-
`)&&(E=E.slice(0,-1)),{output:E,exitCode:u}}var Pe={name:"sed",async execute(i,e){U(e.requireDefenseContext,"sed","execution entry");let t=(u,h)=>z(e.requireDefenseContext,"sed",u,h);if(ne(i))return te(ke);let n=[],s=[],a=!1,r=!1,l=!1,c=[];for(let u=0;u<i.length;u++){let h=i[u];if(h==="-n"||h==="--quiet"||h==="--silent")a=!0;else if(h==="-i"||h==="--in-place")r=!0;else if(h.startsWith("-i"))r=!0;else if(h==="-E"||h==="-r"||h==="--regexp-extended")l=!0;else if(h==="-e")u+1<i.length&&n.push(i[++u]);else if(h==="-f")u+1<i.length&&s.push(i[++u]);else{if(h.startsWith("--"))return W("sed",h);if(h==="-")c.push(h);else if(h.startsWith("-")&&h.length>1){for(let b of h.slice(1))if(b!=="n"&&b!=="e"&&b!=="f"&&b!=="i"&&b!=="E"&&b!=="r")return W("sed",`-${b}`);h.includes("n")&&(a=!0),h.includes("i")&&(r=!0),(h.includes("E")||h.includes("r"))&&(l=!0),h.includes("e")&&!h.includes("n")&&!h.includes("i")&&u+1<i.length&&n.push(i[++u]),h.includes("f")&&!h.includes("e")&&u+1<i.length&&s.push(i[++u])}else!h.startsWith("-")&&n.length===0&&s.length===0?n.push(h):h.startsWith("-")||c.push(h)}}for(let u of s){let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("script file read",()=>e.fs.readFile(h));for(let v of b.split(`
|
|
85
|
-
`)){let O=v.trim();O&&!O.startsWith("#")&&n.push(O)}}catch(b){if(b instanceof I)throw b;return{stdout:"",stderr:`sed: couldn't open file ${u}: No such file or directory
|
|
86
|
-
`,exitCode:1}}}if(n.length===0)return{stdout:"",stderr:`sed: no script specified
|
|
87
|
-
`,exitCode:1};let{commands:f,error:p,silentMode:x}=ae(n,l);if(p)return{stdout:"",stderr:`sed: ${p}
|
|
88
|
-
`,exitCode:1};let g=!!(a||x);if(r){if(c.length===0)return{stdout:"",stderr:`sed: -i requires at least one file argument
|
|
89
|
-
`,exitCode:1};for(let u of c){if(u==="-")continue;let h=e.fs.resolvePath(e.cwd,u);try{let b=await t("in-place input read",()=>e.fs.readFile(h)),v=await t("in-place processing",()=>Q(b,f,g,{limits:e.limits,filename:u,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));if(v.errorMessage)return{stdout:"",stderr:`${v.errorMessage}
|
|
90
|
-
`,exitCode:v.exitCode??1};await t("in-place output write",()=>e.fs.writeFile(h,v.output))}catch(b){if(b instanceof I)throw b;return b instanceof k?{stdout:"",stderr:`sed: ${L(b.message)}
|
|
91
|
-
`,exitCode:k.EXIT_CODE}:{stdout:"",stderr:`sed: ${u}: No such file or directory
|
|
92
|
-
`,exitCode:1}}}return{stdout:"",stderr:"",exitCode:0}}let d="";if(c.length===0){d=P(e.stdin);try{let u=await t("stdin processing",()=>Q(d,f,g,{limits:e.limits,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage}
|
|
93
|
-
`:"",exitCode:u.exitCode??0}}catch(u){if(u instanceof I)throw u;if(u instanceof k)return{stdout:"",stderr:`sed: ${L(u.message)}
|
|
94
|
-
`,exitCode:k.EXIT_CODE};throw u}}let E=!1;for(let u of c){let h;if(u==="-")E?h="":(h=P(e.stdin),E=!0);else{let b=e.fs.resolvePath(e.cwd,u);try{h=await t("input file read",()=>e.fs.readFile(b))}catch(v){if(v instanceof I)throw v;return v instanceof k?{stdout:"",stderr:`sed: ${L(v.message)}
|
|
95
|
-
`,exitCode:k.EXIT_CODE}:{stdout:"",stderr:`sed: ${u}: No such file or directory
|
|
96
|
-
`,exitCode:1}}}d.length>0&&h.length>0&&!d.endsWith(`
|
|
97
|
-
`)&&(d+=`
|
|
98
|
-
`),d+=h}try{let u=await t("final processing",()=>Q(d,f,g,{limits:e.limits,filename:c.length===1?c[0]:void 0,fs:e.fs,cwd:e.cwd,coverage:e.coverage,requireDefenseContext:e.requireDefenseContext}));return{stdout:u.output,stderr:u.errorMessage?`${u.errorMessage}
|
|
99
|
-
`:"",exitCode:u.exitCode??0}}catch(u){if(u instanceof I)throw u;if(u instanceof k)return{stdout:"",stderr:`sed: ${L(u.message)}
|
|
100
|
-
`,exitCode:k.EXIT_CODE};throw u}}},We={name:"sed",flags:[{flag:"-n",type:"boolean"},{flag:"-i",type:"boolean"},{flag:"-E",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-e",type:"value",valueHint:"string"}],stdinType:"text",needsArgs:!0};export{Pe as a,We as b};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as g,b as A,c as T,d as at,e as E,g as O,h as G}from"./chunk-4WKZNNJK.js";import{a as X,c as lt}from"./chunk-DLL7UR66.js";import{a as yt}from"./chunk-KAPG5ONA.js";import{a as R}from"./chunk-7CSMHFIJ.js";import{k as B}from"./chunk-SAI2SPQQ.js";function W(t,r,e,n,c,o,u,p,s,f){switch(r){case"sort":return Array.isArray(t)?[[...t].sort(u)]:[null];case"sort_by":return!Array.isArray(t)||e.length===0?[null]:[[...t].sort((h,a)=>{let y=c(h,e[0],n)[0],l=c(a,e[0],n)[0];return u(y,l)})];case"bsearch":{if(!Array.isArray(t)){let h=t===null?"null":typeof t=="object"?"object":typeof t;throw new Error(`${h} (${JSON.stringify(t)}) cannot be searched from`)}return e.length===0?[null]:c(t,e[0],n).map(h=>{let a=0,y=t.length;for(;a<y;){let l=a+y>>>1;u(t[l],h)<0?a=l+1:y=l}return a<t.length&&u(t[a],h)===0?a:-a-1})}case"unique_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let a of t){let y=c(a,e[0],n)[0],l=JSON.stringify(y);i.has(l)||i.set(l,{item:a,key:y})}let h=[...i.values()];return h.sort((a,y)=>u(a.key,y.key)),[h.map(a=>a.item)]}case"group_by":{if(!Array.isArray(t)||e.length===0)return[null];let i=new Map;for(let h of t){let a=JSON.stringify(c(h,e[0],n)[0]);i.has(a)||i.set(a,[]),i.get(a)?.push(h)}return[[...i.values()]]}case"max":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)>0?i:h)]:[null];case"max_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=c(i,e[0],n)[0],y=c(h,e[0],n)[0];return u(a,y)>0?i:h})];case"min":return Array.isArray(t)&&t.length>0?[t.reduce((i,h)=>u(i,h)<0?i:h)]:[null];case"min_by":return!Array.isArray(t)||t.length===0||e.length===0?[null]:[t.reduce((i,h)=>{let a=c(i,e[0],n)[0],y=c(h,e[0],n)[0];return u(a,y)<0?i:h})];case"add":{let i=h=>{let a=h.filter(y=>y!==null);return a.length===0?null:a.every(y=>typeof y=="number")?a.reduce((y,l)=>y+l,0):a.every(y=>typeof y=="string")?a.join(""):a.every(y=>Array.isArray(y))?a.flat():a.every(y=>y&&typeof y=="object"&&!Array.isArray(y))?lt(...a):null};if(e.length>=1){let h=c(t,e[0],n);return[i(h)]}return Array.isArray(t)?[i(t)]:[null]}case"any":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(c(h,e[1],n).some(p))return[!0]}catch(i){if(i instanceof f)throw i}return[!1]}return e.length===1?Array.isArray(t)?[t.some(i=>p(c(i,e[0],n)[0]))]:[!1]:Array.isArray(t)?[t.some(p)]:[!1]}case"all":{if(e.length>=2){try{let i=o(t,e[0],n);for(let h of i)if(!c(h,e[1],n).some(p))return[!1]}catch(i){if(i instanceof f)throw i}return[!0]}return e.length===1?Array.isArray(t)?[t.every(i=>p(c(i,e[0],n)[0]))]:[!0]:Array.isArray(t)?[t.every(p)]:[!0]}case"select":return e.length===0?[t]:c(t,e[0],n).some(p)?[t]:[];case"map":return e.length===0||!Array.isArray(t)?[null]:[t.flatMap(h=>c(h,e[0],n))];case"map_values":{if(e.length===0)return[null];if(Array.isArray(t))return[t.flatMap(i=>c(i,e[0],n))];if(t&&typeof t=="object"){let i=Object.create(null);for(let[h,a]of Object.entries(t)){if(!g(h))continue;let y=c(a,e[0],n);y.length>0&&A(i,h,y[0])}return[i]}return[null]}case"has":{if(e.length===0)return[!1];let h=c(t,e[0],n)[0];return Array.isArray(t)&&typeof h=="number"?[h>=0&&h<t.length]:t&&typeof t=="object"&&typeof h=="string"?[T(t,h)]:[!1]}case"in":{if(e.length===0)return[!1];let h=c(t,e[0],n)[0];return Array.isArray(h)&&typeof t=="number"?[t>=0&&t<h.length]:h&&typeof h=="object"&&typeof t=="string"?[T(h,t)]:[!1]}case"contains":{if(e.length===0)return[!1];let i=c(t,e[0],n);return[s(t,i[0])]}case"inside":{if(e.length===0)return[!1];let i=c(t,e[0],n);return[s(i[0],t)]}default:return null}}function z(t,r,e,n,c,o,u,p){switch(r){case"first":if(e.length>0)try{let s=o(t,e[0],n);return s.length>0?[s[0]]:[]}catch(s){if(s instanceof p)throw s;return[]}return Array.isArray(t)&&t.length>0?[t[0]]:[null];case"last":if(e.length>0){let s=c(t,e[0],n);return s.length>0?[s[s.length-1]]:[]}return Array.isArray(t)&&t.length>0?[t[t.length-1]]:[null];case"nth":{if(e.length<1)return[null];let s=c(t,e[0],n);if(e.length>1){for(let i of s)if(i<0)throw new Error("nth doesn't support negative indices");let f;try{f=o(t,e[1],n)}catch(i){if(i instanceof p)throw i;f=[]}return s.flatMap(i=>{let h=i;return h<f.length?[f[h]]:[]})}return Array.isArray(t)?s.flatMap(f=>{let i=f;if(i<0)throw new Error("nth doesn't support negative indices");return i<t.length?[t[i]]:[null]}):[null]}case"range":{if(e.length===0)return[];let s=Math.max(n.limits.maxIterations*100,1e6),f=l=>l.length>=s,i=c(t,e[0],n);if(e.length===1){let l=[];for(let m of i){let b=m;for(let w=0;w<b;w++)if(l.push(w),f(l))return l}return l}let h=c(t,e[1],n);if(e.length===2){let l=[];for(let m of i)for(let b of h){let w=m,k=b;for(let N=w;N<k;N++)if(l.push(N),f(l))return l}return l}let a=c(t,e[2],n),y=[];for(let l of i)for(let m of h)for(let b of a){let w=l,k=m,N=b;if(N!==0){if(N>0){for(let C=w;C<k;C+=N)if(y.push(C),f(y))return y}else for(let C=w;C>k;C+=N)if(y.push(C),f(y))return y}}return y}case"limit":return e.length<2?[]:c(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("limit doesn't support negative count");if(i===0)return[];let h;try{h=o(t,e[1],n)}catch(a){if(a instanceof p)throw a;h=[]}return h.slice(0,i)});case"isempty":{if(e.length<1)return[!0];try{return[o(t,e[0],n).length===0]}catch(s){if(s instanceof p)throw s;return[!0]}}case"isvalid":{if(e.length<1)return[!0];try{return[c(t,e[0],n).length>0]}catch(s){if(s instanceof p)throw s;return[!1]}}case"skip":return e.length<2?[]:c(t,e[0],n).flatMap(f=>{let i=f;if(i<0)throw new Error("skip doesn't support negative count");return c(t,e[1],n).slice(i)});case"until":{if(e.length<2)return[t];let s=t,f=n.limits.maxIterations;for(let i=0;i<f;i++){if(c(s,e[0],n).some(u))return[s];let a=c(s,e[1],n);if(a.length===0)return[s];s=a[0]}throw new p(`jq until: too many iterations (${f}), increase executionLimits.maxJqIterations`,"iterations")}case"while":{if(e.length<2)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h<i&&c(f,e[0],n).some(u);h++){s.push(f);let y=c(f,e[1],n);if(y.length===0)break;f=y[0]}if(s.length>=i)throw new p(`jq while: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}case"repeat":{if(e.length===0)return[t];let s=[],f=t,i=n.limits.maxIterations;for(let h=0;h<i;h++){s.push(f);let a=c(f,e[0],n);if(a.length===0)break;f=a[0]}if(s.length>=i)throw new p(`jq repeat: too many iterations (${i}), increase executionLimits.maxJqIterations`,"iterations");return s}default:return null}}function Z(t,r,e,n,c){switch(r){case"now":return[Date.now()/1e3];case"gmtime":{if(typeof t!="number")return[null];let o=new Date(t*1e3),u=o.getUTCFullYear(),p=o.getUTCMonth(),s=o.getUTCDate(),f=o.getUTCHours(),i=o.getUTCMinutes(),h=o.getUTCSeconds(),a=o.getUTCDay(),y=Date.UTC(u,0,1),l=Math.floor((o.getTime()-y)/(1440*60*1e3));return[[u,p,s,f,i,h,a,l]]}case"mktime":{if(!Array.isArray(t))throw new Error("mktime requires parsed datetime inputs");let[o,u,p,s=0,f=0,i=0]=t;if(typeof o!="number"||typeof u!="number")throw new Error("mktime requires parsed datetime inputs");let h=Date.UTC(o,u,p??1,s??0,f??0,i??0);return[Math.floor(h/1e3)]}case"strftime":{if(e.length===0)return[null];let u=c(t,e[0],n)[0];if(typeof u!="string")throw new Error("strftime/1 requires a string format");let p;if(typeof t=="number")p=new Date(t*1e3);else if(Array.isArray(t)){let[a,y,l,m=0,b=0,w=0]=t;if(typeof a!="number"||typeof y!="number")throw new Error("strftime/1 requires parsed datetime inputs");p=new Date(Date.UTC(a,y,l??1,m??0,b??0,w??0))}else throw new Error("strftime/1 requires parsed datetime inputs");let s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],f=["January","February","March","April","May","June","July","August","September","October","November","December"],i=(a,y=2)=>String(a).padStart(y,"0");return[u.replace(/%Y/g,String(p.getUTCFullYear())).replace(/%m/g,i(p.getUTCMonth()+1)).replace(/%d/g,i(p.getUTCDate())).replace(/%H/g,i(p.getUTCHours())).replace(/%M/g,i(p.getUTCMinutes())).replace(/%S/g,i(p.getUTCSeconds())).replace(/%A/g,s[p.getUTCDay()]).replace(/%B/g,f[p.getUTCMonth()]).replace(/%Z/g,"UTC").replace(/%%/g,"%")]}case"strptime":{if(e.length===0)return[null];if(typeof t!="string")throw new Error("strptime/1 requires a string input");let u=c(t,e[0],n)[0];if(typeof u!="string")throw new Error("strptime/1 requires a string format");if(u==="%Y-%m-%dT%H:%M:%SZ"){let s=t.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})Z$/);if(s){let[,f,i,h,a,y,l]=s.map(Number),m=new Date(Date.UTC(f,i-1,h,a,y,l)),b=m.getUTCDay(),w=Date.UTC(f,0,1),k=Math.floor((m.getTime()-w)/(1440*60*1e3));return[[f,i-1,h,a,y,l,b,k]]}}let p=new Date(t);if(!Number.isNaN(p.getTime())){let s=p.getUTCFullYear(),f=p.getUTCMonth(),i=p.getUTCDate(),h=p.getUTCHours(),a=p.getUTCMinutes(),y=p.getUTCSeconds(),l=p.getUTCDay(),m=Date.UTC(s,0,1),b=Math.floor((p.getTime()-m)/(1440*60*1e3));return[[s,f,i,h,a,y,l,b]]}throw new Error(`Cannot parse date: ${t}`)}case"fromdate":{if(typeof t!="string")throw new Error("fromdate requires a string input");let o=new Date(t);if(Number.isNaN(o.getTime()))throw new Error(`date "${t}" does not match format "%Y-%m-%dT%H:%M:%SZ"`);return[Math.floor(o.getTime()/1e3)]}case"todate":{if(typeof t!="number")throw new Error("todate requires a number input");return[new Date(t*1e3).toISOString().replace(/\.\d{3}Z$/,"Z")]}default:return null}}function S(t){return t!==!1&&t!==null}function I(t,r){return JSON.stringify(t)===JSON.stringify(r)}function U(t,r){return typeof t=="number"&&typeof r=="number"?t-r:typeof t=="string"&&typeof r=="string"?t.localeCompare(r):0}function v(t,r){let e=O(t);for(let n of Object.keys(r)){if(!g(n))continue;let c=T(e,n)?E(e[n]):null,o=E(r[n]);c&&o?A(e,n,v(c,o)):A(e,n,r[n])}return e}function D(t,r=3e3){let e=0,n=t;for(;e<r;)if(Array.isArray(n)){if(n.length===0)return e+1;n=n[0],e++}else if(n!==null&&typeof n=="object"){let c=Object.keys(n);if(c.length===0)return e+1;n=n[c[0]],e++}else return e;return e}function $(t,r){let e=p=>p===null?0:typeof p=="boolean"?1:typeof p=="number"?2:typeof p=="string"?3:Array.isArray(p)?4:typeof p=="object"?5:6,n=e(t),c=e(r);if(n!==c)return n-c;if(typeof t=="number"&&typeof r=="number")return t-r;if(typeof t=="string"&&typeof r=="string")return t.localeCompare(r);if(typeof t=="boolean"&&typeof r=="boolean")return(t?1:0)-(r?1:0);if(Array.isArray(t)&&Array.isArray(r)){for(let p=0;p<Math.min(t.length,r.length);p++){let s=$(t[p],r[p]);if(s!==0)return s}return t.length-r.length}let o=E(t),u=E(r);if(o&&u){let p=Object.keys(o).sort(),s=Object.keys(u).sort();for(let f=0;f<Math.min(p.length,s.length);f++){let i=p[f].localeCompare(s[f]);if(i!==0)return i}if(p.length!==s.length)return p.length-s.length;for(let f of p){let i=$(o[f],u[f]);if(i!==0)return i}}return 0}function F(t,r){if(I(t,r))return!0;if(typeof t=="string"&&typeof r=="string")return t.includes(r);if(Array.isArray(t)&&Array.isArray(r))return r.every(c=>t.some(o=>F(o,c)));let e=E(t),n=E(r);return e&&n?Object.keys(n).every(c=>T(e,c)&&F(e[c],n[c])):!1}var Ot=2e3;function tt(t,r,e){switch(r){case"@base64":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"utf-8").toString("base64")]:[btoa(t)]:[null];case"@base64d":return typeof t=="string"?typeof Buffer<"u"?[Buffer.from(t,"base64").toString("utf-8")]:[atob(t)]:[null];case"@uri":return typeof t=="string"?[encodeURIComponent(t).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")]:[null];case"@urid":return typeof t=="string"?[decodeURIComponent(t)]:[null];case"@csv":return Array.isArray(t)?[t.map(c=>{if(c===null)return"";if(typeof c=="boolean")return c?"true":"false";if(typeof c=="number")return String(c);let o=String(c);return o.includes(",")||o.includes('"')||o.includes(`
|
|
3
|
-
`)||o.includes("\r")?`"${o.replace(/"/g,'""')}"`:o}).join(",")]:[null];case"@tsv":return Array.isArray(t)?[t.map(n=>String(n??"").replace(/\t/g,"\\t").replace(/\n/g,"\\n")).join(" ")]:[null];case"@json":{let n=e??Ot;return D(t,n+1)>n?[null]:[JSON.stringify(t)]}case"@html":return typeof t=="string"?[t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")]:[null];case"@sh":return typeof t=="string"?[`'${t.replace(/'/g,"'\\''")}'`]:[null];case"@text":return typeof t=="string"?[t]:t==null?[""]:[String(t)];default:return null}}function et(t,r,e,n,c,o){switch(r){case"index":return e.length===0?[null]:c(t,e[0],n).map(p=>{if(typeof t=="string"&&typeof p=="string"){if(p===""&&t==="")return null;let s=t.indexOf(p);return s>=0?s:null}if(Array.isArray(t)){if(Array.isArray(p)){for(let f=0;f<=t.length-p.length;f++){let i=!0;for(let h=0;h<p.length;h++)if(!o(t[f+h],p[h])){i=!1;break}if(i)return f}return null}let s=t.findIndex(f=>o(f,p));return s>=0?s:null}return null});case"rindex":return e.length===0?[null]:c(t,e[0],n).map(p=>{if(typeof t=="string"&&typeof p=="string"){let s=t.lastIndexOf(p);return s>=0?s:null}if(Array.isArray(t)){if(Array.isArray(p)){for(let s=t.length-p.length;s>=0;s--){let f=!0;for(let i=0;i<p.length;i++)if(!o(t[s+i],p[i])){f=!1;break}if(f)return s}return null}for(let s=t.length-1;s>=0;s--)if(o(t[s],p))return s;return null}return null});case"indices":return e.length===0?[[]]:c(t,e[0],n).map(p=>{let s=[];if(typeof t=="string"&&typeof p=="string"){let f=t.indexOf(p);for(;f!==-1;)s.push(f),f=t.indexOf(p,f+1)}else if(Array.isArray(t))if(Array.isArray(p)){let f=p.length;if(f===0)for(let i=0;i<=t.length;i++)s.push(i);else for(let i=0;i<=t.length-f;i++){let h=!0;for(let a=0;a<f;a++)if(!o(t[i+a],p[a])){h=!1;break}h&&s.push(i)}}else for(let f=0;f<t.length;f++)o(t[f],p)&&s.push(f);return s});default:return null}}function rt(t,r,e,n,c){switch(r){case"fabs":case"abs":return typeof t=="number"?[Math.abs(t)]:typeof t=="string"?[t]:[null];case"exp10":return typeof t=="number"?[10**t]:[null];case"exp2":return typeof t=="number"?[2**t]:[null];case"pow":{if(e.length<2)return[null];let o=c(t,e[0],n),u=c(t,e[1],n),p=o[0],s=u[0];return typeof p!="number"||typeof s!="number"?[null]:[p**s]}case"atan2":{if(e.length<2)return[null];let o=c(t,e[0],n),u=c(t,e[1],n),p=o[0],s=u[0];return typeof p!="number"||typeof s!="number"?[null]:[Math.atan2(p,s)]}case"hypot":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[Math.hypot(t,o)]}case"fma":{if(typeof t!="number"||e.length<2)return[null];let o=c(t,e[0],n)[0],u=c(t,e[1],n)[0];return[t*o+u]}case"copysign":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[Math.sign(o)*Math.abs(t)]}case"drem":case"remainder":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[t-Math.round(t/o)*o]}case"fdim":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[Math.max(0,t-o)]}case"fmax":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[Math.max(t,o)]}case"fmin":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[Math.min(t,o)]}case"ldexp":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[t*2**o]}case"scalbn":case"scalbln":{if(typeof t!="number"||e.length===0)return[null];let o=c(t,e[0],n)[0];return[t*2**o]}case"nearbyint":return typeof t=="number"?[Math.round(t)]:[null];case"logb":return typeof t=="number"?[Math.floor(Math.log2(Math.abs(t)))]:[null];case"significand":if(typeof t=="number"){let o=Math.floor(Math.log2(Math.abs(t)));return[t/2**o]}return[null];case"frexp":if(typeof t=="number"){if(t===0)return[[0,0]];let o=Math.floor(Math.log2(Math.abs(t)))+1;return[[t/2**o,o]]}return[null];case"modf":if(typeof t=="number"){let o=Math.trunc(t);return[[t-o,o]]}return[null];default:return null}}function nt(t,r,e,n,c,o,u,p){switch(r){case"recurse":{if(e.length===0){let y=[],l=m=>{if(y.push(m),Array.isArray(m))for(let b of m)l(b);else if(m&&typeof m=="object")for(let b of Object.keys(m))l(m[b])};return l(t),y}let s=[],f=e.length>=2?e[1]:null,i=1e4,h=0,a=y=>{if(h++>i||f&&!c(y,f,n).some(o))return;s.push(y);let l=c(y,e[0],n);for(let m of l)m!=null&&a(m)};return a(t),s}case"recurse_down":return p(t,"recurse",e,n);case"walk":{if(e.length===0)return[t];let s=new WeakSet,f=i=>{if(i&&typeof i=="object"){if(s.has(i))return i;s.add(i)}let h;if(Array.isArray(i))h=i.map(f);else if(i&&typeof i=="object"){let y=Object.create(null);for(let[l,m]of Object.entries(i))g(l)&&A(y,l,f(m));h=y}else h=i;return c(h,e[0],n)[0]};return[f(t)]}case"transpose":{if(!Array.isArray(t))return[null];if(t.length===0)return[[]];let s=Math.max(...t.map(i=>Array.isArray(i)?i.length:0)),f=[];for(let i=0;i<s;i++)f.push(t.map(h=>Array.isArray(h)?h[i]:null));return[f]}case"combinations":{if(e.length>0){let h=c(t,e[0],n)[0];if(!Array.isArray(t)||h<0)return[];if(h===0)return[[]];let a=[],y=(l,m)=>{if(m===h){a.push([...l]);return}for(let b of t)l.push(b),y(l,m+1),l.pop()};return y([],0),a}if(!Array.isArray(t))return[];if(t.length===0)return[[]];for(let i of t)if(!Array.isArray(i))return[];let s=[],f=(i,h)=>{if(i===t.length){s.push([...h]);return}let a=t[i];for(let y of a)h.push(y),f(i+1,h),h.pop()};return f(0,[]),s}case"parent":{if(n.root===void 0||n.currentPath===void 0)return[];let s=n.currentPath;if(s.length===0)return[];let f=e.length>0?c(t,e[0],n)[0]:1;if(f>=0){if(f>s.length)return[];let i=s.slice(0,s.length-f);return[u(n.root,i)]}else{let i=-f-1;if(i>=s.length)return[t];let h=s.slice(0,i);return[u(n.root,h)]}}case"parents":{if(n.root===void 0||n.currentPath===void 0)return[[]];let s=n.currentPath,f=[];for(let i=s.length-1;i>=0;i--)f.push(u(n.root,s.slice(0,i)));return[f]}case"root":return n.root!==void 0?[n.root]:[];default:return null}}var Nt=2e3;function st(t,r,e,n,c){switch(r){case"keys":return Array.isArray(t)?[t.map((o,u)=>u)]:t&&typeof t=="object"?[Object.keys(t).sort()]:[null];case"keys_unsorted":return Array.isArray(t)?[t.map((o,u)=>u)]:t&&typeof t=="object"?[Object.keys(t)]:[null];case"length":return typeof t=="string"?[t.length]:Array.isArray(t)?[t.length]:t&&typeof t=="object"?[Object.keys(t).length]:t===null?[0]:typeof t=="number"?[Math.abs(t)]:[null];case"utf8bytelength":{if(typeof t=="string")return[new TextEncoder().encode(t).length];let o=t===null?"null":Array.isArray(t)?"array":typeof t,u=o==="array"||o==="object"?JSON.stringify(t):String(t);throw new Error(`${o} (${u}) only strings have UTF-8 byte length`)}case"to_entries":{let o=E(t);return o?[Object.entries(o).map(([u,p])=>({key:u,value:p}))]:[null]}case"from_entries":if(Array.isArray(t)){let o=Object.create(null);for(let u of t){let p=E(u);if(p){let s=p.key??p.Key??p.name??p.Name??p.k,f=p.value??p.Value??p.v;if(s!==void 0){let i=String(s);g(i)&&A(o,i,f)}}}return[o]}return[null];case"with_entries":{if(e.length===0)return[t];let o=E(t);if(o){let p=Object.entries(o).map(([f,i])=>({key:f,value:i})).flatMap(f=>c(f,e[0],n)),s=Object.create(null);for(let f of p){let i=E(f);if(i){let h=i.key??i.name??i.k,a=i.value??i.v;if(h!==void 0){let y=String(h);g(y)&&A(s,y,a)}}}return[s]}return[null]}case"reverse":return Array.isArray(t)?[[...t].reverse()]:typeof t=="string"?[t.split("").reverse().join("")]:[null];case"flatten":return Array.isArray(t)?(e.length>0?c(t,e[0],n):[Number.POSITIVE_INFINITY]).map(u=>{let p=u;if(p<0)throw new Error("flatten depth must not be negative");return t.flat(p)}):[null];case"unique":if(Array.isArray(t)){let o=new Set,u=[];for(let p of t){let s=JSON.stringify(p);o.has(s)||(o.add(s),u.push(p))}return[u]}return[null];case"tojson":case"tojsonstream":{let o=n.limits.maxDepth??Nt;return D(t,o+1)>o?[null]:[JSON.stringify(t)]}case"fromjson":{if(typeof t=="string"){let o=t.trim().toLowerCase();if(o==="nan")return[Number.NaN];if(o==="inf"||o==="infinity")return[Number.POSITIVE_INFINITY];if(o==="-inf"||o==="-infinity")return[Number.NEGATIVE_INFINITY];try{return[at(JSON.parse(t))]}catch{throw new Error(`Invalid JSON: ${t}`)}}return[t]}case"tostring":return typeof t=="string"?[t]:[JSON.stringify(t)];case"tonumber":if(typeof t=="number")return[t];if(typeof t=="string"){let o=Number(t);if(Number.isNaN(o))throw new Error(`${JSON.stringify(t)} cannot be parsed as a number`);return[o]}throw new Error(`${typeof t} cannot be parsed as a number`);case"toboolean":{if(typeof t=="boolean")return[t];if(typeof t=="string"){if(t==="true")return[!0];if(t==="false")return[!1];throw new Error(`string (${JSON.stringify(t)}) cannot be parsed as a boolean`)}let o=t===null?"null":Array.isArray(t)?"array":typeof t,u=o==="array"||o==="object"?JSON.stringify(t):String(t);throw new Error(`${o} (${u}) cannot be parsed as a boolean`)}case"tostream":{let o=[],u=(p,s)=>{if(p===null||typeof p!="object")o.push([s,p]);else if(Array.isArray(p))if(p.length===0)o.push([s,[]]);else for(let f=0;f<p.length;f++)u(p[f],[...s,f]);else{let f=Object.keys(p);if(f.length===0)o.push([s,Object.create(null)]);else for(let i of f)u(p[i],[...s,i])}};return u(t,[]),o.push([[]]),o}case"fromstream":{if(e.length===0)return[t];let o=c(t,e[0],n),u=null;for(let p of o){if(!Array.isArray(p)||p.length===1&&Array.isArray(p[0])&&p[0].length===0||p.length!==2)continue;let[s,f]=p;if(!Array.isArray(s))continue;if(s.length===0){u=f;continue}u===null&&(u=typeof s[0]=="number"?[]:Object.create(null));let i=u;for(let a=0;a<s.length-1;a++){let y=s[a],l=s[a+1];if(Array.isArray(i)&&typeof y=="number"){for(;i.length<=y;)i.push(null);i[y]===null&&(i[y]=typeof l=="number"?[]:Object.create(null)),i=i[y]}else{let m=E(i);if(m){let b=String(y);if(!g(b))continue;(m[b]===null||m[b]===void 0)&&A(m,b,typeof l=="number"?[]:Object.create(null)),i=m[b]}}}let h=s[s.length-1];if(Array.isArray(i)&&typeof h=="number"){for(;i.length<=h;)i.push(null);i[h]=f}else{let a=E(i);if(a){let y=String(h);g(y)&&A(a,y,f)}}}return[u]}case"truncate_stream":{let o=typeof t=="number"?Math.floor(t):0;if(e.length===0)return[];let u=[],p=c(t,e[0],n);for(let s of p)if(Array.isArray(s)){if(s.length===1&&Array.isArray(s[0])){let f=s[0];f.length>o&&u.push([f.slice(o)]);continue}if(s.length===2&&Array.isArray(s[0])){let f=s[0],i=s[1];f.length>o&&u.push([f.slice(o),i])}}return u}default:return null}}function it(t,r,e,n,c,o,u,p,s,f){switch(r){case"getpath":{if(e.length===0)return[null];let i=c(t,e[0],n),h=[];for(let a of i){let y=a,l=t;for(let m of y){if(l==null){l=null;break}if(Array.isArray(l)&&typeof m=="number")l=l[m];else if(typeof m=="string"){let b=E(l);if(!b||!Object.hasOwn(b,m)){l=null;break}l=b[m]}else{l=null;break}}h.push(l)}return h}case"setpath":{if(e.length<2)return[null];let h=c(t,e[0],n)[0],y=c(t,e[1],n)[0];return[u(t,h,y)]}case"delpaths":{if(e.length===0)return[t];let h=c(t,e[0],n)[0],a=t;for(let y of h.sort((l,m)=>m.length-l.length))a=p(a,y);return[a]}case"path":{if(e.length===0)return[[]];let i=[];return f(t,e[0],n,[],i),i}case"del":return e.length===0?[t]:[s(t,e[0],n)];case"pick":{if(e.length===0)return[null];let i=[];for(let a of e)f(t,a,n,[],i);let h=null;for(let a of i){for(let l of a)if(typeof l=="number"&&l<0)throw new Error("Out of bounds negative array index");let y=t;for(let l of a){if(y==null)break;if(Array.isArray(y)&&typeof l=="number")y=y[l];else if(typeof l=="string"){let m=E(y);if(!m||!Object.hasOwn(m,l)){y=null;break}y=m[l]}else{y=null;break}}h=u(h,a,y)}return[h]}case"paths":{let i=[],h=(a,y)=>{if(a&&typeof a=="object")if(Array.isArray(a))for(let l=0;l<a.length;l++)i.push([...y,l]),h(a[l],[...y,l]);else for(let l of Object.keys(a))i.push([...y,l]),h(a[l],[...y,l])};return h(t,[]),e.length>0?i.filter(a=>{let y=t;for(let m of a)if(Array.isArray(y)&&typeof m=="number")y=y[m];else if(typeof m=="string"){let b=E(y);if(!b||!Object.hasOwn(b,m))return!1;y=b[m]}else return!1;return c(y,e[0],n).some(o)}):i}case"leaf_paths":{let i=[],h=(a,y)=>{if(a===null||typeof a!="object")i.push(y);else if(Array.isArray(a))for(let l=0;l<a.length;l++)h(a[l],[...y,l]);else for(let l of Object.keys(a))h(a[l],[...y,l])};return h(t,[]),i}default:return null}}function ot(t,r,e,n,c,o){switch(r){case"IN":{if(e.length===0)return[!1];if(e.length===1){let f=c(t,e[0],n);for(let i of f)if(o(t,i))return[!0];return[!1]}let u=c(t,e[0],n),p=c(t,e[1],n),s=new Set(p.map(f=>JSON.stringify(f)));for(let f of u)if(s.has(JSON.stringify(f)))return[!0];return[!1]}case"INDEX":{if(e.length===0)return[Object.create(null)];if(e.length===1){let s=c(t,e[0],n),f=Object.create(null);for(let i of s){let h=String(i);g(h)&&A(f,h,i)}return[f]}if(e.length===2){let s=c(t,e[0],n),f=Object.create(null);for(let i of s){let h=c(i,e[1],n);if(h.length>0){let a=String(h[0]);g(a)&&A(f,a,i)}}return[f]}let u=c(t,e[0],n),p=Object.create(null);for(let s of u){let f=c(s,e[1],n),i=c(s,e[2],n);if(f.length>0&&i.length>0){let h=String(f[0]);g(h)&&A(p,h,i[0])}}return[p]}case"JOIN":{if(e.length<2)return[null];let u=E(c(t,e[0],n)[0]);if(!u)return[null];if(!Array.isArray(t))return[null];let p=[];for(let s of t){let f=c(s,e[1],n),i=f.length>0?String(f[0]):"",h=T(u,i)?u[i]:null;p.push([s,h])}return[p]}default:return null}}function ft(t,r,e,n,c){switch(r){case"join":{if(!Array.isArray(t))return[null];let o=e.length>0?c(t,e[0],n):[""];for(let u of t)if(Array.isArray(u)||u!==null&&typeof u=="object")throw new Error("cannot join: contains arrays or objects");return o.map(u=>t.map(p=>p===null?"":typeof p=="string"?p:String(p)).join(String(u)))}case"split":{if(typeof t!="string"||e.length===0)return[null];let o=c(t,e[0],n),u=String(o[0]);return[t.split(u)]}case"splits":{if(typeof t!="string"||e.length===0)return[];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"g";return R(u,p.includes("g")?p:`${p}g`).split(t)}catch{return[]}}case"scan":{if(typeof t!="string"||e.length===0)return[];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"";return[...R(u,p.includes("g")?p:`${p}g`).matchAll(t)].map(i=>i.length>1?i.slice(1):i[0])}catch{return[]}}case"test":{if(typeof t!="string"||e.length===0)return[!1];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"";return[R(u,p).test(t)]}catch{return[!1]}}case"match":{if(typeof t!="string"||e.length===0)return[null];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"",f=R(u,`${p}d`).exec(t);if(!f)return[];let i=f.indices;return[{offset:f.index,length:f[0].length,string:f[0],captures:f.slice(1).map((h,a)=>({offset:i?.[a+1]?.[0]??null,length:h?.length??0,string:h??"",name:null}))}]}catch{return[null]}}case"capture":{if(typeof t!="string"||e.length===0)return[null];let o=c(t,e[0],n),u=String(o[0]);try{let p=e.length>1?String(c(t,e[1],n)[0]):"",f=R(u,p).match(t);return!f||!f.groups?[Object.create(null)]:[f.groups]}catch{return[null]}}case"sub":{if(typeof t!="string"||e.length<2)return[null];let o=c(t,e[0],n),u=c(t,e[1],n),p=String(o[0]),s=String(u[0]);try{let f=e.length>2?String(c(t,e[2],n)[0]):"";return[R(p,f).replace(t,s)]}catch{return[t]}}case"gsub":{if(typeof t!="string"||e.length<2)return[null];let o=c(t,e[0],n),u=c(t,e[1],n),p=String(o[0]),s=String(u[0]);try{let f=e.length>2?String(c(t,e[2],n)[0]):"g",i=f.includes("g")?f:`${f}g`;return[R(p,i).replace(t,s)]}catch{return[t]}}case"ascii_downcase":return typeof t=="string"?[t.replace(/[A-Z]/g,o=>String.fromCharCode(o.charCodeAt(0)+32))]:[null];case"ascii_upcase":return typeof t=="string"?[t.replace(/[a-z]/g,o=>String.fromCharCode(o.charCodeAt(0)-32))]:[null];case"ltrimstr":{if(typeof t!="string"||e.length===0)return[t];let o=c(t,e[0],n),u=String(o[0]);return[t.startsWith(u)?t.slice(u.length):t]}case"rtrimstr":{if(typeof t!="string"||e.length===0)return[t];let o=c(t,e[0],n),u=String(o[0]);return u===""?[t]:[t.endsWith(u)?t.slice(0,-u.length):t]}case"trimstr":{if(typeof t!="string"||e.length===0)return[t];let o=c(t,e[0],n),u=String(o[0]);if(u==="")return[t];let p=t;return p.startsWith(u)&&(p=p.slice(u.length)),p.endsWith(u)&&(p=p.slice(0,-u.length)),[p]}case"trim":if(typeof t=="string")return[t.trim()];throw new Error("trim input must be a string");case"ltrim":if(typeof t=="string")return[t.trimStart()];throw new Error("trim input must be a string");case"rtrim":if(typeof t=="string")return[t.trimEnd()];throw new Error("trim input must be a string");case"startswith":{if(typeof t!="string"||e.length===0)return[!1];let o=c(t,e[0],n);return[t.startsWith(String(o[0]))]}case"endswith":{if(typeof t!="string"||e.length===0)return[!1];let o=c(t,e[0],n);return[t.endsWith(String(o[0]))]}case"ascii":return typeof t=="string"&&t.length>0?[t.charCodeAt(0)]:[null];case"explode":return typeof t=="string"?[Array.from(t).map(o=>o.codePointAt(0))]:[null];case"implode":if(!Array.isArray(t))throw new Error("implode input must be an array");return[t.map(p=>{if(typeof p=="string")throw new Error(`string (${JSON.stringify(p)}) can't be imploded, unicode codepoint needs to be numeric`);if(typeof p!="number"||Number.isNaN(p))throw new Error("number (null) can't be imploded, unicode codepoint needs to be numeric");let s=Math.trunc(p);return s<0||s>1114111||s>=55296&&s<=57343?String.fromCodePoint(65533):String.fromCodePoint(s)}).join("")];default:return null}}function ct(t,r){switch(r){case"type":return t===null?["null"]:Array.isArray(t)?["array"]:typeof t=="boolean"?["boolean"]:typeof t=="number"?["number"]:typeof t=="string"?["string"]:typeof t=="object"?["object"]:["null"];case"infinite":return[Number.POSITIVE_INFINITY];case"nan":return[Number.NaN];case"isinfinite":return[typeof t=="number"&&!Number.isFinite(t)];case"isnan":return[typeof t=="number"&&Number.isNaN(t)];case"isnormal":return[typeof t=="number"&&Number.isFinite(t)&&t!==0];case"isfinite":return[typeof t=="number"&&Number.isFinite(t)];case"numbers":return typeof t=="number"?[t]:[];case"strings":return typeof t=="string"?[t]:[];case"booleans":return typeof t=="boolean"?[t]:[];case"nulls":return t===null?[t]:[];case"arrays":return Array.isArray(t)?[t]:[];case"objects":return t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"iterables":return Array.isArray(t)||t&&typeof t=="object"&&!Array.isArray(t)?[t]:[];case"scalars":return!Array.isArray(t)&&!(t&&typeof t=="object")?[t]:[];case"values":return t===null?[]:[t];case"not":return t===!1||t===null?[!0]:[!1];case"null":return[null];case"true":return[!0];case"false":return[!1];case"empty":return[];default:return null}}function K(t,r,e){if(r.length===0)return e;let[n,...c]=r;if(typeof n=="number"){if(t&&typeof t=="object"&&!Array.isArray(t))throw new Error("Cannot index object with number");if(n>536870911)throw new Error("Array index too large");if(n<0)throw new Error("Out of bounds negative array index");let f=Array.isArray(t)?[...t]:[];for(;f.length<=n;)f.push(null);return f[n]=K(f[n],c,e),f}if(Array.isArray(t))throw new Error("Cannot index array with string");if(!g(n))return t??Object.create(null);let o=E(t),u=o?O(o):Object.create(null),p=Object.hasOwn(u,n)?u[n]:void 0;return A(u,n,K(p,c,e)),u}function V(t,r){if(r.length===0)return null;if(r.length===1){let c=r[0];if(Array.isArray(t)&&typeof c=="number"){let o=[...t];return o.splice(c,1),o}if(t&&typeof t=="object"&&!Array.isArray(t)){let o=String(c);if(!g(o))return t;let u=O(t);return delete u[o],u}return t}let[e,...n]=r;if(Array.isArray(t)&&typeof e=="number"){let c=[...t];return c[e]=V(c[e],n),c}if(t&&typeof t=="object"&&!Array.isArray(t)){let c=String(e);if(!g(c))return t;let o=O(t);return Object.hasOwn(o,c)&&A(o,c,V(o[c],n)),o}return t}var P=class t extends Error{label;partialResults;constructor(r,e=[]){super(`break ${r}`),this.label=r,this.partialResults=e,this.name="BreakError"}withPrependedResults(r){return new t(this.label,[...r,...this.partialResults])}},H=class extends Error{value;constructor(r){super(typeof r=="string"?r:JSON.stringify(r)),this.value=r,this.name="JqError"}},St=1e4,bt=2e3,Ct=new Map([["floor",Math.floor],["ceil",Math.ceil],["round",Math.round],["sqrt",Math.sqrt],["log",Math.log],["log10",Math.log10],["log2",Math.log2],["exp",Math.exp],["sin",Math.sin],["cos",Math.cos],["tan",Math.tan],["asin",Math.asin],["acos",Math.acos],["atan",Math.atan],["sinh",Math.sinh],["cosh",Math.cosh],["tanh",Math.tanh],["asinh",Math.asinh],["acosh",Math.acosh],["atanh",Math.atanh],["cbrt",Math.cbrt],["expm1",Math.expm1],["log1p",Math.log1p],["trunc",Math.trunc]]);function Tt(t){return{vars:new Map,limits:{maxIterations:t?.limits?.maxIterations??St,maxDepth:t?.limits?.maxDepth??bt},env:t?.env,coverage:t?.coverage,requireDefenseContext:t?.requireDefenseContext,defenseContextChecked:!1}}function q(t,r,e){let n=new Map(t.vars);return n.set(r,e),{vars:n,limits:t.limits,env:t.env,requireDefenseContext:t.requireDefenseContext,defenseContextChecked:t.defenseContextChecked,root:t.root,currentPath:t.currentPath,funcs:t.funcs,labels:t.labels,coverage:t.coverage}}function L(t,r,e){switch(r.type){case"var":return q(t,r.name,e);case"array":{if(!Array.isArray(e))return null;let n=t;for(let c=0;c<r.elements.length;c++){let o=r.elements[c],u=c<e.length?e[c]:null,p=L(n,o,u);if(p===null)return null;n=p}return n}case"object":{let n=E(e);if(!n)return null;let c=t;for(let o of r.fields){let u;if(typeof o.key=="string")u=o.key;else{let f=d(e,o.key,t);if(f.length===0)return null;u=String(f[0])}let p=T(n,u)?n[u]:null;o.keyVar&&(c=q(c,o.keyVar,p));let s=L(c,o.pattern,p);if(s===null)return null;c=s}return c}}}function Rt(t,r){let e=t;for(let n of r)if(e&&typeof e=="object")if(Array.isArray(e))if(typeof n=="number")e=e[n];else return;else{let c=E(e);if(c&&typeof n=="string"&&Object.hasOwn(c,n))e=c[n];else return}else return;return e}function M(t){if(t.type==="Identity")return[];if(t.type==="Field"){let r=t.base?M(t.base):[];return r===null?null:[...r,t.name]}if(t.type==="Index"&&t.index.type==="Literal"){let r=t.base?M(t.base):[];if(r===null)return null;let e=t.index.value;return typeof e=="number"||typeof e=="string"?[...r,e]:null}if(t.type==="Pipe"){let r=M(t.left);return r===null?null:pt(r,t.right)}if(t.type==="Call"){if(t.name==="parent"||t.name==="root")return null;if(t.name==="first"&&t.args.length===0)return[0];if(t.name==="last"&&t.args.length===0)return[-1]}return null}function pt(t,r){if(r.type==="Call"){if(r.name==="parent"){let e=1;if(r.args.length>0&&r.args[0].type==="Literal"){let n=r.args[0].value;typeof n=="number"&&(e=n)}if(e>=0)return t.slice(0,Math.max(0,t.length-e));{let n=-e-1;return t.slice(0,Math.min(n,t.length))}}if(r.name==="root")return[]}if(r.type==="Field"){let e=M(r);if(e!==null)return[...t,...e]}if(r.type==="Index"&&r.index.type==="Literal"){let e=M(r);if(e!==null)return[...t,...e]}if(r.type==="Pipe"){let e=pt(t,r.left);return e===null?null:pt(e,r.right)}return r.type==="Identity"?t:null}function mt(t,r,e){if(r.type==="Comma"){let n=[];try{n.push(...d(t,r.left,e))}catch(c){if(c instanceof B)throw c;if(n.length>0)return n;throw new Error("evaluation failed")}try{n.push(...d(t,r.right,e))}catch(c){if(c instanceof B)throw c;return n}return n}return d(t,r,e)}function d(t,r,e){let n=e&&"vars"in e?e:Tt(e);switch(n.defenseContextChecked||(yt(n.requireDefenseContext,"query-engine","evaluation"),n={...n,defenseContextChecked:!0}),n.root===void 0&&(n={...n,root:t,currentPath:[]}),n.coverage?.hit(`jq:node:${r.type}`),r.type){case"Identity":return[t];case"Field":return(r.base?d(t,r.base,n):[t]).flatMap(o=>{let u=E(o);if(u){if(!Object.hasOwn(u,r.name))return[null];let s=u[r.name];return[s===void 0?null:s]}if(o===null)return[null];let p=Array.isArray(o)?"array":typeof o;throw new Error(`Cannot index ${p} with string "${r.name}"`)});case"Index":return(r.base?d(t,r.base,n):[t]).flatMap(o=>d(o,r.index,n).flatMap(p=>{if(typeof p=="number"&&Array.isArray(o)){if(Number.isNaN(p))return[null];let s=Math.trunc(p),f=s<0?o.length+s:s;return f>=0&&f<o.length?[o[f]]:[null]}if(typeof p=="string"){let s=E(o);return!s||!Object.hasOwn(s,p)?[null]:[s[p]]}return[null]}));case"Slice":return(r.base?d(t,r.base,n):[t]).flatMap(o=>{if(o===null)return[null];if(!Array.isArray(o)&&typeof o!="string")throw new Error(`Cannot slice ${typeof o} (${JSON.stringify(o)})`);let u=o.length,p=r.start?d(t,r.start,n):[0],s=r.end?d(t,r.end,n):[u];return p.flatMap(f=>s.map(i=>{let h=f,a=i,y=Number.isNaN(h)?0:Number.isInteger(h)?h:Math.floor(h),l=Number.isNaN(a)?u:Number.isInteger(a)?a:Math.ceil(a),m=dt(y,u),b=dt(l,u);return Array.isArray(o),o.slice(m,b)}))});case"Iterate":return(r.base?d(t,r.base,n):[t]).flatMap(o=>Array.isArray(o)?o:o&&typeof o=="object"?Object.values(o):[]);case"Pipe":{let c=d(t,r.left,n),o=M(r.left),u=[];for(let p of c)try{if(o!==null){let s={...n,currentPath:[...n.currentPath??[],...o]};u.push(...d(p,r.right,s))}else u.push(...d(p,r.right,n))}catch(s){throw s instanceof P?s.withPrependedResults(u):s}return u}case"Comma":{let c=d(t,r.left,n),o=d(t,r.right,n);return[...c,...o]}case"Literal":return[r.value];case"Array":return r.elements?[d(t,r.elements,n)]:[[]];case"Object":{let c=[Object.create(null)];for(let o of r.entries){let u=typeof o.key=="string"?[o.key]:d(t,o.key,n),p=d(t,o.value,n),s=[];for(let f of c)for(let i of u){if(typeof i!="string"){let h=i===null?"null":Array.isArray(i)?"array":typeof i;throw new Error(`Cannot use ${h} (${JSON.stringify(i)}) as object key`)}if(!g(i)){for(let h of p)s.push(O(f));continue}for(let h of p){let a=O(f);A(a,i,h),s.push(a)}}c.length=0,c.push(...s)}return c}case"Paren":return d(t,r.expr,n);case"BinaryOp":return xt(t,r.op,r.left,r.right,n);case"UnaryOp":return d(t,r.operand,n).map(o=>{if(r.op==="-"){if(typeof o=="number")return-o;if(typeof o=="string"){let u=p=>p.length>5?`"${p.slice(0,3)}...`:JSON.stringify(p);throw new Error(`string (${u(o)}) cannot be negated`)}return null}return r.op==="not"?!S(o):null});case"Cond":return d(t,r.cond,n).flatMap(o=>{if(S(o))return d(t,r.then,n);for(let u of r.elifs)if(d(t,u.cond,n).some(S))return d(t,u.then,n);return r.else?d(t,r.else,n):[t]});case"Try":try{return d(t,r.body,n)}catch(c){if(r.catch){let o=c instanceof H?c.value:c instanceof Error?c.message:String(c);return d(o,r.catch,n)}return[]}case"Call":return gt(t,r.name,r.args,n);case"VarBind":return d(t,r.value,n).flatMap(o=>{let u=null,p=[];r.pattern?p.push(r.pattern):r.name&&p.push({type:"var",name:r.name}),r.alternatives&&p.push(...r.alternatives);for(let s of p)if(u=L(n,s,o),u!==null)break;return u===null?[]:d(t,r.body,u)});case"VarRef":{if(r.name==="$ENV")return[n.env?X(n.env):Object.create(null)];let c=n.vars.get(r.name);return c!==void 0?[c]:[null]}case"Recurse":{let c=[],o=new WeakSet,u=p=>{if(p&&typeof p=="object"){if(o.has(p))return;o.add(p)}if(c.push(p),Array.isArray(p))for(let s of p)u(s);else if(p&&typeof p=="object")for(let s of Object.keys(p))u(p[s])};return u(t),c}case"Optional":try{return d(t,r.expr,n)}catch{return[]}case"StringInterp":return[r.parts.map(o=>typeof o=="string"?o:d(t,o,n).map(p=>typeof p=="string"?p:JSON.stringify(p)).join("")).join("")];case"UpdateOp":return[Mt(t,r.path,r.op,r.value,n)];case"Reduce":{let c=d(t,r.expr,n),o=d(t,r.init,n)[0],u=n.limits.maxDepth??bt;for(let p of c){let s;if(r.pattern){if(s=L(n,r.pattern,p),s===null)continue}else s=q(n,r.varName,p);if(o=d(o,r.update,s)[0],D(o,u+1)>u)return[null]}return[o]}case"Foreach":{let c=d(t,r.expr,n),o=d(t,r.init,n)[0],u=[];for(let p of c)try{let s;if(r.pattern){if(s=L(n,r.pattern,p),s===null)continue}else s=q(n,r.varName,p);if(o=d(o,r.update,s)[0],r.extract){let f=d(o,r.extract,s);u.push(...f)}else u.push(o)}catch(s){throw s instanceof P?s.withPrependedResults(u):s}return u}case"Label":try{return d(t,r.body,{...n,labels:new Set([...n.labels??[],r.name])})}catch(c){if(c instanceof P&&c.label===r.name)return c.partialResults;throw c}case"Break":throw new P(r.name);case"Def":{let c=new Map(n.funcs??[]),o=`${r.name}/${r.params.length}`;c.set(o,{params:r.params,body:r.funcBody,closure:new Map(n.funcs??[])});let u={...n,funcs:c};return d(t,r.body,u)}default:{let c=r;throw new Error(`Unknown AST node type: ${c.type}`)}}}function dt(t,r){return t<0?Math.max(0,r+t):Math.min(t,r)}function Mt(t,r,e,n,c){function o(s,f){switch(e){case"=":return f;case"|=":return d(s,n,c)[0]??null;case"+=":return typeof s=="number"&&typeof f=="number"||typeof s=="string"&&typeof f=="string"?s+f:Array.isArray(s)&&Array.isArray(f)?[...s,...f]:s&&f&&typeof s=="object"&&typeof f=="object"?G(s,f):f;case"-=":return typeof s=="number"&&typeof f=="number"?s-f:s;case"*=":return typeof s=="number"&&typeof f=="number"?s*f:s;case"/=":return typeof s=="number"&&typeof f=="number"?s/f:s;case"%=":return typeof s=="number"&&typeof f=="number"?s%f:s;case"//=":return s===null||s===!1?f:s;default:return f}}function u(s,f,i){switch(f.type){case"Identity":return i(s);case"Field":{if(!g(f.name))return s;if(f.base)return u(s,f.base,h=>{if(h&&typeof h=="object"&&!Array.isArray(h)){let a=O(h),y=Object.hasOwn(a,f.name)?a[f.name]:void 0;return A(a,f.name,i(y)),a}return h});if(s&&typeof s=="object"&&!Array.isArray(s)){let h=O(s),a=Object.hasOwn(h,f.name)?h[f.name]:void 0;return A(h,f.name,i(a)),h}return s}case"Index":{let a=d(t,f.index,c)[0];if(typeof a=="number"&&Number.isNaN(a))throw new Error("Cannot set array element at NaN index");if(typeof a=="number"&&!Number.isInteger(a)&&(a=Math.trunc(a)),f.base)return u(s,f.base,y=>{if(typeof a=="number"&&Array.isArray(y)){let l=[...y],m=a<0?l.length+a:a;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=i(l[m])}return l}if(typeof a=="string"&&y&&typeof y=="object"&&!Array.isArray(y)){if(!g(a))return y;let l=O(y),m=Object.hasOwn(l,a)?l[a]:void 0;return A(l,a,i(m)),l}return y});if(typeof a=="number"){if(a>536870911)throw new Error("Array index too large");if(a<0&&(!s||!Array.isArray(s)))throw new Error("Out of bounds negative array index");if(Array.isArray(s)){let l=[...s],m=a<0?l.length+a:a;if(m>=0){for(;l.length<=m;)l.push(null);l[m]=i(l[m])}return l}if(s==null){let l=[];for(;l.length<=a;)l.push(null);return l[a]=i(null),l}return s}if(typeof a=="string"&&s&&typeof s=="object"&&!Array.isArray(s)){if(!g(a))return s;let y=O(s),l=Object.hasOwn(y,a)?y[a]:void 0;return A(y,a,i(l)),y}return s}case"Iterate":{let h=a=>{if(Array.isArray(a))return a.map(y=>i(y));if(a&&typeof a=="object"){let y=Object.create(null);for(let[l,m]of Object.entries(a))g(l)&&A(y,l,i(m));return y}return a};return f.base?u(s,f.base,h):h(s)}case"Pipe":{let h=u(s,f.left,a=>a);return u(h,f.right,i)}default:return i(s)}}return u(t,r,s=>{if(e==="|=")return o(s,s);let f=d(t,n,c);return o(s,f[0]??null)})}function jt(t,r,e){function n(o,u,p){switch(u.type){case"Identity":return p;case"Field":{if(!g(u.name))return o;if(u.base){let s=d(o,u.base,e)[0],f=n(s,{type:"Field",name:u.name},p);return n(o,u.base,f)}if(o&&typeof o=="object"&&!Array.isArray(o)){let s=O(o);return A(s,u.name,p),s}return o}case"Index":{if(u.base){let i=d(o,u.base,e)[0],h=n(i,{type:"Index",index:u.index},p);return n(o,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(o)){let i=[...o],h=f<0?i.length+f:f;return h>=0&&h<i.length&&(i[h]=p),i}if(typeof f=="string"&&o&&typeof o=="object"&&!Array.isArray(o)){if(!g(f))return o;let i=O(o);return A(i,f,p),i}return o}default:return o}}function c(o,u){switch(u.type){case"Identity":return null;case"Field":{if(!g(u.name))return o;if(u.base){let s=d(o,u.base,e)[0];if(s==null)return o;let f=c(s,{type:"Field",name:u.name});return n(o,u.base,f)}if(o&&typeof o=="object"&&!Array.isArray(o)){if(!g(u.name))return o;let s=O(o);return delete s[u.name],s}return o}case"Index":{if(u.base){let i=d(o,u.base,e)[0];if(i==null)return o;let h=c(i,{type:"Index",index:u.index});return n(o,u.base,h)}let f=d(t,u.index,e)[0];if(typeof f=="number"&&Array.isArray(o)){let i=[...o],h=f<0?i.length+f:f;return h>=0&&h<i.length&&i.splice(h,1),i}if(typeof f=="string"&&o&&typeof o=="object"&&!Array.isArray(o)){if(!g(f))return o;let i=O(o);return delete i[f],i}return o}case"Iterate":return Array.isArray(o)?[]:o&&typeof o=="object"?Object.create(null):o;case"Pipe":{let i=function(y,l,m){switch(l.type){case"Identity":return m;case"Field":{if(!g(l.name))return y;if(y&&typeof y=="object"&&!Array.isArray(y)){let b=O(y);return A(b,l.name,m),b}return y}case"Index":{let w=d(t,l.index,e)[0];if(typeof w=="number"&&Array.isArray(y)){let k=[...y],N=w<0?k.length+w:w;return N>=0&&N<k.length&&(k[N]=m),k}if(typeof w=="string"&&y&&typeof y=="object"&&!Array.isArray(y)){if(!g(w))return y;let k=O(y);return A(k,w,m),k}return y}case"Pipe":{let b=d(y,l.left,e)[0],w=i(b,l.right,m);return i(y,l.left,w)}default:return y}};var p=i;let s=u.left,f=u.right,h=d(o,s,e)[0];if(h==null)return o;let a=c(h,f);return i(o,s,a)}default:return o}}return c(t,r)}function xt(t,r,e,n,c){if(r==="and")return d(t,e,c).flatMap(s=>S(s)?d(t,n,c).map(i=>S(i)):[!1]);if(r==="or")return d(t,e,c).flatMap(s=>S(s)?[!0]:d(t,n,c).map(i=>S(i)));if(r==="//"){let s=d(t,e,c).filter(f=>f!=null&&f!==!1);return s.length>0?s:d(t,n,c)}let o=d(t,e,c),u=d(t,n,c);return o.flatMap(p=>u.map(s=>{switch(r){case"+":return p===null?s:s===null?p:typeof p=="number"&&typeof s=="number"||typeof p=="string"&&typeof s=="string"?p+s:Array.isArray(p)&&Array.isArray(s)?[...p,...s]:p&&s&&typeof p=="object"&&typeof s=="object"&&!Array.isArray(p)&&!Array.isArray(s)?G(p,s):null;case"-":if(typeof p=="number"&&typeof s=="number")return p-s;if(Array.isArray(p)&&Array.isArray(s)){let f=new Set(s.map(i=>JSON.stringify(i)));return p.filter(i=>!f.has(JSON.stringify(i)))}if(typeof p=="string"&&typeof s=="string"){let f=i=>i.length>10?`"${i.slice(0,10)}...`:JSON.stringify(i);throw new Error(`string (${f(p)}) and string (${f(s)}) cannot be subtracted`)}return null;case"*":if(typeof p=="number"&&typeof s=="number")return p*s;if(typeof p=="string"&&typeof s=="number")return p.repeat(s);{let f=E(p),i=E(s);if(f&&i)return v(f,i)}return null;case"/":if(typeof p=="number"&&typeof s=="number"){if(s===0)throw new Error(`number (${p}) and number (${s}) cannot be divided because the divisor is zero`);return p/s}return typeof p=="string"&&typeof s=="string"?p.split(s):null;case"%":if(typeof p=="number"&&typeof s=="number"){if(s===0)throw new Error(`number (${p}) and number (${s}) cannot be divided (remainder) because the divisor is zero`);return!Number.isFinite(p)&&!Number.isNaN(p)?!Number.isFinite(s)&&!Number.isNaN(s)&&p<0&&s>0?-1:0:p%s}return null;case"==":return I(p,s);case"!=":return!I(p,s);case"<":return U(p,s)<0;case"<=":return U(p,s)<=0;case">":return U(p,s)>0;case">=":return U(p,s)>=0;default:return null}}))}function gt(t,r,e,n){let c=Ct.get(r);if(c)return typeof t=="number"?[c(t)]:[null];let o=rt(t,r,e,n,d);if(o!==null)return o;let u=ft(t,r,e,n,d);if(u!==null)return u;let p=Z(t,r,e,n,d);if(p!==null)return p;let s=tt(t,r,n.limits.maxDepth);if(s!==null)return s;let f=ct(t,r);if(f!==null)return f;let i=st(t,r,e,n,d);if(i!==null)return i;let h=W(t,r,e,n,d,mt,$,S,F,B);if(h!==null)return h;let a=it(t,r,e,n,d,S,K,V,jt,J);if(a!==null)return a;let y=et(t,r,e,n,d,I);if(y!==null)return y;let l=z(t,r,e,n,d,mt,S,B);if(l!==null)return l;let m=nt(t,r,e,n,d,S,Rt,gt);if(m!==null)return m;let b=ot(t,r,e,n,d,I);if(b!==null)return b;switch(r){case"builtins":return[["add/0","all/0","all/1","all/2","any/0","any/1","any/2","arrays/0","ascii/0","ascii_downcase/0","ascii_upcase/0","booleans/0","bsearch/1","builtins/0","combinations/0","combinations/1","contains/1","debug/0","del/1","delpaths/1","empty/0","env/0","error/0","error/1","explode/0","first/0","first/1","flatten/0","flatten/1","floor/0","from_entries/0","fromdate/0","fromjson/0","getpath/1","gmtime/0","group_by/1","gsub/2","gsub/3","has/1","implode/0","IN/1","IN/2","INDEX/1","INDEX/2","index/1","indices/1","infinite/0","inside/1","isempty/1","isnan/0","isnormal/0","isvalid/1","iterables/0","join/1","keys/0","keys_unsorted/0","last/0","last/1","length/0","limit/2","ltrimstr/1","map/1","map_values/1","match/1","match/2","max/0","max_by/1","min/0","min_by/1","mktime/0","modulemeta/1","nan/0","not/0","nth/1","nth/2","null/0","nulls/0","numbers/0","objects/0","path/1","paths/0","paths/1","pick/1","range/1","range/2","range/3","recurse/0","recurse/1","recurse_down/0","repeat/1","reverse/0","rindex/1","rtrimstr/1","scalars/0","scan/1","scan/2","select/1","setpath/2","skip/2","sort/0","sort_by/1","split/1","splits/1","splits/2","sqrt/0","startswith/1","strftime/1","strings/0","strptime/1","sub/2","sub/3","test/1","test/2","to_entries/0","toboolean/0","todate/0","tojson/0","tostream/0","fromstream/1","truncate_stream/1","tonumber/0","tostring/0","transpose/0","trim/0","ltrim/0","rtrim/0","type/0","unique/0","unique_by/1","until/2","utf8bytelength/0","values/0","walk/1","while/2","with_entries/1"]];case"error":{let w=e.length>0?d(t,e[0],n)[0]:t;throw new H(w)}case"env":return[n.env?X(n.env):Object.create(null)];case"debug":return[t];case"input_line_number":return[1];default:{let w=`${r}/${e.length}`,k=n.funcs?.get(w);if(k){let N=k.closure??n.funcs??new Map,C=new Map(N);C.set(w,k);for(let _=0;_<k.params.length;_++){let kt=k.params[_],ht=e[_];if(ht){let j=d(t,ht,n),x;if(j.length===0)x={type:"Call",name:"empty",args:[]};else if(j.length===1)x={type:"Literal",value:j[0]};else{x={type:"Literal",value:j[j.length-1]};for(let Q=j.length-2;Q>=0;Q--)x={type:"Comma",left:{type:"Literal",value:j[Q]},right:x}}C.set(`${kt}/0`,{params:[],body:x})}}let wt={...n,funcs:C};return d(t,k.body,wt)}throw new Error(`Unknown function: ${r}`)}}}function J(t,r,e,n,c){if(r.type==="Comma"){let p=r;J(t,p.left,e,n,c),J(t,p.right,e,n,c);return}let o=M(r);if(o!==null){c.push([...n,...o]);return}if(r.type==="Iterate"){if(Array.isArray(t))for(let p=0;p<t.length;p++)c.push([...n,p]);else if(t&&typeof t=="object")for(let p of Object.keys(t))c.push([...n,p]);return}if(r.type==="Recurse"){let p=(s,f)=>{if(c.push([...n,...f]),s&&typeof s=="object")if(Array.isArray(s))for(let i=0;i<s.length;i++)p(s[i],[...f,i]);else for(let i of Object.keys(s))p(s[i],[...f,i])};p(t,[]);return}if(r.type==="Pipe"){let p=M(r.left);if(p!==null){let s=d(t,r.left,e);for(let f of s)J(f,r.right,e,[...n,...p],c);return}}d(t,r,e).length>0&&c.push(n)}var At=new Map([["and","AND"],["or","OR"],["not","NOT"],["if","IF"],["then","THEN"],["elif","ELIF"],["else","ELSE"],["end","END"],["as","AS"],["try","TRY"],["catch","CATCH"],["true","TRUE"],["false","FALSE"],["null","NULL"],["reduce","REDUCE"],["foreach","FOREACH"],["label","LABEL"],["break","BREAK"],["def","DEF"]]),Y=new Set(At.values());function Et(t){let r=[],e=0,n=(f=0)=>t[e+f],c=()=>t[e++],o=()=>e>=t.length,u=f=>f>="0"&&f<="9",p=f=>f>="a"&&f<="z"||f>="A"&&f<="Z"||f==="_",s=f=>p(f)||u(f);for(;!o();){let f=e,i=c();if(!(i===" "||i===" "||i===`
|
|
4
|
-
`||i==="\r")){if(i==="#"){for(;!o()&&n()!==`
|
|
5
|
-
`;)c();continue}if(i==="."&&n()==="."){c(),r.push({type:"DOTDOT",pos:f});continue}if(i==="="&&n()==="="){c(),r.push({type:"EQ",pos:f});continue}if(i==="!"&&n()==="="){c(),r.push({type:"NE",pos:f});continue}if(i==="<"&&n()==="="){c(),r.push({type:"LE",pos:f});continue}if(i===">"&&n()==="="){c(),r.push({type:"GE",pos:f});continue}if(i==="/"&&n()==="/"){c(),n()==="="?(c(),r.push({type:"UPDATE_ALT",pos:f})):r.push({type:"ALT",pos:f});continue}if(i==="+"&&n()==="="){c(),r.push({type:"UPDATE_ADD",pos:f});continue}if(i==="-"&&n()==="="){c(),r.push({type:"UPDATE_SUB",pos:f});continue}if(i==="*"&&n()==="="){c(),r.push({type:"UPDATE_MUL",pos:f});continue}if(i==="/"&&n()==="="){c(),r.push({type:"UPDATE_DIV",pos:f});continue}if(i==="%"&&n()==="="){c(),r.push({type:"UPDATE_MOD",pos:f});continue}if(i==="="&&n()!=="="){r.push({type:"ASSIGN",pos:f});continue}if(i==="."){r.push({type:"DOT",pos:f});continue}if(i==="|"){n()==="="?(c(),r.push({type:"UPDATE_PIPE",pos:f})):r.push({type:"PIPE",pos:f});continue}if(i===","){r.push({type:"COMMA",pos:f});continue}if(i===":"){r.push({type:"COLON",pos:f});continue}if(i===";"){r.push({type:"SEMICOLON",pos:f});continue}if(i==="("){r.push({type:"LPAREN",pos:f});continue}if(i===")"){r.push({type:"RPAREN",pos:f});continue}if(i==="["){r.push({type:"LBRACKET",pos:f});continue}if(i==="]"){r.push({type:"RBRACKET",pos:f});continue}if(i==="{"){r.push({type:"LBRACE",pos:f});continue}if(i==="}"){r.push({type:"RBRACE",pos:f});continue}if(i==="?"){r.push({type:"QUESTION",pos:f});continue}if(i==="+"){r.push({type:"PLUS",pos:f});continue}if(i==="-"){r.push({type:"MINUS",pos:f});continue}if(i==="*"){r.push({type:"STAR",pos:f});continue}if(i==="/"){r.push({type:"SLASH",pos:f});continue}if(i==="%"){r.push({type:"PERCENT",pos:f});continue}if(i==="<"){r.push({type:"LT",pos:f});continue}if(i===">"){r.push({type:"GT",pos:f});continue}if(u(i)){let h=i;for(;!o()&&(u(n())||n()==="."||n()==="e"||n()==="E");)(n()==="e"||n()==="E")&&(t[e+1]==="+"||t[e+1]==="-")&&(h+=c()),h+=c();r.push({type:"NUMBER",value:Number(h),pos:f});continue}if(i==='"'){let h="",a=0;for(;!o();){let y=n();if(a===0&&y==='"')break;if(a===0&&y==="\\"){if(c(),o())break;let l=c();switch(l){case"n":h+=`
|
|
6
|
-
`;break;case"r":h+="\r";break;case"t":h+=" ";break;case"\\":h+="\\";break;case'"':h+='"';break;case"(":h+="\\(",a=1;break;default:h+=l}continue}if(a>0){if(y==='"'){for(h+=c();!o();){let l=n();if(l==="\\"){h+=c(),o()||(h+=c());continue}if(h+=c(),l==='"')break}continue}y==="("?a++:y===")"&&a--,h+=c();continue}h+=c()}o()||c(),r.push({type:"STRING",value:h,pos:f});continue}if(p(i)||i==="$"||i==="@"){let h=i;for(;!o()&&s(n());)h+=c();let a=At.get(h);a?r.push({type:a,value:h,pos:f}):r.push({type:"IDENT",value:h,pos:f});continue}throw new Error(`Unexpected character '${i}' at position ${f}`)}}return r.push({type:"EOF",pos:e}),r}var ut=class t{tokens;pos=0;constructor(r){this.tokens=r}peek(r=0){return this.tokens[this.pos+r]??{type:"EOF",pos:-1}}advance(){return this.tokens[this.pos++]}check(r){return this.peek().type===r}match(...r){for(let e of r)if(this.check(e))return this.advance();return null}expect(r,e){if(!this.check(r))throw new Error(`${e} at position ${this.peek().pos}, got ${this.peek().type}`);return this.advance()}isFieldNameAfterDot(r=0){let e=this.peek(r),n=this.peek(r+1);return n.type==="STRING"?!0:n.type==="IDENT"||Y.has(n.type)?n.pos===e.pos+1:!1}isIdentLike(){let r=this.peek().type;return r==="IDENT"||Y.has(r)}consumeFieldNameAfterDot(r){let e=this.peek();return e.type==="STRING"?this.advance().value:(e.type==="IDENT"||Y.has(e.type))&&e.pos===r.pos+1?this.advance().value:null}parse(){let r=this.parseExpr();if(!this.check("EOF"))throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`);return r}parseExpr(){return this.parsePipe()}parsePattern(){if(this.match("LBRACKET")){let n=[];if(!this.check("RBRACKET"))for(n.push(this.parsePattern());this.match("COMMA")&&!this.check("RBRACKET");)n.push(this.parsePattern());return this.expect("RBRACKET","Expected ']' after array pattern"),{type:"array",elements:n}}if(this.match("LBRACE")){let n=[];if(!this.check("RBRACE"))for(n.push(this.parsePatternField());this.match("COMMA")&&!this.check("RBRACE");)n.push(this.parsePatternField());return this.expect("RBRACE","Expected '}' after object pattern"),{type:"object",fields:n}}let r=this.expect("IDENT","Expected variable name in pattern"),e=r.value;if(!e.startsWith("$"))throw new Error(`Variable name must start with $ at position ${r.pos}`);return{type:"var",name:e}}parsePatternField(){if(this.match("LPAREN")){let e=this.parseExpr();this.expect("RPAREN","Expected ')' after computed key"),this.expect("COLON","Expected ':' after computed key");let n=this.parsePattern();return{key:e,pattern:n}}let r=this.peek();if(r.type==="IDENT"||Y.has(r.type)){let e=r.value;if(e.startsWith("$")){if(this.advance(),this.match("COLON")){let n=this.parsePattern();return{key:e.slice(1),pattern:n,keyVar:e}}return{key:e.slice(1),pattern:{type:"var",name:e}}}if(this.advance(),this.match("COLON")){let n=this.parsePattern();return{key:e,pattern:n}}return{key:e,pattern:{type:"var",name:`$${e}`}}}throw new Error(`Expected field name in object pattern at position ${r.pos}`)}parsePipe(){let r=this.parseComma();for(;this.match("PIPE");){let e=this.parseComma();r={type:"Pipe",left:r,right:e}}return r}parseComma(){let r=this.parseVarBind();for(;this.match("COMMA");){let e=this.parseVarBind();r={type:"Comma",left:r,right:e}}return r}parseVarBind(){let r=this.parseUpdate();if(this.match("AS")){let e=this.parsePattern(),n=[];for(;this.check("QUESTION")&&this.peekAhead(1)?.type==="ALT";)this.advance(),this.advance(),n.push(this.parsePattern());this.expect("PIPE","Expected '|' after variable binding");let c=this.parseExpr();return e.type==="var"&&n.length===0?{type:"VarBind",name:e.name,value:r,body:c}:{type:"VarBind",name:e.type==="var"?e.name:"",value:r,body:c,pattern:e.type!=="var"?e:void 0,alternatives:n.length>0?n:void 0}}return r}peekAhead(r){let e=this.pos+r;return e<this.tokens.length?this.tokens[e]:void 0}parseUpdate(){let r=this.parseAlt(),e=new Map([["ASSIGN","="],["UPDATE_ADD","+="],["UPDATE_SUB","-="],["UPDATE_MUL","*="],["UPDATE_DIV","/="],["UPDATE_MOD","%="],["UPDATE_ALT","//="],["UPDATE_PIPE","|="]]),n=this.match("ASSIGN","UPDATE_ADD","UPDATE_SUB","UPDATE_MUL","UPDATE_DIV","UPDATE_MOD","UPDATE_ALT","UPDATE_PIPE");if(n){let c=this.parseVarBind(),o=e.get(n.type);if(o)return{type:"UpdateOp",op:o,path:r,value:c}}return r}parseAlt(){let r=this.parseOr();for(;this.match("ALT");){let e=this.parseOr();r={type:"BinaryOp",op:"//",left:r,right:e}}return r}parseOr(){let r=this.parseAnd();for(;this.match("OR");){let e=this.parseAnd();r={type:"BinaryOp",op:"or",left:r,right:e}}return r}parseAnd(){let r=this.parseNot();for(;this.match("AND");){let e=this.parseNot();r={type:"BinaryOp",op:"and",left:r,right:e}}return r}parseNot(){return this.parseComparison()}parseComparison(){let r=this.parseAddSub(),e=new Map([["EQ","=="],["NE","!="],["LT","<"],["LE","<="],["GT",">"],["GE",">="]]),n=this.match("EQ","NE","LT","LE","GT","GE");if(n){let c=e.get(n.type);if(c){let o=this.parseAddSub();r={type:"BinaryOp",op:c,left:r,right:o}}}return r}parseAddSub(){let r=this.parseMulDiv();for(;;)if(this.match("PLUS")){let e=this.parseMulDiv();r={type:"BinaryOp",op:"+",left:r,right:e}}else if(this.match("MINUS")){let e=this.parseMulDiv();r={type:"BinaryOp",op:"-",left:r,right:e}}else break;return r}parseMulDiv(){let r=this.parseUnary();for(;;)if(this.match("STAR")){let e=this.parseUnary();r={type:"BinaryOp",op:"*",left:r,right:e}}else if(this.match("SLASH")){let e=this.parseUnary();r={type:"BinaryOp",op:"/",left:r,right:e}}else if(this.match("PERCENT")){let e=this.parseUnary();r={type:"BinaryOp",op:"%",left:r,right:e}}else break;return r}parseUnary(){return this.match("MINUS")?{type:"UnaryOp",op:"-",operand:this.parseUnary()}:this.parsePostfix()}parsePostfix(){let r=this.parsePrimary();for(;;)if(this.match("QUESTION"))r={type:"Optional",expr:r};else if(this.check("DOT")&&this.isFieldNameAfterDot())this.advance(),r={type:"Field",name:this.advance().value,base:r};else if(this.check("LBRACKET"))if(this.advance(),this.match("RBRACKET"))r={type:"Iterate",base:r};else if(this.check("COLON")){this.advance();let e=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),r={type:"Slice",end:e,base:r}}else{let e=this.parseExpr();if(this.match("COLON")){let n=this.check("RBRACKET")?void 0:this.parseExpr();this.expect("RBRACKET","Expected ']'"),r={type:"Slice",start:e,end:n,base:r}}else this.expect("RBRACKET","Expected ']'"),r={type:"Index",index:e,base:r}}else break;return r}parsePrimary(){if(this.match("DOTDOT"))return{type:"Recurse"};if(this.check("DOT")){let r=this.advance();if(this.check("LBRACKET")){if(this.advance(),this.match("RBRACKET"))return{type:"Iterate"};if(this.check("COLON")){this.advance();let c=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",end:c}}let n=this.parseExpr();if(this.match("COLON")){let c=this.check("RBRACKET")?void 0:this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Slice",start:n,end:c}}return this.expect("RBRACKET","Expected ']'"),{type:"Index",index:n}}let e=this.consumeFieldNameAfterDot(r);return e!==null?{type:"Field",name:e}:{type:"Identity"}}if(this.match("TRUE"))return{type:"Literal",value:!0};if(this.match("FALSE"))return{type:"Literal",value:!1};if(this.match("NULL"))return{type:"Literal",value:null};if(this.check("NUMBER"))return{type:"Literal",value:this.advance().value};if(this.check("STRING")){let e=this.advance().value;return e.includes("\\(")?this.parseStringInterpolation(e):{type:"Literal",value:e}}if(this.match("LBRACKET")){if(this.match("RBRACKET"))return{type:"Array"};let r=this.parseExpr();return this.expect("RBRACKET","Expected ']'"),{type:"Array",elements:r}}if(this.match("LBRACE"))return this.parseObjectConstruction();if(this.match("LPAREN")){let r=this.parseExpr();return this.expect("RPAREN","Expected ')'"),{type:"Paren",expr:r}}if(this.match("IF"))return this.parseIf();if(this.match("TRY")){let r=this.parsePostfix(),e;return this.match("CATCH")&&(e=this.parsePostfix()),{type:"Try",body:r,catch:e}}if(this.match("REDUCE")){let r=this.parseAddSub();this.expect("AS","Expected 'as' after reduce expression");let e=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let n=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let c=this.parseExpr();this.expect("RPAREN","Expected ')' after update expression");let o=e.type==="var"?e.name:"";return{type:"Reduce",expr:r,varName:o,init:n,update:c,pattern:e.type!=="var"?e:void 0}}if(this.match("FOREACH")){let r=this.parseAddSub();this.expect("AS","Expected 'as' after foreach expression");let e=this.parsePattern();this.expect("LPAREN","Expected '(' after variable");let n=this.parseExpr();this.expect("SEMICOLON","Expected ';' after init expression");let c=this.parseExpr(),o;this.match("SEMICOLON")&&(o=this.parseExpr()),this.expect("RPAREN","Expected ')' after expressions");let u=e.type==="var"?e.name:"";return{type:"Foreach",expr:r,varName:u,init:n,update:c,extract:o,pattern:e.type!=="var"?e:void 0}}if(this.match("LABEL")){let r=this.expect("IDENT","Expected label name (e.g., $out)"),e=r.value;if(!e.startsWith("$"))throw new Error(`Label name must start with $ at position ${r.pos}`);this.expect("PIPE","Expected '|' after label name");let n=this.parseExpr();return{type:"Label",name:e,body:n}}if(this.match("BREAK")){let r=this.expect("IDENT","Expected label name to break to"),e=r.value;if(!e.startsWith("$"))throw new Error(`Break label must start with $ at position ${r.pos}`);return{type:"Break",name:e}}if(this.match("DEF")){let e=this.expect("IDENT","Expected function name after def").value,n=[];if(this.match("LPAREN")){if(!this.check("RPAREN")){let u=this.expect("IDENT","Expected parameter name");for(n.push(u.value);this.match("SEMICOLON");){let p=this.expect("IDENT","Expected parameter name");n.push(p.value)}}this.expect("RPAREN","Expected ')' after parameters")}this.expect("COLON","Expected ':' after function name");let c=this.parseExpr();this.expect("SEMICOLON","Expected ';' after function body");let o=this.parseExpr();return{type:"Def",name:e,params:n,funcBody:c,body:o}}if(this.match("NOT"))return{type:"Call",name:"not",args:[]};if(this.check("IDENT")){let e=this.advance().value;if(e.startsWith("$"))return{type:"VarRef",name:e};if(this.match("LPAREN")){let n=[];if(!this.check("RPAREN"))for(n.push(this.parseExpr());this.match("SEMICOLON");)n.push(this.parseExpr());return this.expect("RPAREN","Expected ')'"),{type:"Call",name:e,args:n}}return{type:"Call",name:e,args:[]}}throw new Error(`Unexpected token ${this.peek().type} at position ${this.peek().pos}`)}parseObjectConstruction(){let r=[];if(!this.check("RBRACE"))do{let e,n;if(this.match("LPAREN"))e=this.parseExpr(),this.expect("RPAREN","Expected ')'"),this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else if(this.isIdentLike()){let c=this.advance().value;this.match("COLON")?(e=c,n=this.parseObjectValue()):(e=c,n={type:"Field",name:c})}else if(this.check("STRING"))e=this.advance().value,this.expect("COLON","Expected ':'"),n=this.parseObjectValue();else throw new Error(`Expected object key at position ${this.peek().pos}`);r.push({key:e,value:n})}while(this.match("COMMA"));return this.expect("RBRACE","Expected '}'"),{type:"Object",entries:r}}parseObjectValue(){let r=this.parseVarBind();for(;this.match("PIPE");){let e=this.parseVarBind();r={type:"Pipe",left:r,right:e}}return r}parseIf(){let r=this.parseExpr();this.expect("THEN","Expected 'then'");let e=this.parseExpr(),n=[];for(;this.match("ELIF");){let o=this.parseExpr();this.expect("THEN","Expected 'then' after elif");let u=this.parseExpr();n.push({cond:o,then:u})}let c;return this.match("ELSE")&&(c=this.parseExpr()),this.expect("END","Expected 'end'"),{type:"Cond",cond:r,then:e,elifs:n,else:c}}parseStringInterpolation(r){let e=[],n="",c=0;for(;c<r.length;)if(r[c]==="\\"&&r[c+1]==="("){n&&(e.push(n),n=""),c+=2;let o=1,u="";for(;c<r.length&&o>0;){let f=r[c];if(f==='"'){for(u+=f,c++;c<r.length;){let i=r[c];if(i==="\\"){u+=i,c++,c<r.length&&(u+=r[c],c++);continue}if(u+=i,c++,i==='"')break}continue}f==="("?o++:f===")"&&o--,o>0&&(u+=f),c++}let p=Et(u),s=new t(p);e.push(s.parse())}else n+=r[c],c++;return n&&e.push(n),{type:"StringInterp",parts:e}}};function Ne(t){let r=Et(t);return new ut(r).parse()}export{d as a,Ne as b};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as w,b as V}from"./chunk-J3LJZWL2.js";import{d as E}from"./chunk-4WKZNNJK.js";import{a as T,b as M}from"./chunk-KAPG5ONA.js";import{a as F}from"./chunk-VACKIICN.js";import{a as R}from"./chunk-KTPCYKBB.js";import{c as J}from"./chunk-XEKXHOPO.js";import{k as O}from"./chunk-SAI2SPQQ.js";import{a as N}from"./chunk-FOCWZZDE.js";import{a as A,b as L,c as I}from"./chunk-QAYAQNCG.js";function W(t){switch(t){case"\b":return"\\b";case"\f":return"\\f";case`
|
|
3
|
-
`:return"\\n";case"\r":return"\\r";case" ":return"\\t";default:return`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`}}function _(t){let n="",s=!1,i=!1;for(let a=0;a<t.length;a++){let r=t[a];if(i){n+=r,i=!1;continue}if(r==="\\"){n+=r,i=!0;continue}if(r==='"'){n+=r,s=!s;continue}if(s&&r.charCodeAt(0)<=31){n+=W(r);continue}n+=r}return n}function k(t,n,s){return JSON.parse(_(t.slice(n,s)))}function B(t){let n=[],s=0,i=t.length;for(;s<i;){for(;s<i&&/\s/.test(t[s]);)s++;if(s>=i)break;let a=s,r=t[s];if(r==="{"||r==="["){let f=r,c=r==="{"?"}":"]",p=1,m=!1,d=!1;for(s++;s<i&&p>0;){let j=t[s];d?d=!1:j==="\\"?d=!0:j==='"'?m=!m:m||(j===f?p++:j===c&&p--),s++}if(p!==0)throw new Error(`Unexpected end of JSON input at position ${s} (unclosed ${f})`);n.push(E(k(t,a,s)))}else if(r==='"'){let f=!1;for(s++;s<i;){let c=t[s];if(f)f=!1;else if(c==="\\")f=!0;else if(c==='"'){s++;break}s++}n.push(E(k(t,a,s)))}else if(r==="-"||r>="0"&&r<="9"){for(;s<i&&/[\d.eE+-]/.test(t[s]);)s++;n.push(E(k(t,a,s)))}else if(t.slice(s,s+4)==="true")n.push(!0),s+=4;else if(t.slice(s,s+5)==="false")n.push(!1),s+=5;else if(t.slice(s,s+4)==="null")n.push(null),s+=4;else{let f=t.slice(s,s+10);throw new Error(`Invalid JSON at position ${a}: unexpected '${f.split(/\s/)[0]}'`)}}return n}var X={name:"jq",summary:"command-line JSON processor",usage:"jq [OPTIONS] FILTER [FILE...]",options:["-R, --raw-input read each line as string instead of JSON","-r, --raw-output output strings without quotes","-c, --compact-output compact instead of pretty-printed output","-e, --exit-status set exit status based on output","-s, --slurp read entire input into array","-n, --null-input don't read any input","-j, --join-output don't print newlines after each output","-a, --ascii force ASCII output","-S, --sort-keys sort object keys","-C, --color colorize output (ignored)","-M, --monochrome monochrome output (ignored)"," --tab use tabs for indentation"," --help display this help and exit"]};function C(t,n,s,i,a,r=0){if(t===null||t===void 0)return"null";if(typeof t=="boolean")return String(t);if(typeof t=="number")return Number.isFinite(t)?String(t):"null";if(typeof t=="string")return s?t:JSON.stringify(t);let f=a?" ":" ";if(Array.isArray(t))return t.length===0?"[]":n?`[${t.map(p=>C(p,!0,!1,i,a)).join(",")}]`:`[
|
|
4
|
-
${t.map(p=>f.repeat(r+1)+C(p,!1,!1,i,a,r+1)).join(`,
|
|
5
|
-
`)}
|
|
6
|
-
${f.repeat(r)}]`;if(typeof t=="object"){let c=Object.keys(t);return i&&(c=c.sort()),c.length===0?"{}":n?`{${c.map(m=>`${JSON.stringify(m)}:${C(t[m],!0,!1,i,a)}`).join(",")}}`:`{
|
|
7
|
-
${c.map(m=>{let d=C(t[m],!1,!1,i,a,r+1);return`${f.repeat(r+1)}${JSON.stringify(m)}: ${d}`}).join(`,
|
|
8
|
-
`)}
|
|
9
|
-
${f.repeat(r)}}`}return String(t)}var re={name:"jq",async execute(t,n){T(n.requireDefenseContext,"jq","execution entry");let s=(o,e)=>M(n.requireDefenseContext,"jq",o,e);if(L(t))return A(X);let i=!1,a=!1,r=!1,f=!1,c=!1,p=!1,m=!1,d=!1,j=!1,D=".",z=!1,x=[];for(let o=0;o<t.length;o++){let e=t[o];if(e==="-R"||e==="--raw-input")a=!0;else if(e==="-r"||e==="--raw-output")i=!0;else if(e==="-c"||e==="--compact-output")r=!0;else if(e==="-e"||e==="--exit-status")f=!0;else if(e==="-s"||e==="--slurp")c=!0;else if(e==="-n"||e==="--null-input")p=!0;else if(e==="-j"||e==="--join-output")m=!0;else if(!(e==="-a"||e==="--ascii")){if(e==="-S"||e==="--sort-keys")d=!0;else if(!(e==="-C"||e==="--color")){if(!(e==="-M"||e==="--monochrome"))if(e==="--tab")j=!0;else if(e==="-")x.push("-");else{if(e.startsWith("--"))return I("jq",e);if(e.startsWith("-")){for(let l of e.slice(1))if(l==="R")a=!0;else if(l==="r")i=!0;else if(l==="c")r=!0;else if(l==="e")f=!0;else if(l==="s")c=!0;else if(l==="n")p=!0;else if(l==="j")m=!0;else if(l!=="a"){if(l==="S")d=!0;else if(l!=="C"){if(l!=="M")return I("jq",`-${l}`)}}}else z?x.push(e):(D=e,z=!0)}}}}let S=[];if(!p)if(x.length===0||x.length===1&&x[0]==="-")S.push({source:"stdin",content:J(n.stdin)});else{let o=await s("file read",()=>R(n,x,{cmdName:"jq",stopOnError:!0}));if(o.exitCode!==0)return{stdout:"",stderr:o.stderr,exitCode:2};S=o.files.map(e=>({source:e.filename||"stdin",content:J(e.content)}))}try{let o=V(D),e=[],l={limits:n.limits?{maxIterations:n.limits.maxJqIterations}:void 0,env:n.env,coverage:n.coverage,requireDefenseContext:n.requireDefenseContext};if(p)e=w(null,o,l);else if(a&&c){let u=S.map(({content:g})=>g).join("");e=w(u,o,l)}else if(a){let u="";for(let{content:g}of S){let h=u+g,y=0,q=h.indexOf(`
|
|
10
|
-
`,y);for(;q!==-1;)e.push(...w(h.slice(y,q),o,l)),y=q+1,q=h.indexOf(`
|
|
11
|
-
`,y);u=h.slice(y)}u!==""&&e.push(...w(u,o,l))}else if(c){let u=[];for(let{content:g}of S){let h=g.trim();h&&u.push(...B(h))}e=w(u,o,l)}else for(let{content:u}of S){let g=u.trim();if(!g)continue;let h=B(g);for(let y of h)e.push(...w(y,o,l))}let H=e.map(u=>C(u,r,i,d,j)),P=m?"":`
|
|
12
|
-
`,b=H.join(P),$=n.limits?.maxStringLength;if($!==void 0&&$>0&&b.length>$)throw new O(`jq: output size limit exceeded (${$} bytes)`,"string_length");let U=f&&(e.length===0||e.every(u=>u==null||u===!1))?1:0;return{stdout:b?m?b:`${b}
|
|
13
|
-
`:"",stderr:"",exitCode:U}}catch(o){if(o instanceof F)throw o;if(o instanceof O)return{stdout:"",stderr:`jq: ${N(o.message)}
|
|
14
|
-
`,exitCode:O.EXIT_CODE};let e=N(o.message);return e.includes("Unknown function")?{stdout:"",stderr:`jq: error: ${e}
|
|
15
|
-
`,exitCode:3}:{stdout:"",stderr:`jq: parse error: ${e}
|
|
16
|
-
`,exitCode:5}}}},oe={name:"jq",flags:[{flag:"-R",type:"boolean"},{flag:"-r",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-e",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-S",type:"boolean"},{flag:"--tab",type:"boolean"}],stdinType:"json",needsArgs:!0};export{re as a,oe as b};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{f as G}from"./chunk-4WKZNNJK.js";import{a as B,b as U,c as A}from"./chunk-KSBHIW2H.js";import{a as q}from"./chunk-L2UW7DWF.js";import{a as M}from"./chunk-7CSMHFIJ.js";import{c as D}from"./chunk-XEKXHOPO.js";import{a as z,b as E,c as O}from"./chunk-QAYAQNCG.js";var H=G({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:[]}}),$=class{types;constructor(){this.types=new Map(Object.entries(H).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 l=r.slice(8),i=this.types.get(l);if(i){let o=this.types.get(n)||{extensions:[],globs:[]};o.extensions.push(...i.extensions),o.globs.push(...i.globs),this.types.set(n,o)}}else{let l=this.types.get(n)||{extensions:[],globs:[]};if(r.startsWith("*.")&&!r.slice(2).includes("*")){let i=r.slice(1);l.extensions.includes(i)||l.extensions.push(i)}else l.globs.includes(r)||l.globs.push(r);this.types.set(n,l)}}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 l=this.types.get(r);if(l){for(let i of l.extensions)if(n.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let o=i.replace(/\./g,"\\.").replace(/\*/g,".*");if(M(`^${o}$`,"i").test(t))return!0}else if(n===i.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 l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if(M(`^${l}$`,"i").test(t))return!0}else if(s===r.toLowerCase())return!0}return!1}};function V(){let e=[];for(let[t,s]of Object.entries(H).sort()){let n=[];for(let r of s.extensions)n.push(`*${r}`);for(let r of s.globs)n.push(r);e.push(`${t}: ${n.join(", ")}`)}return`${e.join(`
|
|
3
|
-
`)}
|
|
4
|
-
`}function Z(){return{ignoreCase:!1,caseSensitive:!1,smartCase:!0,fixedStrings:!1,wordRegexp:!1,lineRegexp:!1,invertMatch:!1,multiline:!1,multilineDotall:!1,patterns:[],patternFiles:[],count:!1,countMatches:!1,files:!1,filesWithMatches:!1,filesWithoutMatch:!1,stats:!1,onlyMatching:!1,maxCount:0,lineNumber:!0,noFilename:!1,withFilename:!1,nullSeparator:!1,byteOffset:!1,column:!1,vimgrep:!1,replace:null,afterContext:0,beforeContext:0,contextSeparator:"--",quiet:!1,heading:!1,passthru:!1,includeZero:!1,sort:"path",json:!1,globs:[],iglobs:[],globCaseInsensitive:!1,types:[],typesNot:[],typeAdd:[],typeClear:[],hidden:!1,noIgnore:!1,noIgnoreDot:!1,noIgnoreVcs:!1,ignoreFiles:[],maxDepth:256,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function se(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 ne(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
5
|
-
`,exitCode:1}}function J(e){return null}var Y=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:J},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:J},{long:"type-add",target:"typeAdd",multi:!0},{long:"type-clear",target:"typeClear",multi:!0},{short:"m",long:"max-count",target:"maxCount",parse:parseInt},{short:"e",long:"regexp",target:"patterns",multi:!0},{short:"f",long:"file",target:"patternFiles",multi:!0},{short:"r",long:"replace",target:"replace"},{short:"d",long:"max-depth",target:"maxDepth",parse:parseInt},{long:"max-filesize",target:"maxFilesize",parse:se,validate:ne},{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}],re=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}]]),ie=new Set(["n","--line-number"]);function le(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function oe(e,t,s){let n=e[t];for(let r of Y){if(n.startsWith(`--${r.long}=`)){let l=n.slice(`--${r.long}=`.length),i=P(s,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&n.startsWith(`-${r.short}`)&&n.length>2){let l=n.slice(2),i=P(s,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&n===`-${r.short}`||n===`--${r.long}`){if(t+1>=e.length)return null;let l=e[t+1],i=P(s,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function ae(e){return Y.find(t=>t.short===e)}function P(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 ce(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 fe(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 ue(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function K(e){let t=Z(),s=null,n=[],r=-1,l=-1,i=-1,o=!1;for(let c=0;c<e.length;c++){let a=e[c];if(a.startsWith("-")&&a!=="-"){let h=fe(e,c);if(h){let{flag:u,value:w,newIndex:g}=h;u==="A"?r=Math.max(r,w):u==="B"?l=Math.max(l,w):i=w,c=g;continue}let y=ue(a);if(y!==null){t.maxCount=y;continue}let x=oe(e,c,t);if(x){if(x.error)return{success:!1,error:x.error};c=x.newIndex;continue}let p=ce(e,c);if(p){t.sort=p.value,c=p.newIndex;continue}let b=a.startsWith("--")?[a]:a.slice(1).split(""),m=!1;for(let u of b){if(ie.has(u)){t.lineNumber=!0,o=!0;continue}if(u==="u"||u==="--unrestricted"){le(t);continue}if(u==="P"||u==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
6
|
-
`,exitCode:1}};if(u.length===1){let g=ae(u);if(g){if(c+1>=e.length)return{success:!1,error:O("rg",`-${u}`)};let f=P(t,g,e[c+1]);if(f)return{success:!1,error:f};c++,m=!0;continue}}let w=re.get(u);if(w){w(t);continue}if(u.startsWith("--"))return{success:!1,error:O("rg",u)};if(u.length===1)return{success:!1,error:O("rg",`-${u}`)}}}else s===null&&t.patterns.length===0&&t.patternFiles.length===0?s=a:n.push(a)}return(r>=0||i>=0)&&(t.afterContext=Math.max(r>=0?r:0,i>=0?i:0)),(l>=0||i>=0)&&(t.beforeContext=Math.max(l>=0?l:0,i>=0?i:0)),s!==null&&t.patterns.push(s),(t.column||t.vimgrep)&&(o=!0),{success:!0,options:t,paths:n,explicitLineNumbers:o}}import{gunzipSync as he}from"node:zlib";var T=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let s=t.split(`
|
|
7
|
-
`);for(let n of s){let r=n.replace(/\s+$/,"");if(!r||r.startsWith("#"))continue;let l=!1;r.startsWith("!")&&(l=!0,r=r.slice(1));let i=!1;r.endsWith("/")&&(i=!0,r=r.slice(0,-1));let o=!1;r.startsWith("/")?(o=!0,r=r.slice(1)):r.includes("/")&&!r.startsWith("**/")&&(o=!0);let c=this.patternToRegex(r,o);this.patterns.push({pattern:n,regex:c,negated:l,directoryOnly:i,rooted:o})}}patternToRegex(t,s){let n="";s?n="^":n="(?:^|/)";let r=0;for(;r<t.length;){let l=t[r];if(l==="*")t[r+1]==="*"?t[r+2]==="/"?(n+="(?:.*/)?",r+=3):(r+2>=t.length,n+=".*",r+=2):(n+="[^/]*",r++);else if(l==="?")n+="[^/]",r++;else if(l==="["){let i=r+1;for(i<t.length&&t[i]==="!"&&i++,i<t.length&&t[i]==="]"&&i++;i<t.length&&t[i]!=="]";)i++;if(i<t.length){let o=t.slice(r,i+1);o.startsWith("[!")&&(o=`[^${o.slice(2)}`),n+=o,r=i+1}else n+="\\[",r++}else l==="/"?(n+="/",r++):(n+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r++)}return n+="(?:/.*)?$",M(n)}matches(t,s){let n=t.replace(/^\.\//,"");n=n.replace(/^\//,"");let r=!1;for(let l of this.patterns)l.directoryOnly&&!s||l.regex.test(n)&&(r=!l.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}},N=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 l=this.fs.resolvePath(n,"..");if(l===n)break;n=l}let r=[];this.skipVcsIgnore||r.push(".gitignore"),this.skipDotIgnore||r.push(".rgignore",".ignore");for(let l of s){this.loadedDirs.add(l);for(let i of r){let o=this.fs.resolvePath(l,i);try{let c=await this.fs.readFile(o),a=new T(l);a.parse(c),this.parsers.push(a)}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 l=await this.fs.readFile(r),i=new T(t);i.parse(l),this.parsers.push(i)}catch{}}}addPatternsFromContent(t,s){let n=new T(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 l=t.slice(r.length).replace(/^\//,"");if(n.matches(l,s))return!0}return!1}isWhitelisted(t,s){for(let n of this.parsers){let r=n.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(n.isWhitelisted(l,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 l=new N(e,t,s,n);await l.load(t);for(let i of r)try{let o=e.resolvePath(t,i),c=await e.readFile(o);l.addPatternsFromContent(c,t)}catch{}return l}function ge(e){return e.length>=2&&e[0]===31&&e[1]===139}function pe(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}async function X(e){let{ctx:t,options:s,paths:n,explicitLineNumbers:r}=e;for(let g of s.globs){let f=g.startsWith("!")?g.slice(1):g,d=pe(f);if(d)return{stdout:"",stderr:`${d}
|
|
8
|
-
`,exitCode:1}}if(s.files){let g=[...s.patterns,...n];return xe(t,g,s)}let l=[...s.patterns];for(let g of s.patternFiles)try{let f;if(g==="-")f=D(t.stdin);else{let v=t.fs.resolvePath(t.cwd,g);f=await t.fs.readFile(v)}let d=f.split(`
|
|
9
|
-
`).filter(v=>v.length>0);l.push(...d)}catch{return{stdout:"",stderr:`rg: ${g}: No such file or directory
|
|
10
|
-
`,exitCode:2}}if(l.length===0)return s.patternFiles.length>0?{stdout:"",stderr:"",exitCode:1}:{stdout:"",stderr:`rg: no pattern given
|
|
11
|
-
`,exitCode:2};let i=de(s,l),o,c;try{let g=me(l,s,i);o=g.regex,c=g.kResetGroup}catch{return{stdout:"",stderr:`rg: invalid regex: ${l.join(", ")}
|
|
12
|
-
`,exitCode:2}}let a=s.patternFiles.includes("-"),h=D(t.stdin);if(n.length===0&&h.length>0&&!a){let f=B(h,o,{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?A(s.replace):null,passthru:s.passthru,multiline:s.multiline,kResetGroup:c});return s.quiet?{stdout:"",stderr:"",exitCode:f.matched?0:1}:s.filesWithMatches?{stdout:f.matched?`(standard input)
|
|
13
|
-
`:"",stderr:"",exitCode:f.matched?0:1}:s.filesWithoutMatch?{stdout:f.matched?"":`(standard input)
|
|
14
|
-
`,stderr:"",exitCode:f.matched?1:0}:{stdout:f.output,stderr:"",exitCode:f.matched?0:1}}let y=n.length===0?["."]:n,x=null;s.noIgnore||(x=await R(t.fs,t.cwd,s.noIgnoreDot,s.noIgnoreVcs,s.ignoreFiles));let p=new $;for(let g of s.typeClear)p.clearType(g);for(let g of s.typeAdd)p.addType(g);let{files:b,singleExplicitFile:m}=await Q(t,y,s,x,p);if(b.length===0)return{stdout:"",stderr:"",exitCode:1};let u=!s.noFilename&&(s.withFilename||!m||b.length>1),w=s.lineNumber;return r||(m&&b.length===1&&(w=!1),s.onlyMatching&&(w=!1)),we(t,b,o,s,u,w,c)}function de(e,t){return e.caseSensitive?!1:e.ignoreCase?!0:e.smartCase?!t.some(s=>/[A-Z]/.test(s)):!1}function me(e,t,s){let n;return e.length===1?n=e[0]:n=e.map(r=>t.fixedStrings?r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):`(?:${r})`).join("|"),U(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 Q(e,t,s,n,r){let l=[],i=0,o=0;for(let a of t){let h=e.fs.resolvePath(e.cwd,a);try{let y=await e.fs.stat(h);if(y.isFile){if(i++,s.maxFilesize>0&&y.size>s.maxFilesize)continue;te(a,s,n,h,r)&&l.push(a)}else y.isDirectory&&(o++,await ee(e,a,h,0,s,n,r,l))}catch{}}return{files:s.sort==="path"?l.sort():l,singleExplicitFile:i===1&&o===0}}async function ee(e,t,s,n,r,l,i,o){if(!(n>=r.maxDepth)){l&&await l.loadForDirectory(s);try{let c=e.fs.readdirWithFileTypes?await e.fs.readdirWithFileTypes(s):(await e.fs.readdir(s)).map(a=>({name:a,isFile:void 0}));for(let a of c){let h=a.name;if(!r.noIgnore&&N.isCommonIgnored(h))continue;let y=h.startsWith("."),x=t==="."?h:t==="./"?`./${h}`:t.endsWith("/")?`${t}${h}`:`${t}/${h}`,p=e.fs.resolvePath(s,h),b,m,u=!1;if(a.isFile!==void 0&&"isDirectory"in a){let f=a;if(u=f.isSymbolicLink===!0,u&&!r.followSymlinks)continue;if(u&&r.followSymlinks)try{let d=await e.fs.stat(p);b=d.isFile,m=d.isDirectory}catch{continue}else b=f.isFile,m=f.isDirectory}else try{let f=e.fs.lstat?await e.fs.lstat(p):await e.fs.stat(p);if(u=f.isSymbolicLink===!0,u&&!r.followSymlinks)continue;let d=u&&r.followSymlinks?await e.fs.stat(p):f;b=d.isFile,m=d.isDirectory}catch{continue}if(!l?.matches(p,m)&&!(y&&!r.hidden&&!l?.isWhitelisted(p,m))){if(m)await ee(e,x,p,n+1,r,l,i,o);else if(b){if(r.maxFilesize>0)try{if((await e.fs.stat(p)).size>r.maxFilesize)continue}catch{continue}te(x,r,l,p,i)&&o.push(x)}}}}catch{}}}function te(e,t,s,n,r){let l=e.split("/").pop()||e;if(s?.matches(n,!1)||t.types.length>0&&!r.matchesType(l,t.types)||t.typesNot.length>0&&r.matchesType(l,t.typesNot))return!1;if(t.globs.length>0){let i=t.globCaseInsensitive,o=t.globs.filter(a=>!a.startsWith("!")),c=t.globs.filter(a=>a.startsWith("!")).map(a=>a.slice(1));if(o.length>0){let a=!1;for(let h of o)if(C(l,h,i)||C(e,h,i)){a=!0;break}if(!a)return!1}for(let a of c)if(a.startsWith("/")){let h=a.slice(1);if(C(e,h,i))return!1}else if(C(l,a,i)||C(e,a,i))return!1}if(t.iglobs.length>0){let i=t.iglobs.filter(c=>!c.startsWith("!")),o=t.iglobs.filter(c=>c.startsWith("!")).map(c=>c.slice(1));if(i.length>0){let c=!1;for(let a of i)if(C(l,a,!0)||C(e,a,!0)){c=!0;break}if(!c)return!1}for(let c of o)if(c.startsWith("/")){let a=c.slice(1);if(C(e,a,!0))return!1}else if(C(l,c,!0)||C(e,c,!0))return!1}return!0}function C(e,t,s=!1){let n="^";for(let r=0;r<t.length;r++){let l=t[r];if(l==="*")t[r+1]==="*"?(n+=".*",r++):n+="[^/]*";else if(l==="?")n+="[^/]";else if(l==="["){let i=r+1;for(i<t.length&&t[i]==="!"&&i++,i<t.length&&t[i]==="]"&&i++;i<t.length&&t[i]!=="]";)i++;if(i<t.length){let o=t.slice(r,i+1);o.startsWith("[!")&&(o=`[^${o.slice(2)}`),n+=o,r=i}else n+="\\["}else n+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return n+="$",M(n,s?"i":"").test(e)}async function xe(e,t,s){let n=null;s.noIgnore||(n=await R(e.fs,e.cwd,s.noIgnoreDot,s.noIgnoreVcs,s.ignoreFiles));let r=new $;for(let a of s.typeClear)r.clearType(a);for(let a of s.typeAdd)r.addType(a);let l=t.length===0?["."]:t,{files:i}=await Q(e,l,s,n,r);if(i.length===0)return{stdout:"",stderr:"",exitCode:1};if(s.quiet)return{stdout:"",stderr:"",exitCode:0};let o=s.nullSeparator?"\0":`
|
|
15
|
-
`;return{stdout:i.map(a=>a+o).join(""),stderr:"",exitCode:0}}function ye(e,t){if(t.length===0)return!0;for(let s of t)if(C(e,s,!1))return!0;return!1}async function be(e,t,s,n){try{if(n.preprocessor&&e.exec){let i=s.split("/").pop()||s;if(ye(i,n.preprocessorGlobs)){let o=await e.exec(q([n.preprocessor]),{cwd:e.cwd,signal:e.signal,args:[t]});if(o.exitCode===0&&o.stdout){let c=D(o.stdout),a=c.slice(0,8192);return{content:c,isBinary:a.includes("\0")}}}}if(n.searchZip&&s.endsWith(".gz")){let i=await e.fs.readFileBuffer(t);if(ge(i))try{let o=he(i),c=new TextDecoder().decode(o),a=c.slice(0,8192);return{content:c,isBinary:a.includes("\0")}}catch{return null}}let r=await e.fs.readFile(t),l=r.slice(0,8192);return{content:r,isBinary:l.includes("\0")}}catch{return null}}async function we(e,t,s,n,r,l,i){let o="",c=!1,a=[],h=0,y=0,x=0,p=50;e:for(let u=0;u<t.length;u+=p){let w=t.slice(u,u+p),g=await Promise.all(w.map(async f=>{let d=e.fs.resolvePath(e.cwd,f),v=await be(e,d,f,n);if(!v)return null;let{content:F,isBinary:W}=v;if(x+=F.length,W&&!n.searchBinary)return null;let k=r&&!n.heading?f:"",I=B(F,s,{invertMatch:n.invertMatch,showLineNumbers:l,countOnly:n.count,countMatches:n.countMatches,filename:k,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?A(n.replace):null,passthru:n.passthru,multiline:n.multiline,kResetGroup:i});return n.json&&I.matched?{file:f,result:I,content:F,isBinary:!1}:{file:f,result:I}}));for(let f of g){if(!f)continue;let{file:d,result:v}=f;if(v.matched){if(c=!0,y++,h+=v.matchCount,n.quiet&&!n.json)break e;if(n.json&&!n.quiet){let F=f.content||"";a.push(JSON.stringify({type:"begin",data:{path:{text:d}}}));let W=F.split(`
|
|
16
|
-
`);s.lastIndex=0;let k=0;for(let I=0;I<W.length;I++){let j=W[I];s.lastIndex=0;let L=[];for(let S=s.exec(j);S!==null;S=s.exec(j)){let _={match:{text:S[0]},start:S.index,end:S.index+S[0].length};n.replace!==null&&(_.replacement={text:n.replace}),L.push(_),S[0].length===0&&s.lastIndex++}if(L.length>0){let S={type:"match",data:{path:{text:d},lines:{text:`${j}
|
|
17
|
-
`},line_number:I+1,absolute_offset:k,submatches:L}};a.push(JSON.stringify(S))}k+=j.length+1}a.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:F.length,bytes_printed:0,matched_lines:v.matchCount,matches:v.matchCount}}}))}else if(n.filesWithMatches){let F=n.nullSeparator?"\0":`
|
|
18
|
-
`;o+=`${d}${F}`}else n.filesWithoutMatch||(n.heading&&!n.noFilename&&(o+=`${d}
|
|
19
|
-
`),o+=v.output)}else if(n.filesWithoutMatch){let F=n.nullSeparator?"\0":`
|
|
20
|
-
`;o+=`${d}${F}`}else n.includeZero&&(n.count||n.countMatches)&&(o+=v.output)}}n.json&&(a.push(JSON.stringify({type:"summary",data:{elapsed_total:{secs:0,nanos:0,human:"0s"},stats:{elapsed:{secs:0,nanos:0,human:"0s"},searches:t.length,searches_with_match:y,bytes_searched:x,bytes_printed:0,matched_lines:h,matches:h}}})),o=`${a.join(`
|
|
21
|
-
`)}
|
|
22
|
-
`);let b=n.quiet&&!n.json?"":o;if(n.stats&&!n.json){let u=["",`${h} matches`,`${h} matched lines`,`${y} files contained matches`,`${t.length} files searched`,`${x} bytes searched`].join(`
|
|
23
|
-
`);b+=`${u}
|
|
24
|
-
`}let m;return n.filesWithoutMatch?m=o.length>0?0:1:m=c?0:1,{stdout:b,stderr:"",exitCode:m}}var ve={name:"rg",summary:"recursively search for a pattern",usage:"rg [OPTIONS] PATTERN [PATH ...]",description:`rg (ripgrep) recursively searches directories for a regex pattern.
|
|
25
|
-
Unlike grep, rg is recursive by default and respects .gitignore files.
|
|
26
|
-
|
|
27
|
-
EXAMPLES:
|
|
28
|
-
rg foo Search for 'foo' in current directory
|
|
29
|
-
rg foo src/ Search in src/ directory
|
|
30
|
-
rg -i foo Case-insensitive search
|
|
31
|
-
rg -w foo Match whole words only
|
|
32
|
-
rg -t js foo Search only JavaScript files
|
|
33
|
-
rg -g '*.ts' foo Search files matching glob
|
|
34
|
-
rg --hidden foo Include hidden files
|
|
35
|
-
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"]},Ge={name:"rg",async execute(e,t){if(E(e))return z(ve);if(e.includes("--type-list"))return{stdout:V(),stderr:"",exitCode:0};let s=K(e);return s.success?X({ctx:t,options:s.options,paths:s.paths,explicitLineNumbers:s.explicitLineNumbers}):s.error}},qe={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{Ge as a,qe as b};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{b as O}from"./chunk-KTPCYKBB.js";import{c as F}from"./chunk-XEKXHOPO.js";import{a as N,b as w,c as k}from"./chunk-QAYAQNCG.js";var P=new Map([["",1],["k",1024],["m",1048576],["g",1073741824],["t",1099511627776],["p",0x4000000000000],["e",1152921504606847e3]]),D=new Map([["jan",1],["feb",2],["mar",3],["apr",4],["may",5],["jun",6],["jul",7],["aug",8],["sep",9],["oct",10],["nov",11],["dec",12]]);function x(u){let r=u.trim(),e=r.match(/^([+-]?\d*\.?\d+)\s*([kmgtpeKMGTPE])?[iI]?[bB]?$/);if(!e){let n=parseFloat(r);return Number.isNaN(n)?0:n}let l=parseFloat(e[1]),s=(e[2]||"").toLowerCase(),i=P.get(s)??1;return l*i}function M(u){let r=u.trim().toLowerCase().slice(0,3);return D.get(r)??0}function q(u,r){let e=u.split(/(\d+)/),l=r.split(/(\d+)/),s=Math.max(e.length,l.length);for(let i=0;i<s;i++){let n=e[i]||"",d=l[i]||"",o=/^\d+$/.test(n)?parseInt(n,10):null,c=/^\d+$/.test(d)?parseInt(d,10):null;if(o!==null&&c!==null){if(o!==c)return o-c}else if(n!==d)return n.localeCompare(d)}return 0}function L(u){return u.replace(/[^a-zA-Z0-9\s]/g,"")}function v(u,r,e){let l=e!==null?e:/\s+/,s=u.split(l),i=r.startField-1;if(i>=s.length)return"";if(r.endField===void 0){let o=s[i]||"";return r.startChar!==void 0&&(o=o.slice(r.startChar-1)),r.ignoreLeading&&(o=o.trimStart()),o}let n=Math.min(r.endField-1,s.length-1),d="";for(let o=i;o<=n&&o<s.length;o++){let c=s[o]||"";if(o===i&&r.startChar!==void 0&&(c=c.slice(r.startChar-1)),o===n&&r.endChar!==void 0){let t=o===i&&r.startChar!==void 0?r.endChar-r.startChar+1:r.endChar;c=c.slice(0,t)}o>i&&(d+=e||" "),d+=c}return r.ignoreLeading&&(d=d.trimStart()),d}function I(u,r,e){let l=u,s=r;if(e.dictionaryOrder&&(l=L(l),s=L(s)),e.ignoreCase&&(l=l.toLowerCase(),s=s.toLowerCase()),e.monthSort){let i=M(l),n=M(s);return i-n}if(e.humanNumeric){let i=x(l),n=x(s);return i-n}if(e.versionSort)return q(l,s);if(e.numeric){let i=parseFloat(l)||0,n=parseFloat(s)||0;return i-n}return l.localeCompare(s)}function B(u){let{keys:r,fieldDelimiter:e,numeric:l,ignoreCase:s,reverse:i,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c,ignoreLeadingBlanks:t,stable:a}=u;return(f,C)=>{let g=f,b=C;if(t&&(g=g.trimStart(),b=b.trimStart()),r.length===0){let h=I(g,b,{numeric:l,ignoreCase:s,humanNumeric:n,versionSort:d,dictionaryOrder:o,monthSort:c});if(h!==0)return i?-h:h;if(!a){let p=f.localeCompare(C);return i?-p:p}return 0}for(let m of r){let h=v(g,m,e),p=v(b,m,e);m.ignoreLeading&&(h=h.trimStart(),p=p.trimStart());let V={numeric:m.numeric??l,ignoreCase:m.ignoreCase??s,humanNumeric:m.humanNumeric??n,versionSort:m.versionSort??d,dictionaryOrder:m.dictionaryOrder??o,monthSort:m.monthSort??c},A=m.reverse??i,S=I(h,p,V);if(S!==0)return A?-S:S}if(!a){let m=f.localeCompare(C);return i?-m:m}return 0}}function E(u,r){if(r.keys.length===0){if(r.ignoreCase){let s=new Set;return u.filter(i=>{let n=i.toLowerCase();return s.has(n)?!1:(s.add(n),!0)})}return[...new Set(u)]}let e=r.keys[0],l=new Set;return u.filter(s=>{let i=v(s,e,r.fieldDelimiter);return(e.ignoreCase??r.ignoreCase)&&(i=i.toLowerCase()),l.has(i)?!1:(l.add(i),!0)})}function y(u){let r={startField:1},e="",l=u,s=l.match(/([bdfhMnrV]+)$/);s&&(e=s[1],l=l.slice(0,-e.length)),e.includes("n")&&(r.numeric=!0),e.includes("r")&&(r.reverse=!0),e.includes("f")&&(r.ignoreCase=!0),e.includes("b")&&(r.ignoreLeading=!0),e.includes("h")&&(r.humanNumeric=!0),e.includes("V")&&(r.versionSort=!0),e.includes("d")&&(r.dictionaryOrder=!0),e.includes("M")&&(r.monthSort=!0);let i=l.split(",");if(i.length===0||i[0]==="")return null;let n=i[0].split("."),d=parseInt(n[0],10);if(Number.isNaN(d)||d<1)return null;if(r.startField=d,n.length>1&&n[1]){let o=parseInt(n[1],10);!Number.isNaN(o)&&o>=1&&(r.startChar=o)}if(i.length>1&&i[1]){let o=i[1],c=o.match(/([bdfhMnrV]+)$/);if(c){let a=c[1];a.includes("n")&&(r.numeric=!0),a.includes("r")&&(r.reverse=!0),a.includes("f")&&(r.ignoreCase=!0),a.includes("b")&&(r.ignoreLeading=!0),a.includes("h")&&(r.humanNumeric=!0),a.includes("V")&&(r.versionSort=!0),a.includes("d")&&(r.dictionaryOrder=!0),a.includes("M")&&(r.monthSort=!0),o=o.slice(0,-a.length)}let t=o.split(".");if(t[0]){let a=parseInt(t[0],10);if(!Number.isNaN(a)&&a>=1&&(r.endField=a),t.length>1&&t[1]){let f=parseInt(t[1],10);!Number.isNaN(f)&&f>=1&&(r.endChar=f)}}}return r}var H={name:"sort",summary:"sort lines of text files",usage:"sort [OPTION]... [FILE]...",options:["-b, --ignore-leading-blanks ignore leading blanks","-d, --dictionary-order consider only blanks and alphanumeric characters","-f, --ignore-case fold lower case to upper case characters","-h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G)","-M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC'","-n, --numeric-sort compare according to string numerical value","-r, --reverse reverse the result of comparisons","-V, --version-sort natural sort of (version) numbers within text","-c, --check check for sorted input; do not sort","-o, --output=FILE write result to FILE instead of stdout","-s, --stable stabilize sort by disabling last-resort comparison","-u, --unique output only unique lines","-k, --key=KEYDEF sort via a key; KEYDEF gives location and type","-t, --field-separator=SEP use SEP as field separator"," --help display this help and exit"],description:`KEYDEF is F[.C][OPTS][,F[.C][OPTS]]
|
|
3
|
-
F is a field number (1-indexed)
|
|
4
|
-
C is a character position within the field (1-indexed)
|
|
5
|
-
OPTS can be: b d f h M n r V (per-key modifiers)
|
|
6
|
-
|
|
7
|
-
Examples:
|
|
8
|
-
-k1 sort by first field
|
|
9
|
-
-k2,2 sort by second field only
|
|
10
|
-
-k1.3 sort by first field starting at 3rd character
|
|
11
|
-
-k1,2n sort by fields 1-2 numerically
|
|
12
|
-
-k2 -k1 sort by field 2, then by field 1`},R={name:"sort",async execute(u,r){if(w(u))return N(H);let e={reverse:!1,numeric:!1,unique:!1,ignoreCase:!1,humanNumeric:!1,versionSort:!1,dictionaryOrder:!1,monthSort:!1,ignoreLeadingBlanks:!1,stable:!1,checkOnly:!1,outputFile:null,keys:[],fieldDelimiter:null},l=[];for(let c=0;c<u.length;c++){let t=u[c];if(t==="-r"||t==="--reverse")e.reverse=!0;else if(t==="-n"||t==="--numeric-sort")e.numeric=!0;else if(t==="-u"||t==="--unique")e.unique=!0;else if(t==="-f"||t==="--ignore-case")e.ignoreCase=!0;else if(t==="-h"||t==="--human-numeric-sort")e.humanNumeric=!0;else if(t==="-V"||t==="--version-sort")e.versionSort=!0;else if(t==="-d"||t==="--dictionary-order")e.dictionaryOrder=!0;else if(t==="-M"||t==="--month-sort")e.monthSort=!0;else if(t==="-b"||t==="--ignore-leading-blanks")e.ignoreLeadingBlanks=!0;else if(t==="-s"||t==="--stable")e.stable=!0;else if(t==="-c"||t==="--check")e.checkOnly=!0;else if(t==="-o"||t==="--output")e.outputFile=u[++c]||null;else if(t.startsWith("-o"))e.outputFile=t.slice(2)||null;else if(t.startsWith("--output="))e.outputFile=t.slice(9)||null;else if(t==="-t"||t==="--field-separator")e.fieldDelimiter=u[++c]||null;else if(t.startsWith("-t"))e.fieldDelimiter=t.slice(2)||null;else if(t.startsWith("--field-separator="))e.fieldDelimiter=t.slice(18)||null;else if(t==="-k"||t==="--key"){let a=u[++c];if(a){let f=y(a);f&&e.keys.push(f)}}else if(t.startsWith("-k")){let a=y(t.slice(2));a&&e.keys.push(a)}else if(t.startsWith("--key=")){let a=y(t.slice(6));a&&e.keys.push(a)}else{if(t.startsWith("--"))return k("sort",t);if(t.startsWith("-")&&!t.startsWith("--")){let a=!1;for(let f of t.slice(1))if(f==="r")e.reverse=!0;else if(f==="n")e.numeric=!0;else if(f==="u")e.unique=!0;else if(f==="f")e.ignoreCase=!0;else if(f==="h")e.humanNumeric=!0;else if(f==="V")e.versionSort=!0;else if(f==="d")e.dictionaryOrder=!0;else if(f==="M")e.monthSort=!0;else if(f==="b")e.ignoreLeadingBlanks=!0;else if(f==="s")e.stable=!0;else if(f==="c")e.checkOnly=!0;else{a=!0;break}if(a)return k("sort",t)}else l.push(t)}}let s=await O(r,l,{cmdName:"sort"});if(!s.ok)return s.error;let n=F(s.content).split(`
|
|
13
|
-
`);n.length>0&&n[n.length-1]===""&&n.pop();let d=B(e);if(e.checkOnly){let c=l.length>0?l[0]:"-";for(let t=1;t<n.length;t++)if(d(n[t-1],n[t])>0)return{stdout:"",stderr:`sort: ${c}:${t+1}: disorder: ${n[t]}
|
|
14
|
-
`,exitCode:1};return{stdout:"",stderr:"",exitCode:0}}n.sort(d),e.unique&&(n=E(n,e));let o=n.length>0?`${n.join(`
|
|
15
|
-
`)}
|
|
16
|
-
`:"";if(e.outputFile){let c=r.fs.resolvePath(r.cwd,e.outputFile);return await r.fs.writeFile(c,o),{stdout:"",stderr:"",exitCode:0}}return{stdout:o,stderr:"",exitCode:0}}},Y={name:"sort",flags:[{flag:"-r",type:"boolean"},{flag:"-n",type:"boolean"},{flag:"-u",type:"boolean"},{flag:"-f",type:"boolean"},{flag:"-h",type:"boolean"},{flag:"-V",type:"boolean"},{flag:"-d",type:"boolean"},{flag:"-M",type:"boolean"},{flag:"-b",type:"boolean"},{flag:"-s",type:"boolean"},{flag:"-c",type:"boolean"},{flag:"-k",type:"value",valueHint:"string"},{flag:"-t",type:"value",valueHint:"delimiter"},{flag:"-o",type:"value",valueHint:"path"}],stdinType:"text",needsFiles:!0};export{R as a,Y as b};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{c as g}from"./chunk-XEKXHOPO.js";import{a as y,b as $,c as F}from"./chunk-QAYAQNCG.js";var b={name:"comm",summary:"compare two sorted files line by line",usage:"comm [OPTION]... FILE1 FILE2",options:["-1 suppress column 1 (lines unique to FILE1)","-2 suppress column 2 (lines unique to FILE2)","-3 suppress column 3 (lines that appear in both files)"," --help display this help and exit"]},E={name:"comm",async execute(m,a){if($(m))return y(b);let r=!1,l=!1,f=!1,i=[];for(let e of m)if(e==="-1")r=!0;else if(e==="-2")l=!0;else if(e==="-3")f=!0;else if(e==="-12"||e==="-21")r=!0,l=!0;else if(e==="-13"||e==="-31")r=!0,f=!0;else if(e==="-23"||e==="-32")l=!0,f=!0;else if(e==="-123"||e==="-132"||e==="-213"||e==="-231"||e==="-312"||e==="-321")r=!0,l=!0,f=!0;else{if(e.startsWith("-")&&e!=="-")return F("comm",e);i.push(e)}if(i.length!==2)return{stdout:"",stderr:`comm: missing operand
|
|
3
|
-
Try 'comm --help' for more information.
|
|
4
|
-
`,exitCode:1};let p=async e=>{if(e==="-")return g(a.stdin);try{let x=a.fs.resolvePath(a.cwd,e);return await a.fs.readFile(x)}catch{return null}},c=await p(i[0]);if(c===null)return{stdout:"",stderr:`comm: ${i[0]}: No such file or directory
|
|
5
|
-
`,exitCode:1};let d=await p(i[1]);if(d===null)return{stdout:"",stderr:`comm: ${i[1]}: No such file or directory
|
|
6
|
-
`,exitCode:1};let t=c.split(`
|
|
7
|
-
`),s=d.split(`
|
|
8
|
-
`);t.length>0&&t[t.length-1]===""&&t.pop(),s.length>0&&s[s.length-1]===""&&s.pop();let n=0,o=0,u="",h=r?"":" ",w=(r?"":" ")+(l?"":" ");for(;n<t.length||o<s.length;)n>=t.length?(l||(u+=`${h}${s[o]}
|
|
9
|
-
`),o++):o>=s.length?(r||(u+=`${t[n]}
|
|
10
|
-
`),n++):t[n]<s[o]?(r||(u+=`${t[n]}
|
|
11
|
-
`),n++):t[n]>s[o]?(l||(u+=`${h}${s[o]}
|
|
12
|
-
`),o++):(f||(u+=`${w}${t[n]}
|
|
13
|
-
`),n++,o++);return{stdout:u,stderr:"",exitCode:0}}},L={name:"comm",flags:[{flag:"-1",type:"boolean"},{flag:"-2",type:"boolean"},{flag:"-3",type:"boolean"}],needsArgs:!0,minArgs:2};export{E as a,L as b};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
2
|
-
import{a as s,b as i}from"./chunk-VACKIICN.js";function a(t,e,n){if(!t||i.isInSandboxedContext())return;let r=`${e} ${n} attempted outside defense context`;throw new s(r,{timestamp:Date.now(),type:"missing_defense_context",message:r,path:"DefenseInDepthBox.context",stack:new Error().stack,executionId:i.getCurrentExecutionId()})}async function x(t,e,n,r){a(t,e,`${n} (pre-await)`);let o=await r();return a(t,e,`${n} (post-await)`),o}function d(t,e,n,r){let o=((...c)=>(a(t,e,n),r(...c)));return t?i.bindCurrentContext(o):o}export{a,x as b,d as c};
|