just-bash 2.14.2 → 2.14.4
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 +21 -0
- package/dist/bin/chunks/{awk2-VTJMI54B.js → awk2-RSUCURL4.js} +1 -1
- package/dist/bin/chunks/{chunk-L2JBII6Z.js → chunk-2HVFB2TU.js} +72 -72
- package/dist/bin/{shell/chunks/chunk-ZO5PSLKR.js → chunks/chunk-ARI4VLCN.js} +1 -1
- package/dist/bin/chunks/chunk-AX6NCIX6.js +140 -0
- package/dist/bin/{shell/chunks/chunk-NLBRLRWD.js → chunks/chunk-BGGF3ELU.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-VHUYNUT7.js → chunks/chunk-DU4S5MUI.js} +1 -1
- package/dist/bin/chunks/chunk-EFPTD2CS.js +36 -0
- package/dist/bin/chunks/{chunk-SXB55JOI.js → chunk-EONWONZV.js} +1 -1
- package/dist/bin/chunks/{chunk-SDLWFYVT.js → chunk-EWDHVLQL.js} +11 -11
- package/dist/bin/{shell/chunks/chunk-SE4C7FJY.js → chunks/chunk-JDNI5HBX.js} +13 -13
- package/dist/bin/chunks/chunk-KCMUAACL.js +19 -0
- package/dist/bin/{shell/chunks/chunk-XKPFI566.js → chunks/chunk-L6XUBS6H.js} +17 -17
- package/dist/bin/{shell/chunks/chunk-A3HQTYHR.js → chunks/chunk-OXHVTSNH.js} +1 -1
- package/dist/bin/{shell/chunks/chunk-RMQC3GS7.js → chunks/chunk-PNI5NMXP.js} +1 -1
- package/dist/bin/chunks/chunk-PXVBSPBE.js +2 -0
- package/dist/bin/{shell/chunks/chunk-YFPDB4PH.js → chunks/chunk-RA3TG4UK.js} +1 -1
- package/dist/bin/chunks/{chunk-GZHFXDDO.js → chunk-RBQGQWGV.js} +1 -1
- package/dist/bin/chunks/{chunk-THNL3XFF.js → chunk-S3QAKT3R.js} +1 -1
- package/dist/bin/chunks/{chunk-G43H2WGH.js → chunk-TTNNO45C.js} +1 -1
- package/dist/bin/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/bin/chunks/chunk-WLBA7L7U.js +23 -0
- package/dist/bin/chunks/{chunk-HJEHIH4P.js → chunk-WUYP7DID.js} +2 -2
- package/dist/bin/chunks/chunk-ZUDPEMHG.js +63 -0
- package/dist/bin/chunks/{diff-LE7GMFZD.js → diff-5NUI5BHG.js} +1 -1
- package/dist/bin/{shell/chunks/expansion-2RO5M3QC.js → chunks/expansion-QUT3FT7V.js} +1 -1
- package/dist/bin/{shell/chunks/expr-4CJYC4LY.js → chunks/expr-G4EF4POQ.js} +1 -1
- package/dist/bin/{shell/chunks/file-D5YKS5NV.js → chunks/file-MMSHRWCJ.js} +1 -1
- package/dist/bin/chunks/find-7CVMEZBO.js +2 -0
- package/dist/bin/{shell/chunks/flag-coverage-NSXW5TJP.js → chunks/flag-coverage-IK7WVGOO.js} +1 -1
- package/dist/bin/chunks/{grep-OZJTRD4D.js → grep-7BJ7HFBM.js} +1 -1
- package/dist/bin/chunks/{html-to-markdown-WVZA3MCP.js → html-to-markdown-V6PK6S5U.js} +1 -1
- package/dist/bin/{shell/chunks/jq-FIV5Q5T4.js → chunks/jq-DVZM2CEN.js} +1 -1
- package/dist/bin/{shell/chunks/js-exec-DYEFS64P.js → chunks/js-exec-RWEELTC2.js} +4 -4
- package/dist/bin/chunks/js-exec-worker.js +3 -2
- package/dist/bin/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
- package/dist/bin/chunks/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
- package/dist/bin/chunks/{python3-3423HR2R.js → python3-V2HDKCNM.js} +2 -2
- package/dist/bin/chunks/rg-LA2FQFMS.js +2 -0
- package/dist/bin/chunks/{sed-HALRQZKY.js → sed-WWXBUNG3.js} +1 -1
- package/dist/bin/chunks/{sqlite3-CVNFMP3Z.js → sqlite3-JPU62KSL.js} +1 -1
- package/dist/bin/chunks/sqlite3-worker.js +1728 -0
- package/dist/bin/chunks/tar-GTGFEWDS.js +2 -0
- package/dist/bin/chunks/worker.js +1 -0
- package/dist/bin/chunks/{xan-MOZFJGMY.js → xan-MM3YYGD7.js} +1 -1
- package/dist/bin/chunks/xan-view-6J5MMMQB.js +2 -0
- package/dist/bin/chunks/{yq-Q47JUWL6.js → yq-CWUVVSHY.js} +1 -1
- package/dist/bin/just-bash.js +238 -238
- package/dist/bin/shell/chunks/{awk2-VTJMI54B.js → awk2-RSUCURL4.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-L2JBII6Z.js → chunk-2HVFB2TU.js} +72 -72
- package/dist/bin/{chunks/chunk-ZO5PSLKR.js → shell/chunks/chunk-ARI4VLCN.js} +1 -1
- package/dist/bin/shell/chunks/chunk-AX6NCIX6.js +140 -0
- package/dist/bin/{chunks/chunk-NLBRLRWD.js → shell/chunks/chunk-BGGF3ELU.js} +1 -1
- package/dist/bin/{chunks/chunk-VHUYNUT7.js → shell/chunks/chunk-DU4S5MUI.js} +1 -1
- package/dist/bin/shell/chunks/chunk-EFPTD2CS.js +36 -0
- package/dist/bin/shell/chunks/{chunk-SXB55JOI.js → chunk-EONWONZV.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-SDLWFYVT.js → chunk-EWDHVLQL.js} +11 -11
- package/dist/bin/shell/chunks/chunk-HC7WB764.js +2 -0
- package/dist/bin/{chunks/chunk-SE4C7FJY.js → shell/chunks/chunk-JDNI5HBX.js} +13 -13
- package/dist/bin/shell/chunks/chunk-KCMUAACL.js +19 -0
- package/dist/bin/{chunks/chunk-XKPFI566.js → shell/chunks/chunk-L6XUBS6H.js} +17 -17
- package/dist/bin/{chunks/chunk-A3HQTYHR.js → shell/chunks/chunk-OXHVTSNH.js} +1 -1
- package/dist/bin/{chunks/chunk-RMQC3GS7.js → shell/chunks/chunk-PNI5NMXP.js} +1 -1
- package/dist/bin/{chunks/chunk-YFPDB4PH.js → shell/chunks/chunk-RA3TG4UK.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-GZHFXDDO.js → chunk-RBQGQWGV.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-THNL3XFF.js → chunk-S3QAKT3R.js} +1 -1
- package/dist/bin/shell/chunks/{chunk-G43H2WGH.js → chunk-TTNNO45C.js} +1 -1
- package/dist/bin/shell/chunks/chunk-UFJFAFSS.js +28 -0
- package/dist/bin/shell/chunks/chunk-WLBA7L7U.js +23 -0
- package/dist/bin/shell/chunks/{chunk-HJEHIH4P.js → chunk-WUYP7DID.js} +2 -2
- package/dist/bin/shell/chunks/chunk-ZUDPEMHG.js +63 -0
- package/dist/bin/shell/chunks/{diff-LE7GMFZD.js → diff-5NUI5BHG.js} +1 -1
- package/dist/bin/{chunks/expansion-2RO5M3QC.js → shell/chunks/expansion-QUT3FT7V.js} +1 -1
- package/dist/bin/{chunks/expr-4CJYC4LY.js → shell/chunks/expr-G4EF4POQ.js} +1 -1
- package/dist/bin/{chunks/file-D5YKS5NV.js → shell/chunks/file-MMSHRWCJ.js} +1 -1
- package/dist/bin/shell/chunks/find-7CVMEZBO.js +2 -0
- package/dist/bin/{chunks/flag-coverage-NSXW5TJP.js → shell/chunks/flag-coverage-IK7WVGOO.js} +1 -1
- package/dist/bin/shell/chunks/{grep-OZJTRD4D.js → grep-7BJ7HFBM.js} +1 -1
- package/dist/bin/shell/chunks/{html-to-markdown-WVZA3MCP.js → html-to-markdown-V6PK6S5U.js} +1 -1
- package/dist/bin/{chunks/jq-FIV5Q5T4.js → shell/chunks/jq-DVZM2CEN.js} +1 -1
- package/dist/bin/{chunks/js-exec-CAD5RWEY.js → shell/chunks/js-exec-AKWY6BP5.js} +4 -4
- package/dist/bin/shell/chunks/{ls-G2PXHSNX.js → ls-WONXDVOX.js} +1 -1
- package/dist/bin/shell/chunks/{printf-P3QVL4IO.js → printf-NA7DYZBO.js} +1 -1
- package/dist/bin/shell/chunks/{python3-D3QLNTTN.js → python3-TG6BXZCZ.js} +2 -2
- package/dist/bin/shell/chunks/rg-LA2FQFMS.js +2 -0
- package/dist/bin/shell/chunks/{sed-HALRQZKY.js → sed-WWXBUNG3.js} +1 -1
- package/dist/bin/shell/chunks/{sqlite3-CVNFMP3Z.js → sqlite3-JPU62KSL.js} +1 -1
- package/dist/bin/shell/chunks/tar-GTGFEWDS.js +2 -0
- package/dist/bin/shell/chunks/{xan-MOZFJGMY.js → xan-MM3YYGD7.js} +1 -1
- package/dist/bin/shell/chunks/xan-view-6J5MMMQB.js +2 -0
- package/dist/bin/shell/chunks/{yq-Q47JUWL6.js → yq-CWUVVSHY.js} +1 -1
- package/dist/bin/shell/shell.js +225 -225
- package/dist/bundle/browser.js +603 -603
- package/dist/bundle/chunks/{awk2-POPGKRAI.js → awk2-JFGEGLFP.js} +1 -1
- package/dist/bundle/chunks/{chunk-FEIOJCZD.js → chunk-43RSSTFA.js} +1 -1
- package/dist/bundle/chunks/chunk-5KI4QWT5.js +139 -0
- package/dist/bundle/chunks/{chunk-YFG2CMIF.js → chunk-5PYKJV42.js} +1 -1
- package/dist/bundle/chunks/{chunk-XORM457F.js → chunk-75FNCC7W.js} +72 -72
- package/dist/bundle/chunks/{chunk-YS3AZT3J.js → chunk-B53Y5JFV.js} +1 -1
- package/dist/bundle/chunks/{chunk-J642UCRS.js → chunk-BAQA74XA.js} +1 -1
- package/dist/bundle/chunks/{chunk-OARHFVLG.js → chunk-D6EWIDSU.js} +11 -11
- package/dist/bundle/chunks/{chunk-F55TLFGB.js → chunk-DBKNVD4L.js} +1 -1
- package/dist/bundle/chunks/{chunk-LPQPILI2.js → chunk-GJTDUJ5Q.js} +1 -1
- package/dist/bundle/chunks/chunk-HL6NGDO2.js +22 -0
- package/dist/bundle/chunks/chunk-KX3P26DQ.js +1 -0
- package/dist/bundle/chunks/{chunk-NYQYO467.js → chunk-MIMEPCXY.js} +2 -2
- package/dist/bundle/chunks/{chunk-BBXLRYSX.js → chunk-NRZWEENR.js} +1 -1
- package/dist/bundle/chunks/{chunk-VLGZJRPG.js → chunk-PYDZ2LCK.js} +1 -1
- package/dist/bundle/chunks/{chunk-YCFVLTST.js → chunk-RQ254MFG.js} +1 -1
- package/dist/bundle/chunks/{chunk-OL3S66CO.js → chunk-VBEY5J6R.js} +1 -1
- package/dist/bundle/chunks/chunk-XIZSGUXJ.js +62 -0
- package/dist/bundle/chunks/chunk-XKWWSDBF.js +35 -0
- package/dist/bundle/chunks/{chunk-YNYSPYQ5.js → chunk-YSHZL3MF.js} +13 -13
- package/dist/bundle/chunks/{expansion-ENLSRCXJ.js → expansion-UGGADTZC.js} +1 -1
- package/dist/bundle/chunks/{expr-5T3UU5KE.js → expr-DNFUYZGY.js} +1 -1
- package/dist/bundle/chunks/{file-ZIGAJ4YS.js → file-IGDTDPLG.js} +1 -1
- package/dist/bundle/chunks/find-KNMMLVJD.js +1 -0
- package/dist/bundle/chunks/{flag-coverage-QT4N2Z44.js → flag-coverage-QFOIESUP.js} +1 -1
- package/dist/bundle/chunks/{grep-3AIAIJVR.js → grep-2UMHPO7Y.js} +1 -1
- package/dist/bundle/chunks/{jq-ODXZBPLY.js → jq-LCDWFF5Y.js} +1 -1
- package/dist/bundle/chunks/{js-exec-M6UR76J5.js → js-exec-VXN6TZ7U.js} +4 -4
- package/dist/bundle/chunks/js-exec-worker.js +3 -2
- package/dist/bundle/chunks/{python3-AUFTPCU6.js → python3-DNGS4G3E.js} +2 -2
- package/dist/bundle/chunks/rg-RYV2N6B5.js +1 -0
- package/dist/bundle/chunks/{sed-VFTTATXJ.js → sed-OFX3F4FE.js} +1 -1
- package/dist/bundle/chunks/{sqlite3-56UMWEY3.js → sqlite3-TE5AIOTF.js} +1 -1
- package/dist/bundle/chunks/sqlite3-worker.js +1728 -0
- package/dist/bundle/chunks/tar-LYLTEJV3.js +1 -0
- package/dist/bundle/chunks/worker.js +1 -0
- package/dist/bundle/chunks/{xan-BXDXYEIB.js → xan-X2BIJPJV.js} +1 -1
- package/dist/bundle/chunks/xan-view-OW2TB7Z3.js +1 -0
- package/dist/bundle/chunks/{yq-MJMAR36V.js → yq-M7NFNNED.js} +1 -1
- package/dist/bundle/index.cjs +807 -807
- package/dist/bundle/index.js +174 -174
- package/dist/commands/js-exec/{worker.d.ts → js-exec-worker.d.ts} +2 -2
- package/dist/commands/sqlite3/sqlite3.d.ts +1 -0
- package/dist/commands/sqlite3/worker.js +1728 -0
- package/dist/network/dns-pin.d.ts +43 -0
- package/package.json +8 -9
- package/dist/bin/chunks/chunk-B3RU2PUI.js +0 -140
- package/dist/bin/chunks/chunk-CM4532DS.js +0 -36
- package/dist/bin/chunks/chunk-MXVNCVD6.js +0 -30
- package/dist/bin/chunks/chunk-MY5PY2PL.js +0 -2
- package/dist/bin/chunks/chunk-N5OTVT4F.js +0 -23
- package/dist/bin/chunks/chunk-P6GNZPVW.js +0 -19
- package/dist/bin/chunks/chunk-VRUXUVWB.js +0 -63
- package/dist/bin/chunks/find-GAYRV4IF.js +0 -2
- package/dist/bin/chunks/rg-C6KMBFNG.js +0 -2
- package/dist/bin/chunks/tar-DNUNEW4Z.js +0 -2
- package/dist/bin/chunks/xan-view-5SZBYPLG.js +0 -2
- package/dist/bin/shell/chunks/chunk-B3RU2PUI.js +0 -140
- package/dist/bin/shell/chunks/chunk-CM4532DS.js +0 -36
- package/dist/bin/shell/chunks/chunk-D64U2VGQ.js +0 -2
- package/dist/bin/shell/chunks/chunk-MXVNCVD6.js +0 -30
- package/dist/bin/shell/chunks/chunk-N5OTVT4F.js +0 -23
- package/dist/bin/shell/chunks/chunk-P6GNZPVW.js +0 -19
- package/dist/bin/shell/chunks/chunk-VRUXUVWB.js +0 -63
- package/dist/bin/shell/chunks/find-GAYRV4IF.js +0 -2
- package/dist/bin/shell/chunks/rg-C6KMBFNG.js +0 -2
- package/dist/bin/shell/chunks/tar-DNUNEW4Z.js +0 -2
- package/dist/bin/shell/chunks/xan-view-5SZBYPLG.js +0 -2
- package/dist/bundle/chunks/chunk-BRGMQKJV.js +0 -62
- package/dist/bundle/chunks/chunk-CR5AFCPT.js +0 -22
- package/dist/bundle/chunks/chunk-HWBSOZZR.js +0 -35
- package/dist/bundle/chunks/chunk-UNYNJIFU.js +0 -139
- package/dist/bundle/chunks/chunk-XHM67O4N.js +0 -1
- package/dist/bundle/chunks/find-TPUOAIUQ.js +0 -1
- package/dist/bundle/chunks/rg-FOQSCCX3.js +0 -1
- package/dist/bundle/chunks/tar-ANUBEFJY.js +0 -1
- package/dist/bundle/chunks/xan-view-ECQUO7AJ.js +0 -1
- /package/dist/bin/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
- /package/dist/bin/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
- /package/dist/bin/shell/chunks/{chunk-QSDVMMYI.js → chunk-4CFAYBLV.js} +0 -0
- /package/dist/bin/shell/chunks/{chunk-ND23BJUM.js → chunk-LCDPWJBA.js} +0 -0
- /package/dist/bundle/chunks/{chunk-SYMJJMQ4.js → chunk-PXTK5WE2.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{f as G}from"./chunk-V7ZOPVQS.js";import{a as U}from"./chunk-4OALHZXB.js";import{a as z,b as B,c as E}from"./chunk-
|
|
2
|
+
import{f as G}from"./chunk-V7ZOPVQS.js";import{a as U}from"./chunk-4OALHZXB.js";import{a as z,b as B,c as E}from"./chunk-TTNNO45C.js";import{a as $}from"./chunk-JDNI5HBX.js";import{a as R,b as _,c as D}from"./chunk-GTNBSMZR.js";var q=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:[]}}),M=class{types;constructor(){this.types=new Map(Object.entries(q).map(([t,n])=>[t,{extensions:[...n.extensions],globs:[...n.globs]}]))}addType(t){let n=t.indexOf(":");if(n===-1)return;let s=t.slice(0,n),r=t.slice(n+1);if(r.startsWith("include:")){let l=r.slice(8),i=this.types.get(l);if(i){let o=this.types.get(s)||{extensions:[],globs:[]};o.extensions.push(...i.extensions),o.globs.push(...i.globs),this.types.set(s,o)}}else{let l=this.types.get(s)||{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(s,l)}}clearType(t){let n=this.types.get(t);n&&(n.extensions=[],n.globs=[])}getType(t){return this.types.get(t)}getAllTypes(){return this.types}matchesType(t,n){let s=t.toLowerCase();for(let r of n){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(s.endsWith(i))return!0;for(let i of l.globs)if(i.includes("*")){let o=i.replace(/\./g,"\\.").replace(/\*/g,".*");if($(`^${o}$`,"i").test(t))return!0}else if(s===i.toLowerCase())return!0}}return!1}matchesAnyType(t){let n=t.toLowerCase();for(let s of this.types.values()){for(let r of s.extensions)if(n.endsWith(r))return!0;for(let r of s.globs)if(r.includes("*")){let l=r.replace(/\./g,"\\.").replace(/\*/g,".*");if($(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function H(){let e=[];for(let[t,n]of Object.entries(q).sort()){let s=[];for(let r of n.extensions)s.push(`*${r}`);for(let r of n.globs)s.push(r);e.push(`${t}: ${s.join(", ")}`)}return`${e.join(`
|
|
3
3
|
`)}
|
|
4
4
|
`}function V(){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 te(e){let t=e.match(/^(\d+)([KMG])?$/i);if(!t)return 0;let n=parseInt(t[1],10);switch((t[2]||"").toUpperCase()){case"K":return n*1024;case"M":return n*1024*1024;case"G":return n*1024*1024*1024;default:return n}}function se(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
|
|
5
|
-
`,exitCode:1}}function Z(e){return null}var J=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:Z},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:Z},{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:te,validate:se},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",
|
|
5
|
+
`,exitCode:1}}function Z(e){return null}var J=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:Z},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:Z},{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:te,validate:se},{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}],ne=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}]]),re=new Set(["n","--line-number"]);function ie(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function le(e,t,n){let s=e[t];for(let r of J){if(s.startsWith(`--${r.long}=`)){let l=s.slice(`--${r.long}=`.length),i=P(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s.startsWith(`-${r.short}`)&&s.length>2){let l=s.slice(2),i=P(n,r,l);return i?{newIndex:t,error:i}:{newIndex:t}}if(r.short&&s===`-${r.short}`||s===`--${r.long}`){if(t+1>=e.length)return null;let l=e[t+1],i=P(n,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function oe(e){return J.find(t=>t.short===e)}function P(e,t,n){if(t.validate){let r=t.validate(n);if(r)return r}if(t.ignored||!t.target)return;let s=t.parse?t.parse(n):n;t.multi?e[t.target].push(s):e[t.target]=s}function ae(e,t){let n=e[t];if(n==="--sort"&&t+1<e.length){let s=e[t+1];if(s==="path"||s==="none")return{value:s,newIndex:t+1}}if(n.startsWith("--sort=")){let s=n.slice(7);if(s==="path"||s==="none")return{value:s,newIndex:t}}return null}function ce(e,t){let n=e[t],s=n.match(/^-([ABC])(\d+)$/);return s?{flag:s[1],value:parseInt(s[2],10),newIndex:t}:(n==="-A"||n==="-B"||n==="-C")&&t+1<e.length?{flag:n[1],value:parseInt(e[t+1],10),newIndex:t+1}:null}function fe(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function Y(e){let t=V(),n=null,s=[],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 u=ce(e,c);if(u){let{flag:f,value:x,newIndex:b}=u;f==="A"?r=Math.max(r,x):f==="B"?l=Math.max(l,x):i=x,c=b;continue}let d=fe(a);if(d!==null){t.maxCount=d;continue}let p=le(e,c,t);if(p){if(p.error)return{success:!1,error:p.error};c=p.newIndex;continue}let g=ae(e,c);if(g){t.sort=g.value,c=g.newIndex;continue}let w=a.startsWith("--")?[a]:a.slice(1).split(""),m=!1;for(let f of w){if(re.has(f)){t.lineNumber=!0,o=!0;continue}if(f==="u"||f==="--unrestricted"){ie(t);continue}if(f==="P"||f==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
|
|
6
6
|
`,exitCode:1}};if(f.length===1){let b=oe(f);if(b){if(c+1>=e.length)return{success:!1,error:D("rg",`-${f}`)};let h=P(t,b,e[c+1]);if(h)return{success:!1,error:h};c++,m=!0;continue}}let x=ne.get(f);if(x){x(t);continue}if(f.startsWith("--"))return{success:!1,error:D("rg",f)};if(f.length===1)return{success:!1,error:D("rg",`-${f}`)}}}else n===null&&t.patterns.length===0&&t.patternFiles.length===0?n=a:s.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)),n!==null&&t.patterns.push(n),(t.column||t.vimgrep)&&(o=!0),{success:!0,options:t,paths:s,explicitLineNumbers:o}}import{gunzipSync as ue}from"node:zlib";var T=class{patterns=[];basePath;constructor(t="/"){this.basePath=t}parse(t){let n=t.split(`
|
|
7
7
|
`);for(let s of n){let r=s.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:s,regex:c,negated:l,directoryOnly:i,rooted:o})}}patternToRegex(t,n){let s="";n?s="^":s="(?:^|/)";let r=0;for(;r<t.length;){let l=t[r];if(l==="*")t[r+1]==="*"?t[r+2]==="/"?(s+="(?:.*/)?",r+=3):(r+2>=t.length,s+=".*",r+=2):(s+="[^/]*",r++);else if(l==="?")s+="[^/]",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)}`),s+=o,r=i+1}else s+="\\[",r++}else l==="/"?(s+="/",r++):(s+=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r++)}return s+="(?:/.*)?$",$(s)}matches(t,n){let s=t.replace(/^\.\//,"");s=s.replace(/^\//,"");let r=!1;for(let l of this.patterns)l.directoryOnly&&!n||l.regex.test(s)&&(r=!l.negated);return r}isWhitelisted(t,n){let s=t.replace(/^\.\//,"");s=s.replace(/^\//,"");for(let r of this.patterns)if(!(r.directoryOnly&&!n)&&r.negated&&r.regex.test(s))return!0;return!1}getBasePath(){return this.basePath}},k=class{parsers=[];fs;skipDotIgnore;skipVcsIgnore;loadedDirs=new Set;constructor(t,n,s=!1,r=!1){this.fs=t,this.skipDotIgnore=s,this.skipVcsIgnore=r}async load(t){let n=[],s=t;for(;;){n.unshift(s);let l=this.fs.resolvePath(s,"..");if(l===s)break;s=l}let r=[];this.skipVcsIgnore||r.push(".gitignore"),this.skipDotIgnore||r.push(".rgignore",".ignore");for(let l of n){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 n=[];this.skipVcsIgnore||n.push(".gitignore"),this.skipDotIgnore||n.push(".rgignore",".ignore");for(let s of n){let r=this.fs.resolvePath(t,s);try{let l=await this.fs.readFile(r),i=new T(t);i.parse(l),this.parsers.push(i)}catch{}}}addPatternsFromContent(t,n){let s=new T(n);s.parse(t),this.parsers.push(s)}matches(t,n){for(let s of this.parsers){let r=s.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(s.matches(l,n))return!0}return!1}isWhitelisted(t,n){for(let s of this.parsers){let r=s.getBasePath();if(!t.startsWith(r))continue;let l=t.slice(r.length).replace(/^\//,"");if(s.isWhitelisted(l,n))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 A(e,t,n=!1,s=!1,r=[]){let l=new k(e,t,n,s);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 he(e){return e.length>=2&&e[0]===31&&e[1]===139}function ge(e){let t=!1;for(let n=0;n<e.length;n++){let s=e[n];s==="["&&!t?t=!0:s==="]"&&t&&(t=!1)}return t?`rg: glob '${e}' has an unclosed character class`:null}async function K(e){let{ctx:t,options:n,paths:s,explicitLineNumbers:r}=e;for(let f of n.globs){let x=f.startsWith("!")?f.slice(1):f,b=ge(x);if(b)return{stdout:"",stderr:`${b}
|
|
8
8
|
`,exitCode:1}}if(n.files){let f=[...n.patterns,...s];return de(t,f,n)}let l=[...n.patterns];for(let f of n.patternFiles)try{let x;if(f==="-")x=t.stdin;else{let h=t.fs.resolvePath(t.cwd,f);x=await t.fs.readFile(h)}let b=x.split(`
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as ye}from"./chunk-YMMJLYIX.js";import{b as Q}from"./chunk-YU6OGPZR.js";import{a as U}from"./chunk-JDNI5HBX.js";import{a as pe,b as ge,c as ee}from"./chunk-GTNBSMZR.js";var Ke="file",Je="link",Ve="symlink",ke="directory",Qe={file:"0",link:"1",symlink:"2","character-device":"3","block-device":"4",directory:"5",fifo:"6","pax-header":"x","pax-global-header":"g","gnu-long-name":"L","gnu-long-link-name":"K"},et={0:Ke,1:Je,2:Ve,3:"character-device",4:"block-device",5:ke,6:"fifo",x:"pax-header",g:"pax-global-header",L:"gnu-long-name",K:"gnu-long-link-name"},tt=new Uint8Array(512),_=new Uint8Array(0),T=new TextEncoder,ze=new TextDecoder;function P(e,t,i,r){r&&T.encodeInto(r,e.subarray(t,t+i))}function L(e,t,i,r){if(r===void 0)return;let n=r.toString(8).padStart(i-1,"0");T.encodeInto(n,e.subarray(t,t+i-1))}function S(e,t,i){let r=e.indexOf(0,t),n=r===-1||r>t+i?t+i:r;return ze.decode(e.subarray(t,n))}function ne(e,t,i){let r=0,n=t+i;for(let s=t;s<n;s++){let a=e[s];if(a===0)break;a!==32&&(r=r*8+(a-48))}return r}function W(e,t,i){if(e[t]&128){let r=0;r=e[t]&127;for(let n=1;n<i;n++)r=r*256+e[t+n];if(!Number.isSafeInteger(r))throw new Error("TAR number too large");return r}return ne(e,t,i)}var N=e=>e.type==="directory"||e.type==="symlink"||e.type==="link"||e.type==="character-device"||e.type==="block-device"||e.type==="fifo";async function Ce(e){if(e==null)return _;if(e instanceof Uint8Array)return e;if(typeof e=="string")return T.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw new TypeError("Unsupported content type for entry body.")}var we=(e,t)=>{let i=e.split("/").filter(Boolean);return t>=i.length?"":i.slice(t).join("/")};function Ae(e,t){let{strip:i,filter:r,map:n}=t;if(!i&&!r&&!n)return e;let s={...e};if(i&&i>0){let o=we(s.name,i);if(!o)return null;if(s.name=s.type==="directory"&&!o.endsWith("/")?`${o}/`:o,s.linkname){let c=s.linkname.startsWith("/");if(c||s.type==="link"){let l=we(s.linkname,i);s.linkname=c?`/${l}`||"/":l}}}if(r?.(s)===!1)return null;let a=n?n(s):s;return a&&(!a.name||!a.name.trim()||a.name==="."||a.name==="/")?null:a}var re=32,rt=48;function nt(e){let t=ne(e,148,8),i=0;for(let r=0;r<e.length;r++)r>=148&&r<156?i+=re:i+=e[r];return t===i}function it(e){e.fill(re,148,156);let t=0;for(let i of e)t+=i;for(let i=153;i>=148;i--)e[i]=(t&7)+rt,t>>=3;e[154]=0,e[155]=re}var st=256;function ot(e){let t={};T.encode(e.name).length>100&&Ee(e.name)===null&&(t.path=e.name),e.linkname&&T.encode(e.linkname).length>100&&(t.linkpath=e.linkname),e.uname&&T.encode(e.uname).length>32&&(t.uname=e.uname),e.gname&&T.encode(e.gname).length>32&&(t.gname=e.gname),e.uid!=null&&e.uid>2097151&&(t.uid=String(e.uid)),e.gid!=null&&e.gid>2097151&&(t.gid=String(e.gid)),e.size!=null&&e.size>8589934591&&(t.size=String(e.size)),e.pax&&Object.assign(t,e.pax);let i=Object.entries(t);if(i.length===0)return null;let r=T.encode(i.map(([n,s])=>{let a=`${n}=${s}
|
|
3
|
+
`,o=T.encode(a).length+1,c=o+String(o).length;return c=o+String(c).length,`${c} ${a}`}).join(""));return{paxHeader:$e({name:ze.decode(T.encode(`PaxHeader/${e.name}`).slice(0,100)),size:r.length,type:"pax-header",mode:420,mtime:e.mtime,uname:e.uname,gname:e.gname,uid:e.uid,gid:e.gid}),paxBody:r}}function Ee(e){let t=T.encode(e).length;if(t<=100||t>st)return null;for(let i=e.length-1;i>0;i--){if(e[i]!=="/")continue;let r=e.slice(0,i),n=e.slice(i+1);if(T.encode(r).length<=155&&T.encode(n).length<=100)return{prefix:r,name:n}}return null}function $e(e){let t=new Uint8Array(512),i=N(e)?0:e.size??0,r=e.name,n="";if(!e.pax?.path){let s=Ee(r);s&&(r=s.name,n=s.prefix)}return P(t,0,100,r),L(t,100,8,e.mode??(e.type==="directory"?493:420)),L(t,108,8,e.uid??0),L(t,116,8,e.gid??0),L(t,124,12,i),L(t,136,12,Math.floor((e.mtime?.getTime()??Date.now())/1e3)),P(t,156,1,Qe[e.type??"file"]),P(t,157,100,e.linkname),P(t,257,6,"ustar\0"),P(t,263,2,"00"),P(t,265,32,e.uname),P(t,297,32,e.gname),P(t,345,155,n),it(t),t}function at(e,t){if(t&&!nt(e))throw new Error("Invalid tar header checksum.");let i=S(e,156,1),r={name:S(e,0,100),mode:ne(e,100,8),uid:W(e,108,8),gid:W(e,116,8),size:W(e,124,12),mtime:new Date(W(e,136,12)*1e3),type:et[i]||"file",linkname:S(e,157,100)},n=S(e,257,6);return N(r)&&(r.size=0),n.trim()==="ustar"&&(r.uname=S(e,265,32),r.gname=S(e,297,32)),n==="ustar"&&(r.prefix=S(e,345,155)),r}var be={path:["name",e=>e],linkpath:["linkname",e=>e],size:["size",e=>parseInt(e,10)],mtime:["mtime",parseFloat],uid:["uid",e=>parseInt(e,10)],gid:["gid",e=>parseInt(e,10)],uname:["uname",e=>e],gname:["gname",e=>e]};function lt(e){let t=new TextDecoder("utf-8"),i=Object.create(null),r=Object.create(null),n=0;for(;n<e.length;){let s=e.indexOf(32,n);if(s===-1)break;let a=parseInt(t.decode(e.subarray(n,s)),10);if(Number.isNaN(a)||a===0)break;let o=n+a,[c,l]=t.decode(e.subarray(s+1,o-1)).split("=",2);if(c&&l!==void 0&&(r[c]=l,Object.hasOwn(be,c))){let[f,u]=be[c],y=u(l);(typeof y=="string"||!Number.isNaN(y))&&(i[f]=y)}n=o}return Object.keys(r).length>0&&(i.pax=r),i}function xe(e,t){t.name!==void 0&&(e.name=t.name),t.linkname!==void 0&&(e.linkname=t.linkname),t.size!==void 0&&(e.size=t.size),t.mtime!==void 0&&(e.mtime=new Date(t.mtime*1e3)),t.uid!==void 0&&(e.uid=t.uid),t.gid!==void 0&&(e.gid=t.gid),t.uname!==void 0&&(e.uname=t.uname),t.gname!==void 0&&(e.gname=t.gname),t.pax&&(e.pax=Object.assign({},e.pax??{},t.pax))}function ct(e){switch(e){case"pax-global-header":case"pax-header":return lt;case"gnu-long-name":return t=>({name:S(t,0,t.length)});case"gnu-long-link-name":return t=>({linkname:S(t,0,t.length)});default:return}}function ft(e){let t=$e(e),i=ot(e);if(!i)return[t];let r=-i.paxBody.length&511,n=r>0?[tt.subarray(0,r)]:[];return[i.paxHeader,i.paxBody,...n,t]}var ut=new Uint8Array(512*2);function Be(e,t,i){let r=null,n=0,s=!1,a=o=>{let c=new Error(o);throw t(c),c};return{add(o){s&&a("No new tar entries after finalize."),r!==null&&a("Previous entry must be completed before adding a new one");let c=N(o)?0:o.size;(!Number.isSafeInteger(c)||c<0)&&a("Invalid tar entry size.");try{let l=ft({...o,size:c});for(let f of l)e(f);r={...o,size:c},n=0}catch(l){t(l)}},write(o){r||a("No active tar entry."),s&&a("Cannot write data after finalize.");let c=n+o.length;c>r.size&&a(`"${r.name}" exceeds given size of ${r.size} bytes.`);try{n=c,e(o)}catch(l){t(l)}},endEntry(){r||a("No active entry to end."),s&&a("Cannot end entry after finalize.");try{n!==r.size&&a(`Size mismatch for "${r.name}".`);let o=-r.size&511;o>0&&e(new Uint8Array(o)),r=null,n=0}catch(o){throw t(o),o}},finalize(){s&&a("Archive has already been finalized"),r!==null&&a("Cannot finalize while an entry is still active");try{e(ut),s=!0,i&&i()}catch(o){t(o)}}}}var j=256;function dt(){let e=new Array(j),t=e.length-1,i=0,r=0,n=0,s=o=>{let c=e[i];o===c.length?(e[i]=_,i=i+1&t):e[i]=c.subarray(o),n-=o,n===0&&e.length>j&&(e=new Array(j),t=j-1,i=0,r=0)};function a(o,c){if(c){let g=0,d=Math.min(o,n);for(;d>0;){let p=e[i],m=Math.min(d,p.length),x=m===p.length?p:p.subarray(0,m);if(s(m),d-=m,g+=m,!c(x))break}return g}if(n<o)return null;if(o===0)return _;let l=e[i];if(l.length>=o){let g=l.length===o?l:l.subarray(0,o);return s(o),g}let f=new Uint8Array(o),u=0,y=o;for(;y>0;){let g=e[i],d=Math.min(y,g.length);f.set(d===g.length?g:g.subarray(0,d),u),u+=d,y-=d,s(d)}return f}return{push:o=>{if(o.length===0)return;let c=r+1&t;if(c===i){let l=e.length,f=l*2,u=new Array(f),y=r-i+l&l-1;if(i<r)for(let g=0;g<y;g++)u[g]=e[i+g];else if(y>0){let g=l-i;for(let d=0;d<g;d++)u[d]=e[i+d];for(let d=0;d<r;d++)u[g+d]=e[d]}e=u,t=f-1,i=0,r=y,c=r+1&t}e[r]=o,r=c,n+=o.length},available:()=>n,peek:o=>{if(n<o)return null;if(o===0)return _;let c=e[i];if(c.length>=o)return c.length===o?c:c.subarray(0,o);let l=new Uint8Array(o),f=0,u=i;for(;f<o;){let y=e[u],g=Math.min(o-f,y.length);g===y.length?l.set(y,f):l.set(y.subarray(0,g),f),f+=g,u=u+1&t}return l},discard:o=>{if(o>n)throw new Error("Too many bytes consumed");if(o===0)return;let c=o;for(;c>0;){let l=e[i],f=Math.min(c,l.length);s(f),c-=f}},pull:a}}var te=0,D=1,H=new Error("Tar archive is truncated.");function Te(e={}){let t=e.strict??!1,{available:i,peek:r,push:n,discard:s,pull:a}=dt(),o=te,c=!1,l=!1,f=!1,u=null,y={},g={},d={isEntryActive:()=>o===D,isBodyComplete:()=>!u||u.remaining===0,canFinish:()=>!u||i()>=u.remaining+u.padding,write(p){if(c)throw new Error("Archive already ended.");n(p)},end(){c=!0},readHeader(){if(o!==te)throw new Error("Cannot read header while an entry is active");if(!l)for(;!l;){if(i()<512){if(c){if(i()>0&&t)throw H;l=!0;return}return null}let p=r(512);if(ve(p)){if(i()<512*2){if(c){if(t)throw H;l=!0;return}return null}if(ve(r(512*2).subarray(512))){s(512*2),l=!0,f=!0;return}if(t)throw new Error("Invalid tar header.");s(512);continue}let m;try{m=at(p,t)}catch(E){if(t)throw E;s(512);continue}let x=ct(m.type);if(x){let E=m.size+(-m.size&511);if(i()<512+E){if(c&&t)throw H;return null}s(512);let v=x(a(E).subarray(0,m.size)),$=m.type==="pax-global-header"?y:g;for(let z in v)$[z]=v[z];continue}s(512);let b=m;return m.prefix&&(b.name=`${m.prefix}/${b.name}`),xe(b,y),xe(b,g),b.name.endsWith("/")&&b.type==="file"&&(b.type=ke),g={},u={header:b,remaining:b.size,padding:-b.size&511},o=D,b}},streamBody(p){if(o!==D||!u||u.remaining===0)return 0;let m=Math.min(u.remaining,i());if(m===0)return 0;let x=a(m,p);return u.remaining-=x,x},skipPadding(){if(o!==D||!u)return!0;if(u.remaining>0)throw new Error("Body not fully consumed");return i()<u.padding?!1:(s(u.padding),u=null,o=te,!0)},skipEntry(){if(o!==D||!u)return!0;let p=Math.min(u.remaining,i());return p>0&&(s(p),u.remaining-=p),u.remaining>0?!1:d.skipPadding()},validateEOF(){if(t){if(!f)throw H;if(i()>0&&a(i()).some(p=>p!==0))throw new Error("Invalid EOF.")}}};return d}function ve(e){if(e.byteOffset%8===0){let t=new BigUint64Array(e.buffer,e.byteOffset,e.length/8);for(let i=0;i<t.length;i++)if(t[i]!==0n)return!1;return!0}for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function Fe(){return new CompressionStream("gzip")}function Ie(){return new DecompressionStream("gzip")}function mt(){let e,t;return{readable:new ReadableStream({start(i){e=i,t=Be(i.enqueue.bind(i),i.error.bind(i),i.close.bind(i))}}),controller:{add(i){let r=N(i);return t.add(i),r&&t.endEntry(),new WritableStream({write(n){t.write(n)},close(){r||t.endEntry()},abort(n){e.error(n)}})},finalize(){t.finalize()},error(i){e.error(i)}}}}async function Pe(e){let t=[],i=e.getReader(),r=0;try{for(;;){let{done:a,value:o}=await i.read();if(a)break;t.push(o),r+=o.length}let n=new Uint8Array(r),s=0;for(let a of t)n.set(a,s),s+=a.length;return n}finally{i.releaseLock()}}var Se=e=>e.pipeTo(new WritableStream);function ht(e={}){let t=Te(e),i=e.strict??!1,r=null,n=null,s=!1,a=!1,o=!1,c=!1,l=()=>{try{n?.close()}catch{}n=null},f=d=>{if(!c){c=!0;try{n?.error(d)}catch{}n=null;try{r.error(d)}catch{}r=null}},u=()=>{if(!c){c=!0,l();try{r.close()}catch{}r=null}},y=()=>{if(i)throw new Error("Tar archive is truncated.");u()},g=()=>{if(!(s||c||!r)){s=!0;try{for(;;){if(a){o&&(t.validateEOF(),u());break}if(t.isEntryActive()){if(o&&!t.canFinish()){y();break}if(n){if((n.desiredSize??1)<=0)break;if(t.streamBody(d=>(n.enqueue(d),(n.desiredSize??1)>0))===0&&!t.isBodyComplete()){o&&y();break}}else if(!t.skipEntry()){o&&y();break}if(t.isBodyComplete()&&(l(),!t.skipPadding())){o&&y();break}}else{if((r.desiredSize??0)<0)break;let d=t.readHeader();if(d===null){o&&u();break}if(d===void 0){if(o){t.validateEOF(),u();break}a=!0;break}r.enqueue({header:d,body:new ReadableStream({start(p){d.size===0?p.close():n=p},pull:g,cancel(){n=null,g()}})})}}}catch(d){throw f(d),d}finally{s=!1}}};return{readable:new ReadableStream({start(d){r=d},pull:g,cancel(d){d!==void 0?f(d):u()}},{highWaterMark:2}),writable:new WritableStream({write(d){try{if(a&&i&&d.some(p=>p!==0))throw new Error("Invalid EOF.");t.write(d),g()}catch(p){throw f(p),p}},close(){try{o=!0,t.end(),g()}catch(d){throw f(d),d}},abort(d){f(d)}})}}async function Oe(e){let{readable:t,controller:i}=mt();return await(async()=>{for(let r of e){let n=i.add(r.header),s="body"in r?r.body:r.data;if(!s){await n.close();continue}if(s instanceof ReadableStream)await s.pipeTo(n);else if(s instanceof Blob)await s.stream().pipeTo(n);else try{let a=await Ce(s);if(a.length>0){let o=n.getWriter();await o.write(a),await o.close()}else await n.close()}catch{throw new TypeError(`Unsupported content type for entry "${r.header.name}".`)}}})().then(()=>i.finalize()).catch(r=>i.error(r)),new Uint8Array(await Pe(t))}async function Ue(e,t={}){let i=e instanceof ReadableStream?e:new ReadableStream({start(s){s.enqueue(e instanceof Uint8Array?e:new Uint8Array(e)),s.close()}}),r=[],n=i.pipeThrough(ht(t));for await(let s of n){let a;try{a=Ae(s.header,t)}catch(o){throw await s.body.cancel(),o}if(a===null){await Se(s.body);continue}N(a)?(await Se(s.body),r.push({header:a})):r.push({header:a,data:await Pe(s.body)})}return r}import At from"seek-bzip";var pt=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let i=t<<24;for(let r=0;r<8;r++)i=i&2147483648?i<<1^79764919:i<<1;e[t]=i>>>0}return e})();function gt(e,t){return(e<<8^pt[(e>>>24^t)&255])>>>0}var ie=class{buffer=[];current=0;bitCount=0;writeBits(t,i){for(let r=t-1;r>=0;r--)this.current=this.current<<1|i>>>r&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}writeBit(t){this.current=this.current<<1|t&1,this.bitCount++,this.bitCount===8&&(this.buffer.push(this.current),this.current=0,this.bitCount=0)}finish(){return this.bitCount>0&&this.buffer.push(this.current<<8-this.bitCount),new Uint8Array(this.buffer)}};function yt(e){let t=[],i=0;for(;i<e.length;){let r=e[i],n=1;for(;i+n<e.length&&e[i+n]===r&&n<255;)n++;n>=4?(t.push(r,r,r,r),t.push(n-4),i+=n):(t.push(r),i++)}return new Uint8Array(t)}function wt(e){let t=e.length;if(t===0)return{transformed:new Uint8Array(0),pointer:0};let i=bt(e),r=new Uint8Array(t),n=0;for(let s=0;s<t;s++)i[s]===0?(n=s,r[s]=e[t-1]):r[s]=e[i[s]-1];return{transformed:r,pointer:n}}function bt(e){let t=e.length,i=new Int32Array(t),r=new Int32Array(t);for(let n=0;n<t;n++)i[n]=n,r[n]=e[n];for(let n=1;n<t;n*=2){let s=r.slice();i.sort((a,o)=>s[a]!==s[o]?s[a]-s[o]:s[(a+n)%t]-s[(o+n)%t]),r[i[0]]=0;for(let a=1;a<t;a++)s[i[a]]===s[i[a-1]]&&s[(i[a]+n)%t]===s[(i[a-1]+n)%t]?r[i[a]]=r[i[a-1]]:r[i[a]]=r[i[a-1]]+1;if(r[i[t-1]]===t-1)break}return i}function xt(e,t){let i=[];for(let a=0;a<256;a++)t[a]&&i.push(a);let r=new Array(256).fill(-1);for(let a=0;a<i.length;a++)r[i[a]]=a;let n=new Uint16Array(e.length),s=i.slice();for(let a=0;a<e.length;a++){let o=e[a],c=0;for(;s[c]!==o;)c++;if(n[a]=c,c>0){let l=s[c];for(let f=c;f>0;f--)s[f]=s[f-1];s[0]=l}}return{encoded:n,length:e.length}}function vt(e,t,i){let s=i+1,a=[],o=0;for(;o<t;)if(e[o]===0){let l=0;for(;o<t&&e[o]===0;)l++,o++;let f=l;for(;f>0;)f--,f&1?a.push(1):a.push(0),f>>>=1}else a.push(e[o]+1),o++;a.push(s);let c=new Uint16Array(a.length);for(let l=0;l<a.length;l++)c[l]=a[l];return{symbols:c,length:a.length,eob:s}}function Ne(e,t,i){if(t<=1){let l=new Array(e.length).fill(0);for(let f=0;f<e.length;f++)e[f]>0&&(l[f]=1);return{codeLengths:l,maxLen:1,minLen:1}}let r=[];for(let l=0;l<e.length;l++)e[l]>0&&r.push({freq:e[l],symbol:l,left:null,right:null});if(r.length===0)return{codeLengths:new Array(e.length).fill(0),maxLen:0,minLen:0};if(r.length===1){let l=new Array(e.length).fill(0);return l[r[0].symbol]=1,{codeLengths:l,maxLen:1,minLen:1}}for(;r.length>1;){r.sort((u,y)=>u.freq-y.freq);let l=r.shift(),f=r.shift();r.push({freq:l.freq+f.freq,symbol:-1,left:l,right:f})}let n=new Array(e.length).fill(0);function s(l,f){if(!l.left&&!l.right){n[l.symbol]=f;return}l.left&&s(l.left,f+1),l.right&&s(l.right,f+1)}s(r[0],0);let a=!0;for(;a;){a=!1;for(let l=0;l<n.length;l++)n[l]>i&&(n[l]=i,a=!0);if(a){let l=0;for(let f=0;f<n.length;f++)n[f]>0&&(l+=1/(1<<n[f]));if(l>1)for(let f=1;f<i&&l>1;f++)for(let u=0;u<n.length&&l>1;u++)n[u]===f&&(n[u]++,l-=1/(1<<f)-1/(1<<f+1));a=!1;for(let f=0;f<n.length;f++)if(n[f]>i){a=!0;break}}}let o=i,c=0;for(let l=0;l<n.length;l++)n[l]>0&&(n[l]<o&&(o=n[l]),n[l]>c&&(c=n[l]));return{codeLengths:n,maxLen:c,minLen:o}}function kt(e,t){let i=new Array(t).fill(0),r=e.slice(0,t),n=Math.max(...r,0),s=new Array(n+1).fill(0);for(let c=0;c<t;c++)r[c]>0&&s[r[c]]++;let a=new Array(n+1).fill(0),o=0;for(let c=1;c<=n;c++)o=o+s[c-1]<<1,a[c]=o;for(let c=0;c<t;c++)r[c]>0&&(i[c]=a[r[c]]++);return{codes:i,lengths:r}}function zt(e,t,i){e.writeBits(24,3227993),e.writeBits(24,2511705),e.writeBits(32,i),e.writeBit(0);let r=yt(t),{transformed:n,pointer:s}=wt(r);e.writeBits(24,s);let a=new Array(256).fill(!1);for(let h=0;h<n.length;h++)a[n[h]]=!0;let o=new Array(16).fill(!1);for(let h=0;h<16;h++)for(let w=0;w<16;w++)if(a[h*16+w]){o[h]=!0;break}for(let h=0;h<16;h++)e.writeBit(o[h]?1:0);for(let h=0;h<16;h++)if(o[h])for(let w=0;w<16;w++)e.writeBit(a[h*16+w]?1:0);let c=0;for(let h=0;h<256;h++)a[h]&&c++;let{encoded:l,length:f}=xt(n,a),{symbols:u,length:y}=vt(l,f,c),g=c+2,d=50,p=Math.ceil(y/d),m;y<200?m=2:y<600?m=3:y<1200?m=4:y<2400?m=5:m=6,m>p&&(m=Math.max(2,p));let x=[];for(let h=0;h<m;h++)x.push(new Array(g).fill(0));let b=new Int32Array(p);for(let h=0;h<p;h++)b[h]=h%m;for(let h=0;h<p;h++){let w=h*d,k=Math.min(w+d,y),B=b[h];for(let C=w;C<k;C++)x[B][u[C]]++}function E(h){for(let w=0;w<g;w++)h[w]<1&&(h[w]=1)}let v=[];for(let h=0;h<m;h++)E(x[h]),v.push(Ne(x[h],g,20));for(let h=0;h<4;h++){for(let w=0;w<m;w++)x[w].fill(0);for(let w=0;w<p;w++){let k=w*d,B=Math.min(k+d,y),C=0,M=1/0;for(let I=0;I<m;I++){let J=0;for(let V=k;V<B;V++)J+=v[I].codeLengths[u[V]]||20;J<M&&(M=J,C=I)}b[w]=C;for(let I=k;I<B;I++)x[C][u[I]]++}for(let w=0;w<m;w++)E(x[w]),v[w]=Ne(x[w],g,20)}e.writeBits(3,m),e.writeBits(15,p);let $=[],z=[];for(let h=0;h<m;h++)z.push(h);for(let h=0;h<p;h++){let w=b[h],k=0;for(;z[k]!==w;)k++;if($.push(k),k>0){let B=z[k];for(let C=k;C>0;C--)z[C]=z[C-1];z[0]=B}}for(let h=0;h<p;h++){for(let w=0;w<$[h];w++)e.writeBit(1);e.writeBit(0)}for(let h=0;h<m;h++){let w=v[h].codeLengths,k=w[0];e.writeBits(5,k);for(let B=0;B<g;B++){let C=w[B];for(;k<C;)e.writeBit(1),e.writeBit(0),k++;for(;k>C;)e.writeBit(1),e.writeBit(1),k--;e.writeBit(0)}}for(let h=0;h<m;h++){let{codes:w,lengths:k}=kt(v[h].codeLengths,g);v[h]=Object.assign(v[h],{_codes:w,_lengths:k})}let he=0,R=0;for(let h=0;h<y;h++){(R===0||R>=d)&&(h>0&&he++,R=0);let w=b[he],k=v[w],B=u[h],C=k._lengths[B],M=k._codes[B];C>0&&e.writeBits(C,M),R++}}var Ct=10*1024*1024;function Le(e,t=9,i=Ct){if(t<1||t>9)throw new Error("Block size level must be 1-9");if(e.length>i)throw new Error(`Input too large for bzip2 compression (${e.length} bytes, max ${i})`);let r=t*1e5,n=new ie;n.writeBits(8,66),n.writeBits(8,90),n.writeBits(8,104),n.writeBits(8,48+t);let s=0,a=0;for(;a<e.length;){let o=Math.min(a+r,e.length),c=e.subarray(a,o),l=4294967295;for(let f=0;f<c.length;f++)l=gt(l,c[f]);l=~l>>>0,s=(s<<1|s>>>31)>>>0,s=(s^l)>>>0,zt(n,c,l),a=o}return n.writeBits(24,1536581),n.writeBits(24,3690640),n.writeBits(32,s),n.finish()}var X=null,Z=null;async function Me(){if(X)return X;if(Z)throw Z;try{return X=await Q.runTrustedAsync(()=>import("node-liblzma")),X}catch{throw Z=new Error("xz compression requires node-liblzma which failed to load. Install liblzma-dev (apt) or xz (brew) and reinstall dependencies."),Z}}var G=null,q=null;async function We(){if(G)return G;if(q)throw q;try{return G=await Q.runTrustedAsync(()=>import("@mongodb-js/zstd")),G}catch{throw q=new Error("zstd compression requires @mongodb-js/zstd which is not installed. Install it with: npm install @mongodb-js/zstd"),q}}var A=100*1024*1024,De=512,Re=1e4;function Et(e){let t="file";e.isDirectory?t="directory":e.isSymlink&&(t="symlink");let i=e.name;e.isDirectory&&!i.endsWith("/")&&(i+="/");let r;e.content!==void 0&&(typeof e.content=="string"?r=new TextEncoder().encode(e.content):r=e.content);let n=e.isDirectory||e.isSymlink?0:r?.length??0;return{header:{name:i,mode:e.mode??(e.isDirectory?493:420),uid:e.uid??0,gid:e.gid??0,size:n,mtime:e.mtime??new Date,type:t,linkname:e.linkTarget??"",uname:"user",gname:"user"},body:r}}async function O(e){let t=e.map(Et);return Oe(t)}async function je(e){let t=await O(e),n=new ReadableStream({start(l){l.enqueue(t),l.close()}}).pipeThrough(Fe()).getReader(),s=[];for(;;){let{done:l,value:f}=await n.read();if(l)break;s.push(f)}let a=s.reduce((l,f)=>l+f.length,0),o=new Uint8Array(a),c=0;for(let l of s)o.set(l,c),c+=l.length;return o}async function F(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};if(e.length<De||e.length%De!==0)return{entries:[],error:"Invalid tar archive format"};try{let t=await Ue(e),i=[];for(let r of t){if(i.length>=Re)return{entries:i,error:`Too many entries (max ${Re})`};let n="file";switch(r.header.type){case"directory":n="directory";break;case"symlink":n="symlink";break;case"link":n="hardlink";break;case"file":n="file";break;default:n="other"}i.push({name:r.header.name,mode:r.header.mode??420,uid:r.header.uid??0,gid:r.header.gid??0,size:r.header.size,mtime:r.header.mtime??new Date,type:n,linkTarget:r.header.linkname||void 0,content:r.data??new Uint8Array(0)})}return{entries:i}}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function se(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let r=new ReadableStream({start(c){c.enqueue(e),c.close()}}).pipeThrough(Ie()).getReader(),n=[],s=0;for(;;){let{done:c,value:l}=await r.read();if(c)break;if(s+=l.length,s>A)return await r.cancel(),{entries:[],error:`Decompressed archive too large (max ${A} bytes)`};n.push(l)}let a=new Uint8Array(s),o=0;for(let c of n)a.set(c,o),o+=c.length;return F(a)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:`Decompression failed: ${i}`}}}function oe(e){return e.length>=2&&e[0]===31&&e[1]===139}function ae(e){return e.length>=3&&e[0]===66&&e[1]===90&&e[2]===104}function le(e){return e.length>=6&&e[0]===253&&e[1]===55&&e[2]===122&&e[3]===88&&e[4]===90&&e[5]===0}async function $t(e){let t=At.decode(Buffer.from(e));return new Uint8Array(t)}async function Bt(e){return Le(e,9)}async function Tt(e){let i=(await Me()).unxzSync(Buffer.from(e));return new Uint8Array(i)}async function St(e){let i=(await Me()).xzSync(Buffer.from(e));return new Uint8Array(i)}async function He(e){let t=await O(e);return Bt(t)}async function _e(e,t){if(!t?.allowNativeCodecs)throw new Error("xz compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return St(i)}async function ce(e){if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let t=await $t(e);return t.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(t)}catch(t){let i=t instanceof Error?t.message:"Unknown error";return{entries:[],error:i}}}async function fe(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"xz decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await Tt(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function ue(e){return e.length>=4&&e[0]===40&&e[1]===181&&e[2]===47&&e[3]===253}async function Ft(e){let i=await(await We()).compress(Buffer.from(e),3);return new Uint8Array(i)}async function It(e){let i=await(await We()).decompress(Buffer.from(e));return new Uint8Array(i)}async function Xe(e,t){if(!t?.allowNativeCodecs)throw new Error("zstd compression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in.");let i=await O(e);return Ft(i)}async function de(e,t){if(!t?.allowNativeCodecs)return{entries:[],error:"zstd decompression is disabled by default (native codec risk). Pass { allowNativeCodecs: true } to opt in, or decompress the archive externally before extraction."};if(e.length>A)return{entries:[],error:`Archive too large (max ${A} bytes)`};try{let i=await It(e);return i.length>A?{entries:[],error:`Decompressed archive too large (max ${A} bytes)`}:F(i)}catch(i){let r=i instanceof Error?i.message:"Unknown error";return{entries:[],error:r}}}function Ze(e){let t={create:!1,append:!1,update:!1,extract:!1,list:!1,file:"",autoCompress:!1,gzip:!1,bzip2:!1,xz:!1,zstd:!1,verbose:!1,toStdout:!1,keepOldFiles:!1,touch:!1,directory:"",preserve:!1,absoluteNames:!1,strip:0,exclude:[],filesFrom:"",excludeFrom:"",wildcards:!1},i=[],r=0;for(;r<e.length;){let n=e[r];if(n.startsWith("-")&&!n.startsWith("--")&&n.length>2){if(/^-\d+$/.test(n)){i.push(n),r++;continue}for(let s=1;s<n.length;s++){let a=n[s];switch(a){case"c":t.create=!0;break;case"r":t.append=!0;break;case"u":t.update=!0;break;case"x":t.extract=!0;break;case"t":t.list=!0;break;case"a":t.autoCompress=!0;break;case"z":t.gzip=!0;break;case"j":t.bzip2=!0;break;case"J":t.xz=!0;break;case"v":t.verbose=!0;break;case"O":t.toStdout=!0;break;case"k":t.keepOldFiles=!0;break;case"m":t.touch=!0;break;case"p":t.preserve=!0;break;case"P":t.absoluteNames=!0;break;case"f":if(s<n.length-1)t.file=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
4
|
+
`,exitCode:2}};t.file=e[r]}break;case"C":if(s<n.length-1)t.directory=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
5
|
+
`,exitCode:2}};t.directory=e[r]}break;case"T":if(s<n.length-1)t.filesFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
6
|
+
`,exitCode:2}};t.filesFrom=e[r]}break;case"X":if(s<n.length-1)t.excludeFrom=n.substring(s+1),s=n.length;else{if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
|
|
7
|
+
`,exitCode:2}};t.excludeFrom=e[r]}break;default:return{ok:!1,error:ee("tar",`-${a}`)}}}r++;continue}if(n==="-c"||n==="--create")t.create=!0;else if(n==="-r"||n==="--append")t.append=!0;else if(n==="-u"||n==="--update")t.update=!0;else if(n==="-x"||n==="--extract"||n==="--get")t.extract=!0;else if(n==="-t"||n==="--list")t.list=!0;else if(n==="-a"||n==="--auto-compress")t.autoCompress=!0;else if(n==="-z"||n==="--gzip"||n==="--gunzip")t.gzip=!0;else if(n==="-j"||n==="--bzip2")t.bzip2=!0;else if(n==="-J"||n==="--xz")t.xz=!0;else if(n==="--zstd")t.zstd=!0;else if(n==="-v"||n==="--verbose")t.verbose=!0;else if(n==="-O"||n==="--to-stdout")t.toStdout=!0;else if(n==="-k"||n==="--keep-old-files")t.keepOldFiles=!0;else if(n==="-m"||n==="--touch")t.touch=!0;else if(n==="--wildcards")t.wildcards=!0;else if(n==="-p"||n==="--preserve"||n==="--preserve-permissions")t.preserve=!0;else if(n==="-P"||n==="--absolute-names")t.absoluteNames=!0;else if(n==="-f"||n==="--file"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'f'
|
|
8
|
+
`,exitCode:2}};t.file=e[r]}else if(n.startsWith("--file="))t.file=n.substring(7);else if(n==="-C"||n==="--directory"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'C'
|
|
9
|
+
`,exitCode:2}};t.directory=e[r]}else if(n.startsWith("--directory="))t.directory=n.substring(12);else if(n.startsWith("--strip-components=")||n.startsWith("--strip=")){let s=n.includes("--strip-components=")?n.substring(19):n.substring(8),a=parseInt(s,10);if(Number.isNaN(a)||a<0)return{ok:!1,error:{stdout:"",stderr:`tar: invalid number for --strip: '${s}'
|
|
10
|
+
`,exitCode:2}};t.strip=a}else if(n.startsWith("--exclude="))t.exclude.push(n.substring(10));else if(n==="--exclude"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option '--exclude' requires an argument
|
|
11
|
+
`,exitCode:2}};t.exclude.push(e[r])}else if(n==="-T"||n==="--files-from"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'T'
|
|
12
|
+
`,exitCode:2}};t.filesFrom=e[r]}else if(n.startsWith("--files-from="))t.filesFrom=n.substring(13);else if(n==="-X"||n==="--exclude-from"){if(r++,r>=e.length)return{ok:!1,error:{stdout:"",stderr:`tar: option requires an argument -- 'X'
|
|
13
|
+
`,exitCode:2}};t.excludeFrom=e[r]}else if(n.startsWith("--exclude-from="))t.excludeFrom=n.substring(15);else if(n==="--"){i.push(...e.slice(r+1));break}else{if(n.startsWith("-"))return{ok:!1,error:ee("tar",n)};i.push(n)}r++}return{ok:!0,options:t,files:i}}var Ge=100,Pt={name:"tar",summary:"manipulate tape archives",usage:"tar [options] [file...]",description:["Create, extract, or list contents of tar archives.","","One of -c, -r, -u, -x, or -t is required to specify the operation."],options:["-c, --create create a new archive","-r, --append append files to the end of an archive","-u, --update only append files newer than copy in archive","-x, --extract extract files from an archive","-t, --list list contents of an archive","-f, --file=ARCHIVE use archive file ARCHIVE","-a, --auto-compress use archive suffix to determine compression","-z, --gzip filter archive through gzip","-j, --bzip2 filter archive through bzip2","-J, --xz filter archive through xz","--zstd filter archive through zstd","-v, --verbose verbosely list files processed","-O, --to-stdout extract files to standard output","-k, --keep-old-files don't replace existing files when extracting","-m, --touch don't extract file modified time","-C, --directory=DIR change to directory DIR before performing operations","-p, --preserve preserve permissions","-P, --absolute-names do not strip leading '/' or block '..' paths","-T, --files-from=FILE read files to extract/create from FILE","-X, --exclude-from=FILE read exclude patterns from FILE","--strip=N strip N leading path components on extraction","--exclude=PATTERN exclude files matching PATTERN","--wildcards use wildcards for pattern matching"," --help display this help and exit"],examples:["tar -cvf archive.tar file1 file2 Create archive from files","tar -czvf archive.tar.gz dir/ Create gzip-compressed archive","tar -cjvf archive.tar.bz2 dir/ Create bzip2-compressed archive","tar -rf archive.tar newfile.txt Append file to archive","tar -uf archive.tar dir/ Update archive with newer files","tar -xvf archive.tar Extract archive","tar -xvf archive.tar -C /tmp Extract to /tmp","tar -tvf archive.tar List archive contents","tar -xzf archive.tar.gz Extract gzip archive","tar -xf archive.tar file1.txt Extract specific file","tar -xOf archive.tar file.txt Extract file to stdout","tar -xf archive.tar --wildcards '*.txt' Extract matching files"]};function me(e,t){let i=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;for(let r of t){let n=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,".");if(U(`^${n}$`).test(e)||U(`^${n}/`).test(e)||!r.includes("/")&&U(`^${n}$`).test(i))return!0}return!1}function Y(e,t){let i=t.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"<<<GLOBSTAR>>>").replace(/\*/g,"[^/]*").replace(/<<<GLOBSTAR>>>/g,".*").replace(/\?/g,"."),r=e.includes("/")?e.substring(e.lastIndexOf("/")+1):e;return U(`^${i}$`).test(e)||U(`^${i}$`).test(r)}function qe(e,t){if(t<=0)return e;let i=e.split("/").filter(r=>r!=="");return i.length<=t?"":i.slice(t).join("/")}function Ye(e){return e.split("/").some(t=>t==="..")}function Ot(e,t){if(t)return{safePath:e};let i=e.replace(/^\/+/,"");return i.length===0?{safePath:""}:Ye(i)?{error:"Path contains '..'"}:{safePath:i}}function Ut(e){let i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],r=e.getDate().toString().padStart(2," "),n=e.getHours().toString().padStart(2,"0"),s=e.getMinutes().toString().padStart(2,"0");return`${i} ${r} ${n}:${s}`}async function K(e,t,i,r){let n=[],s=[],a=e.fs.resolvePath(t,i);try{let o=await e.fs.stat(a);if(me(i,r))return{entries:n,errors:s};if(o.isDirectory){n.push({name:i,isDirectory:!0,mode:o.mode,mtime:o.mtime});let c=await e.fs.readdir(a);for(let l=0;l<c.length;l+=Ge){let f=c.slice(l,l+Ge),u=await Promise.all(f.map(y=>K(e,t,i?`${i}/${y}`:y,r)));for(let y of u)n.push(...y.entries),s.push(...y.errors)}}else if(o.isFile){let c=await e.fs.readFileBuffer(a);n.push({name:i,content:c,mode:o.mode,mtime:o.mtime})}else if(o.isSymbolicLink){let c=await e.fs.readlink(a);n.push({name:i,isSymlink:!0,linkTarget:c,mode:o.mode,mtime:o.mtime})}}catch(o){let c=o instanceof Error?o.message:"unknown error";s.push(`tar: ${i}: ${c}`)}return{entries:n,errors:s}}async function Nt(e,t,i){if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to create an empty archive
|
|
14
|
+
`,exitCode:2};let r=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,n=[],s=[],a="";for(let f of i){let{entries:u,errors:y}=await K(e,r,f,t.exclude);if(n.push(...u),s.push(...y),t.verbose)for(let g of u)a+=`${g.name}${g.isDirectory?"/":""}
|
|
15
|
+
`}if(n.length===0&&s.length>0)return{stdout:"",stderr:`${s.join(`
|
|
16
|
+
`)}
|
|
17
|
+
`,exitCode:2};let o;try{t.gzip?o=await je(n):t.bzip2?o=await He(n):t.xz?o=await _e(n):t.zstd?o=await Xe(n):o=await O(n)}catch(f){return{stdout:"",stderr:`tar: error creating archive: ${f instanceof Error?f.message:"unknown error"}
|
|
18
|
+
`,exitCode:2}}let c="";if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{await e.fs.writeFile(f,o)}catch(u){let y=u instanceof Error?u.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${y}
|
|
19
|
+
`,exitCode:2}}}else c=Buffer.from(o).toString("latin1");let l=a;return s.length>0&&(l+=`${s.join(`
|
|
20
|
+
`)}
|
|
21
|
+
`),{stdout:c,stderr:l,exitCode:s.length>0?2:0}}async function Lt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot append to stdin/stdout
|
|
22
|
+
`,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to append nothing to archive
|
|
23
|
+
`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
24
|
+
`,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
25
|
+
`,exitCode:2};let a=s.entries.map(d=>({name:d.name,content:d.content,mode:d.mode,mtime:d.mtime,isDirectory:d.type==="directory",isSymlink:d.type==="symlink",linkTarget:d.linkTarget,uid:d.uid,gid:d.gid})),o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let d of i){let{entries:p,errors:m}=await K(e,o,d,t.exclude);if(c.push(...p),l.push(...m),t.verbose)for(let x of p)f+=`${x.name}${x.isDirectory?"/":""}
|
|
26
|
+
`}let u=[...a,...c],y;try{y=await O(u)}catch(d){return{stdout:"",stderr:`tar: error creating archive: ${d instanceof Error?d.message:"unknown error"}
|
|
27
|
+
`,exitCode:2}}try{await e.fs.writeFile(r,y)}catch(d){let p=d instanceof Error?d.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${p}
|
|
28
|
+
`,exitCode:2}}let g=f;return l.length>0&&(g+=`${l.join(`
|
|
29
|
+
`)}
|
|
30
|
+
`),{stdout:"",stderr:g,exitCode:l.length>0?2:0}}async function Dt(e,t,i){if(!t.file||t.file==="-")return{stdout:"",stderr:`tar: Cannot update stdin/stdout
|
|
31
|
+
`,exitCode:2};if(i.length===0)return{stdout:"",stderr:`tar: Cowardly refusing to update with nothing
|
|
32
|
+
`,exitCode:2};let r=e.fs.resolvePath(e.cwd,t.file),n;try{n=await e.fs.readFileBuffer(r)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
33
|
+
`,exitCode:2}}let s=await F(n);if(s.error)return{stdout:"",stderr:`tar: ${s.error}
|
|
34
|
+
`,exitCode:2};let a=new Map;for(let m of s.entries)a.set(m.name,m.mtime);let o=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,c=[],l=[],f="";for(let m of i){let{entries:x,errors:b}=await K(e,o,m,t.exclude);l.push(...b);for(let E of x){let v=a.get(E.name);(!v||E.mtime&&E.mtime.getTime()>v.getTime())&&(c.push(E),t.verbose&&(f+=`${E.name}${E.isDirectory?"/":""}
|
|
35
|
+
`))}}if(c.length===0){let m="";return l.length>0&&(m=`${l.join(`
|
|
36
|
+
`)}
|
|
37
|
+
`),{stdout:"",stderr:m,exitCode:l.length>0?2:0}}let u=new Set(c.map(m=>m.name)),g=[...s.entries.filter(m=>!u.has(m.name)).map(m=>({name:m.name,content:m.content,mode:m.mode,mtime:m.mtime,isDirectory:m.type==="directory",isSymlink:m.type==="symlink",linkTarget:m.linkTarget,uid:m.uid,gid:m.gid})),...c],d;try{d=await O(g)}catch(m){return{stdout:"",stderr:`tar: error creating archive: ${m instanceof Error?m.message:"unknown error"}
|
|
38
|
+
`,exitCode:2}}try{await e.fs.writeFile(r,d)}catch(m){let x=m instanceof Error?m.message:"unknown error";return{stdout:"",stderr:`tar: ${t.file}: ${x}
|
|
39
|
+
`,exitCode:2}}let p=f;return l.length>0&&(p+=`${l.join(`
|
|
40
|
+
`)}
|
|
41
|
+
`),{stdout:"",stderr:p,exitCode:l.length>0?2:0}}async function Rt(e,t,i){let r;if(t.file&&t.file!=="-"){let p=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(p)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
42
|
+
`,exitCode:2}}}else r=Uint8Array.from(e.stdin,p=>p.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
|
|
43
|
+
`,exitCode:2};let l=t.directory?e.fs.resolvePath(e.cwd,t.directory):e.cwd,f=t.absoluteNames?i:i.map(p=>p.replace(/^\/+/,"")).filter(p=>p.length>0),u="",y="",g=[];if(t.directory&&!t.toStdout)try{await e.fs.mkdir(l,{recursive:!0})}catch{}for(let p of n.entries){let m=qe(p.name,t.strip);if(!m)continue;let x=Ot(m,t.absoluteNames);if(x.error){g.push(`tar: ${m}: ${x.error}`);continue}let b=x.safePath??"";if(!b)continue;let E=b.endsWith("/")?b.slice(0,-1):b;if(f.length>0){let $;if(t.wildcards?$=f.some(z=>Y(b,z)||Y(E,z)||b.startsWith(`${z}/`)):$=f.some(z=>b===z||b.startsWith(`${z}/`)||E===z),!$)continue}if(me(b,t.exclude))continue;let v=e.fs.resolvePath(l,b);try{if(p.type==="directory"){if(t.toStdout)continue;await e.fs.mkdir(v,{recursive:!0}),t.verbose&&(u+=`${b}
|
|
44
|
+
`)}else if(p.type==="file"){if(t.toStdout){y+=new TextDecoder().decode(p.content),t.verbose&&(u+=`${b}
|
|
45
|
+
`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists
|
|
46
|
+
`);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}if(await e.fs.writeFile(v,p.content),t.preserve&&p.mode)try{await e.fs.chmod(v,p.mode)}catch{}t.verbose&&(u+=`${b}
|
|
47
|
+
`)}else if(p.type==="symlink"&&p.linkTarget){if(t.toStdout)continue;if(!t.absoluteNames&&(p.linkTarget.startsWith("/")||Ye(p.linkTarget))){g.push(`tar: ${b}: unsafe symlink target`);continue}if(t.keepOldFiles)try{await e.fs.stat(v),t.verbose&&(u+=`${b}: not overwritten, file exists
|
|
48
|
+
`);continue}catch{}let $=v.substring(0,v.lastIndexOf("/"));if($)try{await e.fs.mkdir($,{recursive:!0})}catch{}try{await e.fs.symlink(p.linkTarget,v)}catch{}t.verbose&&(u+=`${b}
|
|
49
|
+
`)}}catch($){let z=$ instanceof Error?$.message:"unknown error";g.push(`tar: ${b}: ${z}`)}}let d=u;return g.length>0&&(d+=`${g.join(`
|
|
50
|
+
`)}
|
|
51
|
+
`),{stdout:y,stderr:d,exitCode:g.length>0?2:0}}async function Mt(e,t,i){let r;if(t.file&&t.file!=="-"){let f=e.fs.resolvePath(e.cwd,t.file);try{r=await e.fs.readFileBuffer(f)}catch{return{stdout:"",stderr:`tar: ${t.file}: Cannot open: No such file or directory
|
|
52
|
+
`,exitCode:2}}}else r=Uint8Array.from(e.stdin,f=>f.charCodeAt(0));let n,s=t.gzip||oe(r),a=t.bzip2||ae(r),o=t.xz||le(r),c=t.zstd||ue(r);if(s?n=await se(r):a?n=await ce(r):o?n=await fe(r):c?n=await de(r):n=await F(r),n.error)return{stdout:"",stderr:`tar: ${n.error}
|
|
53
|
+
`,exitCode:2};let l="";for(let f of n.entries){let u=qe(f.name,t.strip);if(!u)continue;let y=u.endsWith("/")?u.slice(0,-1):u;if(i.length>0){let g;if(t.wildcards?g=i.some(d=>Y(u,d)||Y(y,d)||u.startsWith(`${d}/`)):g=i.some(d=>u===d||u.startsWith(`${d}/`)||y===d),!g)continue}if(!me(u,t.exclude))if(t.verbose){let g=f.type==="directory",d=ye(f.mode,g),p=`${f.uid}/${f.gid}`,m=f.size.toString().padStart(8," "),x=Ut(f.mtime),b=`${d} ${p.padEnd(10)} ${m} ${x} ${u}`;f.type==="symlink"&&f.linkTarget&&(b+=` -> ${f.linkTarget}`),l+=`${b}
|
|
54
|
+
`}else l+=`${u}
|
|
55
|
+
`}return{stdout:l,stderr:"",exitCode:0}}var nr={name:"tar",async execute(e,t){if(ge(e))return pe(Pt);let i=Ze(e);if(!i.ok)return i.error;let{options:r,files:n}=i,s=[r.create,r.append,r.update,r.extract,r.list].filter(Boolean).length;if(s===0)return{stdout:"",stderr:`tar: You must specify one of -c, -r, -u, -x, or -t
|
|
56
|
+
`,exitCode:2};if(s>1)return{stdout:"",stderr:`tar: You may not specify more than one of -c, -r, -u, -x, or -t
|
|
57
|
+
`,exitCode:2};if(r.autoCompress&&r.file&&r.create){let c=r.file.toLowerCase();c.endsWith(".tar.gz")||c.endsWith(".tgz")?r.gzip=!0:c.endsWith(".tar.bz2")||c.endsWith(".tbz2")?r.bzip2=!0:c.endsWith(".tar.xz")||c.endsWith(".txz")?r.xz=!0:(c.endsWith(".tar.zst")||c.endsWith(".tzst"))&&(r.zstd=!0)}let a=[r.gzip,r.bzip2,r.xz,r.zstd].filter(Boolean).length;if(a>1)return{stdout:"",stderr:`tar: You may not specify more than one compression option
|
|
58
|
+
`,exitCode:2};if((r.append||r.update)&&a>0)return{stdout:"",stderr:`tar: Cannot append/update compressed archives - decompress first
|
|
59
|
+
`,exitCode:2};let o=n;if(r.filesFrom){let c=t.fs.resolvePath(t.cwd,r.filesFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
60
|
+
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));o=[...n,...f]}catch{return{stdout:"",stderr:`tar: ${r.filesFrom}: Cannot open: No such file or directory
|
|
61
|
+
`,exitCode:2}}}if(r.excludeFrom){let c=t.fs.resolvePath(t.cwd,r.excludeFrom);try{let f=(await t.fs.readFile(c)).split(`
|
|
62
|
+
`).map(u=>u.trim()).filter(u=>u.length>0&&!u.startsWith("#"));r.exclude.push(...f)}catch{return{stdout:"",stderr:`tar: ${r.excludeFrom}: Cannot open: No such file or directory
|
|
63
|
+
`,exitCode:2}}}return r.create?Nt(t,r,o):r.append?Lt(t,r,o):r.update?Dt(t,r,o):r.extract?Rt(t,r,o):Mt(t,r,o)}},ir={name:"tar",flags:[{flag:"-c",type:"boolean"},{flag:"-x",type:"boolean"},{flag:"-t",type:"boolean"},{flag:"-f",type:"value",valueHint:"path"},{flag:"-z",type:"boolean"},{flag:"-j",type:"boolean"},{flag:"-v",type:"boolean"},{flag:"-C",type:"value",valueHint:"path"},{flag:"--strip-components",type:"value",valueHint:"number"},{flag:"--exclude",type:"value",valueHint:"pattern"}],needsArgs:!0};export{nr as a,ir as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-KCMUAACL.js";import"./chunk-JBABAK44.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{a as diffCommand,b as flagsForFuzzing};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as c,B as d,C as e,I as f,J as g,K as h,L as i,M as j,N as k,O as l,y as a,z as b}from"./chunk-
|
|
2
|
+
import{A as c,B as d,C as e,I as f,J as g,K as h,L as i,M as j,N as k,O as l,y as a,z as b}from"./chunk-OXHVTSNH.js";import"./chunk-JDNI5HBX.js";import"./chunk-6KZRLMG3.js";import"./chunk-OBH7XN5N.js";import"./chunk-KGOUQS5A.js";export{d as escapeGlobChars,e as escapeRegexChars,l as expandRedirectTarget,g as expandWord,i as expandWordForPattern,h as expandWordForRegex,j as expandWordWithGlob,a as getArrayElements,c as getVariable,k as hasQuotedMultiValueAt,b as isArray,f as isWordFullyQuoted};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-BGGF3ELU.js";import"./chunk-JDNI5HBX.js";import"./chunk-RLNOQILG.js";import"./chunk-KGOUQS5A.js";export{a as exprCommand,b as flagsForFuzzing};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-WLBA7L7U.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{a as fileCommand,b as flagsForFuzzing};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a,b}from"./chunk-S3QAKT3R.js";import"./chunk-YMMJLYIX.js";import"./chunk-EONWONZV.js";import"./chunk-4OALHZXB.js";import"./chunk-JDNI5HBX.js";import"./chunk-D5WP4CKS.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{a as findCommand,b as flagsForFuzzing};
|
package/dist/bin/{chunks/flag-coverage-NSXW5TJP.js → shell/chunks/flag-coverage-IK7WVGOO.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as yr}from"./chunk-
|
|
2
|
+
import{b as yr}from"./chunk-ZUDPEMHG.js";import{b as Ar}from"./chunk-2HVFB2TU.js";import{b as $r}from"./chunk-AX6NCIX6.js";import"./chunk-RBQGQWGV.js";import"./chunk-4CFAYBLV.js";import{c as Sr}from"./chunk-EFPTD2CS.js";import{b as wr}from"./chunk-L6XUBS6H.js";import{b as xr}from"./chunk-ORUYSLP4.js";import{b as vr}from"./chunk-IDGH4PGU.js";import{b as kr}from"./chunk-F3LGZXLQ.js";import{b as qr}from"./chunk-BYDV4VEF.js";import{b as Cr}from"./chunk-JLX6YWGA.js";import{b as br}from"./chunk-FLPVVSN5.js";import{d as Ir,e as Mr,f as jr}from"./chunk-54G6AE72.js";import{b as tr}from"./chunk-DOXYBGNA.js";import{b as lr}from"./chunk-WXMBDX4P.js";import{b as ur}from"./chunk-THALLNXT.js";import{b as pr}from"./chunk-BGGF3ELU.js";import{b as er}from"./chunk-3Y32LPNT.js";import{b as dr}from"./chunk-7BORMNPQ.js";import{b as cr}from"./chunk-N43DJTSI.js";import"./chunk-OBI37ZY4.js";import{b as hr}from"./chunk-WLBA7L7U.js";import{c as or,d as ar}from"./chunk-MAVV76T4.js";import{b as sr}from"./chunk-JTF74J6E.js";import{c as ir,d as gr}from"./chunk-GO6FXSC4.js";import{b as mr}from"./chunk-DU4S5MUI.js";import"./chunk-ARI4VLCN.js";import{b as Fr}from"./chunk-GOJZHH3L.js";import{b as zr}from"./chunk-KCMUAACL.js";import{b as fr}from"./chunk-LOJMXC4F.js";import{b as nr}from"./chunk-AXWFPG37.js";import"./chunk-YTIURC67.js";import{b as R}from"./chunk-PQNTKMH3.js";import{b as U}from"./chunk-PPBQJBC2.js";import{b as V}from"./chunk-NSUMEERA.js";import{b as W}from"./chunk-XY5HGZW5.js";import{c as X,d as Y}from"./chunk-AAW7UMPO.js";import{c as Z,d as _}from"./chunk-3MBAUIBB.js";import{b as N}from"./chunk-RT7TRQVZ.js";import{b as rr}from"./chunk-CQG2HEAL.js";import{b as G}from"./chunk-RJSAGJQJ.js";import{b as H}from"./chunk-YEKSVVRC.js";import{b as J}from"./chunk-26NO42TF.js";import{b as K}from"./chunk-LGJM5YFT.js";import{b as L}from"./chunk-LMK6G2HH.js";import{b as O}from"./chunk-ZKC5HQYO.js";import{b as P}from"./chunk-ROJPSS6N.js";import{b as Q}from"./chunk-S3QAKT3R.js";import{b as y}from"./chunk-CGE2EHYP.js";import{b as A}from"./chunk-ZA4HUKJ3.js";import{b as $}from"./chunk-WWZVR5NN.js";import{b as S}from"./chunk-JQBC3FXE.js";import{b as T}from"./chunk-NAX7MTAR.js";import{b as B}from"./chunk-5G2VOPPJ.js";import{b as D}from"./chunk-SGA7Y45Z.js";import{b as E}from"./chunk-EUXCM6C4.js";import{b as w}from"./chunk-YLE2OYY6.js";import{b as x}from"./chunk-S7OHMN3F.js";import{b as v}from"./chunk-YWZOGBFE.js";import"./chunk-YMMJLYIX.js";import{d as k,e as q,f as C}from"./chunk-RA3TG4UK.js";import"./chunk-EONWONZV.js";import{b}from"./chunk-WUYP7DID.js";import"./chunk-V7ZOPVQS.js";import"./chunk-4OALHZXB.js";import"./chunk-TTNNO45C.js";import{b as I}from"./chunk-PNI5NMXP.js";import{b as M}from"./chunk-EWDHVLQL.js";import{b as j}from"./chunk-FA2CHD73.js";import{b as t}from"./chunk-EPPBDXOG.js";import{b as l}from"./chunk-PS4LOXE5.js";import{b as u}from"./chunk-VNER2XXL.js";import{b as p}from"./chunk-AZ3RUDR2.js";import{b as e}from"./chunk-7ADG3DNO.js";import{b as d}from"./chunk-TEFXEYX3.js";import{b as c}from"./chunk-ZSVBYEY4.js";import{b as h}from"./chunk-SXRVLCZ4.js";import"./chunk-FSZWFMB4.js";import"./chunk-LIYVQA3X.js";import"./chunk-OOJCYVYF.js";import"./chunk-4PRVMER6.js";import"./chunk-MO4RPBN2.js";import"./chunk-YU6OGPZR.js";import"./chunk-JDNI5HBX.js";import{b as i}from"./chunk-LJKIWB5F.js";import{b as g}from"./chunk-MRP4ZCD7.js";import"./chunk-5WFYIUU2.js";import{b as m}from"./chunk-LCDPWJBA.js";import"./chunk-D5WP4CKS.js";import"./chunk-6KZRLMG3.js";import{b as F}from"./chunk-UFJFAFSS.js";import"./chunk-OBH7XN5N.js";import{b as z}from"./chunk-7G3MC56B.js";import"./chunk-RLNOQILG.js";import{b as f}from"./chunk-EJQKHROT.js";import"./chunk-JBABAK44.js";import{b as n}from"./chunk-ITA43A73.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var Er=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,v,k,q,C,b,I,M,j,y,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,vr,kr,qr,Cr,br,Ir,Mr,jr,yr,Ar,$r,Sr];function Tr(){return Er}var Br=new Map;for(let r of Tr())Br.set(r.name,new Set(r.flags.map(o=>o.flag)));function Fa(r,o,Dr){let a=Br.get(o);if(!(!a||a.size===0))for(let s of Dr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{Fa as emitFlagCoverage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-RA3TG4UK.js";import"./chunk-EONWONZV.js";import"./chunk-TTNNO45C.js";import"./chunk-JDNI5HBX.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{c as egrepCommand,f as egrepFlagsForFuzzing,b as fgrepCommand,e as fgrepFlagsForFuzzing,d as flagsForFuzzing,a as grepCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-L6XUBS6H.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as htmlToMarkdownCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-DU4S5MUI.js";import"./chunk-ARI4VLCN.js";import"./chunk-V7ZOPVQS.js";import"./chunk-4PRVMER6.js";import"./chunk-MO4RPBN2.js";import"./chunk-YU6OGPZR.js";import"./chunk-JDNI5HBX.js";import"./chunk-5WFYIUU2.js";import"./chunk-6KZRLMG3.js";import"./chunk-OBH7XN5N.js";import"./chunk-RLNOQILG.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as jqCommand};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as A,b as P}from"./chunk-XXCTETRW.js";import"./chunk-4OALHZXB.js";import"./chunk-
|
|
2
|
+
import{a as A,b as P}from"./chunk-XXCTETRW.js";import"./chunk-4OALHZXB.js";import"./chunk-HC7WB764.js";import"./chunk-NTW6IA45.js";import"./chunk-LIYVQA3X.js";import{a as k,b as T}from"./chunk-OOJCYVYF.js";import{a as W}from"./chunk-4PRVMER6.js";import{b as C}from"./chunk-YU6OGPZR.js";import{a as M,b as y}from"./chunk-RLNOQILG.js";import{a as v}from"./chunk-4VDEBYW7.js";import{b as F}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";import{AsyncLocalStorage as U}from"node:async_hooks";import{randomBytes as I}from"node:crypto";import{fileURLToPath as J}from"node:url";import{Worker as D}from"node:worker_threads";var N=1e4,H=6e4,B=new U,_=`js-exec - Sandboxed JavaScript/TypeScript runtime with Node.js-compatible APIs
|
|
3
3
|
|
|
4
4
|
Usage: js-exec [OPTIONS] [-c CODE | FILE] [ARGS...]
|
|
5
5
|
|
|
@@ -86,9 +86,9 @@ Limits:
|
|
|
86
86
|
Engine: QuickJS (compiled to WebAssembly)
|
|
87
87
|
`;function z(t){let e={code:null,scriptFile:null,showVersion:!1,scriptArgs:[],isModule:!1,stripTypes:!1};if(t.length===0)return e;for(let r=0;r<t.length;r++){let s=t[r];if(s==="-m"||s==="--module"){e.isModule=!0;continue}if(s==="--strip-types"){e.stripTypes=!0;continue}if(s==="-c")return r+1>=t.length?{stdout:"",stderr:`js-exec: option requires an argument -- 'c'
|
|
88
88
|
`,exitCode:2}:(e.code=t[r+1],e.scriptArgs=t.slice(r+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-"&&s!=="--")return{stdout:"",stderr:`js-exec: unrecognized option '${s}'
|
|
89
|
-
`,exitCode:2};if(s==="--")return r+1<t.length&&(e.scriptFile=t[r+1],e.scriptArgs=t.slice(r+2)),e;if(!s.startsWith("-"))return e.scriptFile=s,e.scriptArgs=t.slice(r+1),e}return e}var i=null,w=null,c=[],o=null,$=J(new URL("./worker.js",import.meta.url));function p(){for(;c.length>0&&c[0].canceled;)c.shift();if(o||c.length===0)return;let t=c.shift();if(!t)return;o=t,Q().postMessage(o.input)}function V(t,e){if(!t||typeof t!="object")return{success:!1,error:"Malformed worker response"};let r=t;return typeof r.protocolToken!="string"||r.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?{success:!0}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}function Q(){if(w&&(T(w),w=null),i)return i;let t=C.runTrusted(()=>new D($));return i=t,t.on("message",e=>{if(i===t){if(o){let r=V(e,o.input.protocolToken);o.resolve(r),o=null}c.length>0?p():G()}}),t.on("error",e=>{if(i===t){if(o){let r=
|
|
90
|
-
`,exitCode:1}:X(t,e,r,s,n,u,a)}async function X(t,e,r,s=[],n,u,a){let m=A(),d=e.exec,g=d?(l,
|
|
91
|
-
`,exitCode:
|
|
89
|
+
`,exitCode:2};if(s==="--")return r+1<t.length&&(e.scriptFile=t[r+1],e.scriptArgs=t.slice(r+2)),e;if(!s.startsWith("-"))return e.scriptFile=s,e.scriptArgs=t.slice(r+1),e}return e}var i=null,w=null,c=[],o=null,$=J(new URL("./js-exec-worker.js",import.meta.url));function p(){for(;c.length>0&&c[0].canceled;)c.shift();if(o||c.length===0)return;let t=c.shift();if(!t)return;o=t,Q().postMessage(o.input)}function V(t,e){if(!t||typeof t!="object")return{success:!1,error:"Malformed worker response"};let r=t;return typeof r.protocolToken!="string"||r.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:typeof r.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:r.success?{success:!0}:{success:!1,error:typeof r.error=="string"&&r.error.length>0?r.error:"Worker execution failed"}}function Q(){if(w&&(T(w),w=null),i)return i;let t=C.runTrusted(()=>new D($));return i=t,t.on("message",e=>{if(i===t){if(o){let r=V(e,o.input.protocolToken);o.resolve(r),o=null}c.length>0?p():G()}}),t.on("error",e=>{if(i===t){if(o){let r=y(v(e));o.resolve({success:!1,error:r}),o=null}for(let r of c)r.resolve({success:!1,error:"Worker crashed"});c.length=0,i=null}}),t.on("exit",()=>{i===t&&(i=null,o&&(o.resolve({success:!1,error:"Worker exited unexpectedly"}),o=null),c.length>0&&p())}),t}function G(){w=k(()=>{i&&!o&&c.length===0&&(i.terminate(),i=null)},5e3)}async function K(t,e,r,s=[],n,u,a){return B.getStore()?{stdout:"",stderr:`js-exec: recursive invocation is not supported
|
|
90
|
+
`,exitCode:1}:X(t,e,r,s,n,u,a)}async function X(t,e,r,s=[],n,u,a){let m=A(),d=e.exec,g=d?(l,b)=>B.run(!0,()=>d(l,b)):void 0,q=new P(m,e.fs,e.cwd,"js-exec",e.fetch,e.limits?.maxOutputSize??0,g),E=e.limits?.maxJsTimeoutMs??N,h=e.fetch?Math.max(E,H):E,O={protocolToken:I(16).toString("hex"),sharedBuffer:m,jsCode:t,cwd:e.cwd,env:W(e.env),args:s,scriptPath:r,bootstrapCode:n,isModule:u,stripTypes:a,timeoutMs:h},j,L=new Promise(l=>{j=l}),f={input:O,resolve:()=>{}},R=k(()=>{if(o===f){let l=i;l&&(i=null,l.terminate()),o=null,p()}else f.canceled=!0,o||p();f.resolve({success:!1,error:`Execution timeout: exceeded ${h}ms limit`})},h);f.resolve=l=>{T(R),j(l)},c.push(f),p();let[x,S]=await Promise.all([q.run(h),L.catch(l=>({success:!1,error:y(v(l))}))]);return!S.success&&S.error?{stdout:x.stdout,stderr:`${x.stderr}js-exec: ${y(S.error)}
|
|
91
|
+
`,exitCode:x.exitCode||1}:x}var de={name:"js-exec",async execute(t,e){if(F(t))return{stdout:_,stderr:"",exitCode:0};let r=z(t);if("exitCode"in r)return r;if(r.showVersion)return{stdout:`QuickJS (quickjs-emscripten)
|
|
92
92
|
`,stderr:"",exitCode:0};let s,n;if(r.code!==null)s=r.code,n="-c";else if(r.scriptFile!==null){let d=e.fs.resolvePath(e.cwd,r.scriptFile);if(!await e.fs.exists(d))return{stdout:"",stderr:`js-exec: can't open file '${r.scriptFile}': No such file or directory
|
|
93
93
|
`,exitCode:2};try{s=await e.fs.readFile(d),n=d}catch(g){return{stdout:"",stderr:`js-exec: can't open file '${r.scriptFile}': ${M(g.message)}
|
|
94
94
|
`,exitCode:2}}}else if(e.stdin.trim())s=e.stdin,n="<stdin>";else return{stdout:"",stderr:`js-exec: no input provided (use -c CODE or provide a script file)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-UFJFAFSS.js";import"./chunk-OBH7XN5N.js";import"./chunk-JBABAK44.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as lsCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-LCDPWJBA.js";import"./chunk-D5WP4CKS.js";import"./chunk-6KZRLMG3.js";import"./chunk-4VDEBYW7.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as printfCommand};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as _,b as O}from"./chunk-XXCTETRW.js";import"./chunk-4OALHZXB.js";import"./chunk-
|
|
2
|
+
import{a as _,b as O}from"./chunk-XXCTETRW.js";import"./chunk-4OALHZXB.js";import"./chunk-HC7WB764.js";import"./chunk-NTW6IA45.js";import"./chunk-LIYVQA3X.js";import{a as v,b as T}from"./chunk-OOJCYVYF.js";import{a as D}from"./chunk-4PRVMER6.js";import{c as y}from"./chunk-MO4RPBN2.js";import{b as C}from"./chunk-YU6OGPZR.js";import{a as M,b as c}from"./chunk-RLNOQILG.js";import{a as E}from"./chunk-4VDEBYW7.js";import{a as b,b as P}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";import{randomBytes as $}from"node:crypto";import{fileURLToPath as Q}from"node:url";import{Worker as R}from"node:worker_threads";var U=1e4,H=6e4,I={name:"python3",summary:"Execute Python code via CPython Emscripten",usage:"python3 [OPTIONS] [-c CODE | -m MODULE | FILE] [ARGS...]",description:["Execute Python code using CPython compiled to WebAssembly via Emscripten.","","This command runs Python in an isolated environment with access to","the virtual filesystem. Standard library modules are available."],options:["-c CODE Execute CODE as Python script","-m MODULE Run library module as a script","--version Show Python version","--help Show this help"],examples:['python3 -c "print(1 + 2)"','python3 -c "import sys; print(sys.version)"',"python3 script.py","python3 script.py arg1 arg2",`echo 'print("hello")' | python3`],notes:["CPython runs in WebAssembly, so execution may be slower than native Python.","Standard library modules are available (no pip install).","Maximum execution time is 30 seconds by default."]};function L(r){let e={code:null,module:null,scriptFile:null,showVersion:!1,scriptArgs:[]};if(r.length===0)return e;let t=r.findIndex(o=>!o.startsWith("-")||o==="-"||o==="--");for(let o=0;o<(t===-1?r.length:t);o++){let s=r[o];if(s==="-c")return o+1>=r.length?{stdout:"",stderr:`python3: option requires an argument -- 'c'
|
|
3
3
|
`,exitCode:2}:(e.code=r[o+1],e.scriptArgs=r.slice(o+2),e);if(s==="-m")return o+1>=r.length?{stdout:"",stderr:`python3: option requires an argument -- 'm'
|
|
4
4
|
`,exitCode:2}:(e.module=r[o+1],e.scriptArgs=r.slice(o+2),e);if(s==="--version"||s==="-V")return e.showVersion=!0,e;if(s.startsWith("-")&&s!=="-")return{stdout:"",stderr:`python3: unrecognized option '${s}'
|
|
5
5
|
`,exitCode:2}}if(t!==-1){let o=r[t];o==="--"?t+1<r.length&&(e.scriptFile=r[t+1],e.scriptArgs=r.slice(t+2)):(e.scriptFile=o,e.scriptArgs=r.slice(t+1))}return e}var k=new WeakMap;function z(r){let e=k.get(r);return e||(e={executionQueue:[],isExecuting:!1},k.set(r,e)),e}function ie(){k=new WeakMap}var N=Q(new URL("./worker.js",import.meta.url));function B(){return $(16).toString("hex")}function V(r,e){if(!r||typeof r!="object")return{success:!1,error:"Malformed worker response"};let t=r;return typeof t.protocolToken!="string"||t.protocolToken!==e?{success:!1,error:"Malformed worker response: invalid protocol token"}:t.type==="security-violation"?{success:!1,error:`Security violation: ${typeof t.violation?.type=="string"?t.violation.type:"unknown"}`}:typeof t.success!="boolean"?{success:!1,error:"Malformed worker response: missing success flag"}:t.success?{success:!0}:{success:!1,error:typeof t.error=="string"&&t.error.length>0?t.error:"Worker execution failed"}}function a(r){if(r.isExecuting||r.executionQueue.length===0)return;for(;r.executionQueue.length>0&&r.executionQueue[0].canceled;)r.executionQueue.shift();if(r.executionQueue.length===0)return;let e=r.executionQueue.shift();if(!e)return;r.isExecuting=!0;let t;try{t=C.runTrusted(()=>new R(N,{workerData:e.input}))}catch(n){let i=n instanceof Error?n.message:String(n);e.resolve({success:!1,error:c(i)}),r.isExecuting=!1,a(r);return}e.workerRef&&(e.workerRef.current=t);let o=y(e.requireDefenseContext,"python3","worker message callback",n=>{e.resolve(V(n,e.input.protocolToken)),r.isExecuting=!1,t.terminate(),a(r)}),s=y(e.requireDefenseContext,"python3","worker error callback",n=>{let i=c(E(n));e.resolve({success:!1,error:i}),r.isExecuting=!1,a(r)}),p=y(e.requireDefenseContext,"python3","worker exit callback",()=>{r.isExecuting&&(e.resolve({success:!1,error:"Worker exited unexpectedly"}),r.isExecuting=!1,a(r))}),f=n=>{try{o(n)}catch(i){let m=i instanceof Error?i.message:String(i);e.resolve({success:!1,error:c(m)}),r.isExecuting=!1,t.terminate(),a(r)}},l=n=>{try{s(n)}catch(i){let m=i instanceof Error?i.message:String(i);e.resolve({success:!1,error:c(m)}),r.isExecuting=!1,a(r)}},g=()=>{try{p()}catch(n){let i=n instanceof Error?n.message:String(n);e.resolve({success:!1,error:c(i)}),r.isExecuting=!1,a(r)}};t.on("message",f),t.on("error",l),t.on("exit",g)}async function j(r,e,t,o=[]){let s=_(),p=new O(s,e.fs,e.cwd,"python3",e.fetch,e.limits?.maxOutputSize??0),f=e.limits?.maxPythonTimeoutMs??U,l=e.fetch?Math.max(f,H):f,g=z(e.fs),n={protocolToken:B(),sharedBuffer:s,pythonCode:r,cwd:e.cwd,env:D(e.env),args:o,scriptPath:t,timeoutMs:l},i={current:null},m=new Promise(u=>{let d={input:n,resolve:()=>{},workerRef:i,requireDefenseContext:e.requireDefenseContext},A=y(e.requireDefenseContext,"python3","worker timeout callback",()=>{i.current?i.current.terminate():d.canceled=!0,u({success:!1,error:`Execution timeout: exceeded ${l}ms limit`})}),F=v(()=>{try{A()}catch(h){let W=h instanceof Error?h.message:String(h);u({success:!1,error:c(W)})}},l);d.resolve=h=>{T(F),u(h)},g.executionQueue.push(d),a(g)}),[x,w]=await Promise.all([p.run(l).catch(u=>({stdout:"",stderr:`python3: bridge error: ${c(E(u))}
|
|
6
6
|
`,exitCode:1})),m.catch(u=>({success:!1,error:c(E(u))}))]);if(!w.success&&w.error){let u=c(w.error);return{stdout:x.stdout,stderr:`${x.stderr}python3: ${u}
|
|
7
7
|
`,exitCode:x.exitCode||1}}return x}var Y={name:"python3",async execute(r,e){if(P(r))return b(I);let t=L(r);if("exitCode"in t)return t;if(t.showVersion)return{stdout:`Python 3.13.2 (Emscripten)
|
|
8
8
|
`,stderr:"",exitCode:0};let o,s;if(t.code!==null)o=t.code,s="-c";else if(t.module!==null){if(!/^[a-zA-Z_][a-zA-Z0-9_.]*$/.test(t.module))return{stdout:"",stderr:`python3: No module named '${t.module.slice(0,200)}'
|
|
9
|
-
`,exitCode:1};o=`import runpy; runpy.run_module('${t.module}', run_name='__main__')`,s=t.module}else if(t.scriptFile!==null){let p=e.fs.resolvePath(e.cwd,t.scriptFile);if(!await e.fs.exists(p))return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': [Errno 2] No such file or directory
|
|
9
|
+
`,exitCode:1};o=`import runpy; runpy.run_module('${t.module}', run_name='__main__')`,s=t.module}else if(t.scriptFile==="-")o=e.stdin,s="-";else if(t.scriptFile!==null){let p=e.fs.resolvePath(e.cwd,t.scriptFile);if(!await e.fs.exists(p))return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': [Errno 2] No such file or directory
|
|
10
10
|
`,exitCode:2};try{o=await e.fs.readFile(p),s=t.scriptFile}catch(f){let l=M(f.message);return{stdout:"",stderr:`python3: can't open file '${t.scriptFile}': ${l}
|
|
11
11
|
`,exitCode:2}}}else if(e.stdin.trim())o=e.stdin,s="<stdin>";else return{stdout:"",stderr:`python3: no input provided (use -c CODE, -m MODULE, or provide a script file)
|
|
12
12
|
`,exitCode:2};return j(o,e,s,t.scriptArgs)}},ce={name:"python",async execute(r,e){return Y.execute(r,e)}};export{ie as _resetExecutionQueue,Y as python3Command,ce as pythonCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-PNI5NMXP.js";import"./chunk-MO4RPBN2.js";import"./chunk-YU6OGPZR.js";import"./chunk-JDNI5HBX.js";import"./chunk-6KZRLMG3.js";import"./chunk-RLNOQILG.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as sedCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b,c}from"./chunk-
|
|
2
|
+
import{a,b,c}from"./chunk-EFPTD2CS.js";import"./chunk-OOJCYVYF.js";import"./chunk-MO4RPBN2.js";import"./chunk-YU6OGPZR.js";import"./chunk-RLNOQILG.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{a as _internals,c as flagsForFuzzing,b as sqlite3Command};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-AX6NCIX6.js";import"./chunk-RBQGQWGV.js";import"./chunk-4CFAYBLV.js";import"./chunk-ARI4VLCN.js";import"./chunk-V7ZOPVQS.js";import"./chunk-4PRVMER6.js";import"./chunk-MO4RPBN2.js";import"./chunk-YU6OGPZR.js";import"./chunk-JDNI5HBX.js";import"./chunk-5WFYIUU2.js";import"./chunk-6KZRLMG3.js";import"./chunk-OBH7XN5N.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as xanCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a,b}from"./chunk-
|
|
2
|
+
import{a,b}from"./chunk-2HVFB2TU.js";import"./chunk-4CFAYBLV.js";import"./chunk-ARI4VLCN.js";import"./chunk-V7ZOPVQS.js";import"./chunk-4PRVMER6.js";import"./chunk-MO4RPBN2.js";import"./chunk-YU6OGPZR.js";import"./chunk-JDNI5HBX.js";import"./chunk-6KZRLMG3.js";import"./chunk-RLNOQILG.js";import"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";export{b as flagsForFuzzing,a as yqCommand};
|