just-bash 2.5.3 → 2.5.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.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ function _(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,s)=>{if(i==="&")return n[0];if(s!==void 0)return n.groups?.[s]??"";let d=parseInt(i,10);return n[d]??""})}function F(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:s=!1,countOnly:d=!1,countMatches:$=!1,filename:h="",onlyMatching:I=!1,beforeContext:z=0,afterContext:O=0,maxCount:A=0,contextSeparator:Z="--",showColumn:P=!1,vimgrep:E=!1,showByteOffset:S=!1,replace:b=null,passthru:R=!1,multiline:T=!1,kResetGroup:k}=e;if(T)return K(t,n,{invertMatch:i,showLineNumbers:s,countOnly:d,countMatches:$,filename:h,onlyMatching:I,beforeContext:z,afterContext:O,maxCount:A,contextSeparator:Z,showColumn:P,showByteOffset:S,replace:b,kResetGroup:k});let m=t.split(`
3
+ `),j=m.length,v=j>0&&m[j-1]===""?j-1:j;if(d||$){let f=0,a=($||I)&&!i;for(let l=0;l<v;l++)if(n.lastIndex=0,a)for(let u=n.exec(m[l]);u!==null;u=n.exec(m[l]))f++,u[0].length===0&&n.lastIndex++;else n.test(m[l])!==i&&f++;return{output:`${h?`${h}:${f}`:String(f)}
4
+ `,matched:f>0,matchCount:f}}if(z===0&&O===0&&!R){let f=[],a=!1,o=0,l=0;for(let u=0;u<v&&!(A>0&&o>=A);u++){let L=m[u];if(n.lastIndex=0,n.test(L)!==i)if(a=!0,o++,I){n.lastIndex=0;for(let r=n.exec(L);r!==null;r=n.exec(L)){let M=k!==void 0?r[k]??"":r[0],N=b!==null?_(b,r):M,y=h?`${h}:`:"";S&&(y+=`${l+r.index}:`),s&&(y+=`${u+1}:`),P&&(y+=`${r.index+1}:`),f.push(y+N),r[0].length===0&&n.lastIndex++}}else if(E){n.lastIndex=0;for(let r=n.exec(L);r!==null;r=n.exec(L)){let M=h?`${h}:`:"";S&&(M+=`${l+r.index}:`),s&&(M+=`${u+1}:`),P&&(M+=`${r.index+1}:`),f.push(M+L),r[0].length===0&&n.lastIndex++}}else{n.lastIndex=0;let r=n.exec(L),M=r?r.index+1:1,N=L;b!==null&&(n.lastIndex=0,N=L.replace(n,(...w)=>{if(w[0].length===0)return"";let U=w,B=w[w.length-1];return typeof B=="object"&&B!==null?(U.groups=B,U.input=w[w.length-2],U.index=w[w.length-3]):(U.input=w[w.length-1],U.index=w[w.length-2]),_(b,U)}));let y=h?`${h}:`:"";S&&(y+=`${l+(r?r.index:0)}:`),s&&(y+=`${u+1}:`),P&&(y+=`${M}:`),f.push(y+N)}l+=L.length+1}return{output:f.length>0?`${f.join(`
5
+ `)}
6
+ `:"",matched:a,matchCount:o}}if(R){let f=[],a=!1,o=0;for(let l=0;l<v;l++){let u=m[l];n.lastIndex=0;let G=n.test(u)!==i;G&&(a=!0,o++);let r=G?":":"-",M=h?`${h}${r}`:"";s&&(M+=`${l+1}${r}`),f.push(M+u)}return{output:f.length>0?`${f.join(`
7
+ `)}
8
+ `:"",matched:a,matchCount:o}}let x=[],C=0,p=new Set,g=-1,c=[];for(let f=0;f<v&&!(A>0&&C>=A);f++)n.lastIndex=0,n.test(m[f])!==i&&(c.push(f),C++);for(let f of c){let a=Math.max(0,f-z);g>=0&&a>g+1&&x.push(Z);for(let l=a;l<f;l++)if(!p.has(l)){p.add(l),g=l;let u=m[l];s&&(u=`${l+1}-${u}`),h&&(u=`${h}-${u}`),x.push(u)}if(!p.has(f)){p.add(f),g=f;let l=m[f];if(I){n.lastIndex=0;for(let u=n.exec(l);u!==null;u=n.exec(l)){let L=k!==void 0?u[k]??"":u[0],G=b!==null?b:L,r=h?`${h}:`:"";s&&(r+=`${f+1}:`),P&&(r+=`${u.index+1}:`),x.push(r+G),u[0].length===0&&n.lastIndex++}}else{let u=l;s&&(u=`${f+1}:${u}`),h&&(u=`${h}:${u}`),x.push(u)}}let o=Math.min(v-1,f+O);for(let l=f+1;l<=o;l++)if(!p.has(l)){p.add(l),g=l;let u=m[l];s&&(u=`${l+1}-${u}`),h&&(u=`${h}-${u}`),x.push(u)}}return{output:x.length>0?`${x.join(`
9
+ `)}
10
+ `:"",matched:C>0,matchCount:C}}function K(t,n,e){let{invertMatch:i,showLineNumbers:s,countOnly:d,countMatches:$,filename:h,onlyMatching:I,beforeContext:z,afterContext:O,maxCount:A,contextSeparator:Z,showColumn:P,showByteOffset:E,replace:S,kResetGroup:b}=e,R=t.split(`
11
+ `),T=R.length,k=T>0&&R[T-1]===""?T-1:T,m=[0];for(let c=0;c<t.length;c++)t[c]===`
12
+ `&&m.push(c+1);let j=c=>{let f=0;for(let a=0;a<m.length&&!(m[a]>c);a++)f=a;return f},v=c=>{let f=j(c);return c-m[f]+1},x=[];n.lastIndex=0;for(let c=n.exec(t);c!==null&&!(A>0&&x.length>=A);c=n.exec(t)){let f=j(c.index),a=j(c.index+Math.max(0,c[0].length-1)),o=b!==void 0?c[b]??"":c[0];x.push({startLine:f,endLine:a,byteOffset:c.index,column:v(c.index),matchText:o}),c[0].length===0&&n.lastIndex++}if(d||$){let c;if($)c=i?0:x.length;else{let a=new Set;for(let o of x)for(let l=o.startLine;l<=o.endLine;l++)a.add(l);c=i?k-a.size:a.size}return{output:`${h?`${h}:${c}`:String(c)}
13
+ `,matched:c>0,matchCount:c}}if(i){let c=new Set;for(let a of x)for(let o=a.startLine;o<=a.endLine;o++)c.add(o);let f=[];for(let a=0;a<k;a++)if(!c.has(a)){let o=R[a];s&&(o=`${a+1}:${o}`),h&&(o=`${h}:${o}`),f.push(o)}return{output:f.length>0?`${f.join(`
14
+ `)}
15
+ `:"",matched:f.length>0,matchCount:f.length}}if(x.length===0)return{output:"",matched:!1,matchCount:0};let C=new Set,p=-1,g=[];for(let c of x){let f=Math.max(0,c.startLine-z),a=Math.min(k-1,c.endLine+O);p>=0&&f>p+1&&g.push(Z);for(let o=f;o<c.startLine;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];s&&(l=`${o+1}-${l}`),h&&(l=`${h}-${l}`),g.push(l)}if(I){let o=S!==null?S:c.matchText,l=h?`${h}:`:"";E&&(l+=`${c.byteOffset}:`),s&&(l+=`${c.startLine+1}:`),P&&(l+=`${c.column}:`),g.push(l+o);for(let u=c.startLine;u<=c.endLine;u++)C.add(u),p=u}else for(let o=c.startLine;o<=c.endLine&&o<k;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];S!==null&&o===c.startLine&&(n.lastIndex=0,l=l.replace(n,S));let u=h?`${h}:`:"";E&&o===c.startLine&&(u+=`${c.byteOffset}:`),s&&(u+=`${o+1}:`),P&&o===c.startLine&&(u+=`${c.column}:`),g.push(u+l)}for(let o=c.endLine+1;o<=a;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];s&&(l=`${o+1}-${l}`),h&&(l=`${h}-${l}`),g.push(l)}}return{output:g.length>0?`${g.join(`
16
+ `)}
17
+ `:"",matched:!0,matchCount:x.length}}function Q(t,n){let e,i;switch(n.mode){case"fixed":e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=t.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),n.mode==="perl"){e=q(e),e=D(e),e=W(e);let $=X(e);e=$.pattern,i=$.kResetGroup}break}default:e=ne(t);break}n.wholeWord&&(e=`(?<![\\w])(?:${e})(?![\\w])`),n.lineRegexp&&(e=`^${e}$`);let s=/\\u\{[0-9A-Fa-f]+\}/.test(e),d="g"+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.multilineDotall?"s":"")+(s?"u":"");return{regex:new RegExp(e,d),kResetGroup:i}}function q(t){let n="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="Q"){e+=2;let i="";for(;e<t.length;){if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="E"){e+=2;break}i+=t[e],e++}n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else n+=t[e],e++;return n}function D(t){return t.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function W(t){let n="",e=0;for(;e<t.length;){if(t[e]==="("&&e+1<t.length&&t[e+1]==="?"){let i=t.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let s=i[1]||"",d=i[2]||"",$=i[3];if($===":"){let h=e+i[0].length-1,I=H(t,e);if(I!==-1){let z=t.slice(h+1,I),O=J(z,s,d);n+=`(?:${O})`,e=I+1;continue}}else if($===")"||$===""){e+=i[0].length;continue}}}n+=t[e],e++}return n}function H(t,n){let e=0,i=n;for(;i<t.length;){if(t[i]==="\\"){i+=2;continue}if(t[i]==="["){for(i++;i<t.length&&t[i]!=="]";)t[i]==="\\"&&i++,i++;i++;continue}if(t[i]==="(")e++;else if(t[i]===")"&&(e--,e===0))return i;i++}return-1}function J(t,n,e){let i=t;return n.includes("i")&&(i=V(i)),i}function V(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"){e+1<t.length?(n+=i+t[e+1],e+=2):(n+=i,e++);continue}if(i==="["){n+=i,e++,e<t.length&&t[e]==="^"&&(n+=t[e],e++);let s=[];for(;e<t.length&&t[e]!=="]";)if(t[e]==="\\")s.push(t[e]),e++,e<t.length&&(s.push(t[e]),e++);else if(t[e]==="-"&&s.length>0&&e+1<t.length&&t[e+1]!=="]"){let d=s[s.length-1],$=t[e+1];s.push("-"),s.push($),/[a-z]/.test(d)&&/[a-z]/.test($)?(s.push(d.toUpperCase()),s.push("-"),s.push($.toUpperCase())):/[A-Z]/.test(d)&&/[A-Z]/.test($)&&(s.push(d.toLowerCase()),s.push("-"),s.push($.toLowerCase())),e+=2}else{let d=t[e];if(s.push(d),/[a-zA-Z]/.test(d)){let $=d===d.toLowerCase()?d.toUpperCase():d.toLowerCase();s.includes($)||s.push($)}e++}n+=s.join(""),e<t.length&&(n+=t[e],e++);continue}if(/[a-zA-Z]/.test(i)){let s=i.toLowerCase(),d=i.toUpperCase();n+=`[${d}${s}]`}else n+=i;e++}return n}function X(t){let n=Y(t);if(n===-1)return{pattern:t};let e=t.slice(0,n),i=t.slice(n+2),s=ee(e);return{pattern:`(?:${e})(${i})`,kResetGroup:s+1}}function Y(t){let n=0;for(;n<t.length-1;)if(t[n]==="\\"){if(t[n+1]==="K"){let e=0,i=n-1;for(;i>=0&&t[i]==="\\";)e++,i--;if(e%2===0)return n}n+=2}else n++;return-1}function ee(t){let n=0,e=0;for(;e<t.length;){if(t[e]==="\\"){e+=2;continue}if(t[e]==="["){for(e++;e<t.length&&t[e]!=="]";)t[e]==="\\"&&e++,e++;e++;continue}if(t[e]==="(")if(e+1<t.length&&t[e+1]==="?"){if(e+2<t.length){let i=t[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<t.length){let s=t[e+3];if(s==="="||s==="!"){e++;continue}n++,e++;continue}}}else n++;e++}return n}function te(t){let n=t.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return n=n.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),n}function ne(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"&&e+1<t.length){let s=t[e+1];if(s==="|"||s==="("||s===")"){n+=s,e+=2;continue}else if(s==="{"||s==="}"){n+=`\\${s}`,e+=2;continue}}i==="+"||i==="?"||i==="|"||i==="("||i===")"||i==="{"||i==="}"?n+=`\\${i}`:n+=i,e++}return n}export{F as a,Q as b,te as c};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as y}from"./chunk-26Q3PZQ6.js";import{a as S,b as z}from"./chunk-UKYJ3JMW.js";import{a as _,b as j,c as G}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var te={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},J={name:"grep",async execute(t,s){if(j(t))return _(te);let o=!1,f=!1,c=!1,h=!1,m=!1,l=!1,i=!1,d=!1,w=!1,u=!1,p=!1,T=!1,x=!1,q=!1,B=!1,M=0,R=0,F=0,W=[],A=[],Q=[],N=null,I=[];for(let r=0;r<t.length;r++){let n=t[r];if(n.startsWith("-")&&n!=="-"){if(n==="-e"&&r+1<t.length){N=t[++r];continue}if(n.startsWith("--include=")){W.push(n.slice(10));continue}if(n.startsWith("--exclude=")){A.push(n.slice(10));continue}if(n.startsWith("--exclude-dir=")){Q.push(n.slice(14));continue}if(n.startsWith("--max-count=")){M=parseInt(n.slice(12),10);continue}let C=n.match(/^-m(\d+)$/);if(C){M=parseInt(C[1],10);continue}if(n==="-m"&&r+1<t.length){M=parseInt(t[++r],10);continue}let a=n.match(/^-([ABC])(\d+)$/);if(a){let e=parseInt(a[2],10);a[1]==="A"?F=e:a[1]==="B"?R=e:a[1]==="C"&&(R=e,F=e);continue}if((n==="-A"||n==="-B"||n==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);n==="-A"?F=e:n==="-B"?R=e:(R=e,F=e);continue}let g=n.startsWith("--")?[n]:n.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")o=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")h=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")l=!0;else if(e==="r"||e==="R"||e==="--recursive")i=!0;else if(e==="w"||e==="--word-regexp")d=!0;else if(e==="x"||e==="--line-regexp")w=!0;else if(e==="E"||e==="--extended-regexp")u=!0;else if(e==="P"||e==="--perl-regexp")p=!0;else if(e==="F"||e==="--fixed-strings")T=!0;else if(e==="o"||e==="--only-matching")x=!0;else if(e==="h"||e==="--no-filename")q=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else N===null?N=n:I.push(n)}if(N===null)return{stdout:"",stderr:`grep: missing pattern
2
+ import{a as y}from"./chunk-26Q3PZQ6.js";import{a as S,b as z}from"./chunk-DV5HL4K2.js";import{a as _,b as j,c as G}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var te={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},J={name:"grep",async execute(t,s){if(j(t))return _(te);let o=!1,f=!1,c=!1,h=!1,m=!1,l=!1,i=!1,d=!1,w=!1,u=!1,p=!1,T=!1,x=!1,q=!1,B=!1,M=0,R=0,F=0,W=[],A=[],Q=[],N=null,I=[];for(let r=0;r<t.length;r++){let n=t[r];if(n.startsWith("-")&&n!=="-"){if(n==="-e"&&r+1<t.length){N=t[++r];continue}if(n.startsWith("--include=")){W.push(n.slice(10));continue}if(n.startsWith("--exclude=")){A.push(n.slice(10));continue}if(n.startsWith("--exclude-dir=")){Q.push(n.slice(14));continue}if(n.startsWith("--max-count=")){M=parseInt(n.slice(12),10);continue}let C=n.match(/^-m(\d+)$/);if(C){M=parseInt(C[1],10);continue}if(n==="-m"&&r+1<t.length){M=parseInt(t[++r],10);continue}let a=n.match(/^-([ABC])(\d+)$/);if(a){let e=parseInt(a[2],10);a[1]==="A"?F=e:a[1]==="B"?R=e:a[1]==="C"&&(R=e,F=e);continue}if((n==="-A"||n==="-B"||n==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);n==="-A"?F=e:n==="-B"?R=e:(R=e,F=e);continue}let g=n.startsWith("--")?[n]:n.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")o=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")h=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")l=!0;else if(e==="r"||e==="R"||e==="--recursive")i=!0;else if(e==="w"||e==="--word-regexp")d=!0;else if(e==="x"||e==="--line-regexp")w=!0;else if(e==="E"||e==="--extended-regexp")u=!0;else if(e==="P"||e==="--perl-regexp")p=!0;else if(e==="F"||e==="--fixed-strings")T=!0;else if(e==="o"||e==="--only-matching")x=!0;else if(e==="h"||e==="--no-filename")q=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else N===null?N=n:I.push(n)}if(N===null)return{stdout:"",stderr:`grep: missing pattern
3
3
  `,exitCode:2};let V=T?"fixed":u?"extended":p?"perl":"basic",U,b;try{let r=z(N,{mode:V,ignoreCase:o,wholeWord:d,lineRegexp:w});U=r.regex,b=r.kResetGroup}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${N}
4
4
  `,exitCode:2}}if(I.length===0&&s.stdin){let r=S(s.stdin,U,{invertMatch:c,showLineNumbers:f,countOnly:h,filename:"",onlyMatching:x,beforeContext:R,afterContext:F,maxCount:M,kResetGroup:b});return B?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(I.length===0)return{stdout:"",stderr:`grep: no input files
5
5
  `,exitCode:2};let $="",D="",H=!1,k=!1,P=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let n=await se(r,s);if(i)for(let C of n){let a=await O(C.path,s,W,A,Q,C.isFile);P.push(...a)}else P.push(...n)}else if(i){let n=await O(r,s,W,A,Q);P.push(...n)}else P.push({path:r});let X=(P.length>1||i)&&!q,Z=50;for(let r=0;r<P.length;r+=Z){let n=P.slice(r,r+Z),C=await Promise.all(n.map(async a=>{let g=a.path,e=g.split("/").pop()||g;if(A.length>0&&!i&&A.some(v=>y(e,v,{stripQuotes:!0}))||W.length>0&&!i&&!W.some(v=>y(e,v,{stripQuotes:!0})))return null;try{let v=s.fs.resolvePath(s.cwd,g),L=!1;if(a.isFile===void 0?L=(await s.fs.stat(v)).isDirectory:L=!a.isFile,L)return i?null:{error:`grep: ${g}: Is a directory
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as E,b as A,c as z}from"./chunk-UKYJ3JMW.js";import{a as L,b as _,c as j}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var B={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},$=class{types;constructor(){this.types=new Map(Object.entries(B).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(new RegExp(`^${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(new RegExp(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function G(){let e=[];for(let[t,n]of Object.entries(B).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(`
2
+ import{a as E,b as A,c as z}from"./chunk-DV5HL4K2.js";import{a as L,b as _,c as j}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var B={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},$=class{types;constructor(){this.types=new Map(Object.entries(B).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(new RegExp(`^${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(new RegExp(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function G(){let e=[];for(let[t,n]of Object.entries(B).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 U(){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:1/0,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function X(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 Q(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
5
5
  `,exitCode:1}}function q(e){return null}var V=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:q},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:q},{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:X,validate:Q},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",target:"maxDepth",parse:()=>1/0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],ee={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}},te=new Set(["n","--line-number"]);function se(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function ne(e,t,n){let s=e[t];for(let r of V){if(s.startsWith(`--${r.long}=`)){let l=s.slice(`--${r.long}=`.length),i=D(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=D(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=D(n,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function re(e){return V.find(t=>t.short===e)}function D(e,t,n){if(t.validate){let r=t.validate(n);if(r)return r}let s=t.parse?t.parse(n):n;t.multi?e[t.target].push(s):e[t.target]=s}function ie(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 le(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 oe(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function Z(e){let t=U(),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=le(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 m=oe(a);if(m!==null){t.maxCount=m;continue}let p=ne(e,c,t);if(p){if(p.error)return{success:!1,error:p.error};c=p.newIndex;continue}let g=ie(e,c);if(g){t.sort=g.value,c=g.newIndex;continue}let w=a.startsWith("--")?[a]:a.slice(1).split(""),d=!1;for(let f of w){if(te.has(f)){t.lineNumber=!0,o=!0;continue}if(f==="u"||f==="--unrestricted"){se(t);continue}if(f==="P"||f==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as z,b as K,c as U,d as Y,e as X,f as k,g as W,h as me,i as B,j as ie,k as Ue}from"./chunks/chunk-NWWB2XRE.js";import"./chunks/chunk-OBH7XN5N.js";import{a as se}from"./chunks/chunk-4VDEBYW7.js";import"./chunks/chunk-KGOUQS5A.js";import{resolve as Mn}from"node:path";var ge=[{name:"echo",load:async()=>(await import("./chunks/echo-WSKTON6U.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-AJXZOSPN.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-HWUQKYUM.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-BEHQBUMC.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-XJABRAUN.js")).mkdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TSNAXMZ2.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-2PKAWTSQ.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XXWRVG2D.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-3ATZ2ABL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-EFFNQ3RY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-3DIKREF7.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-53KG2MCJ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-VL3R4LAM.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-DYK37Z24.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-BES27CZT.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-QSBRKIF5.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-UEQ7KMY5.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-JUSJYJL4.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-JUSJYJL4.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-JUSJYJL4.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-4VGBMMUO.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-5LQMJYRJ.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-D2US2LMM.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-KUHOCH5S.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-IXHB2FVS.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-CPIFQTKY.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-IHF6BEOO.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-FT6WBQZG.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-MBLEXZBI.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-VP42N2JN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-DSM3NUGM.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-452R4I2C.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-77K5HH2M.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-BFVYAPOU.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-ZEKN6D4Q.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-JJFZRWRC.js")).split},{name:"column",load:async()=>(await import("./chunks/column-TSFEMTG6.js")).column},{name:"join",load:async()=>(await import("./chunks/join-3IXMEGNA.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-ZFIT2GTM.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-CBEJ35BR.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-SO5MVUEX.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-EES7TR26.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-DQBEJH47.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-XQPYLN3H.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-G5C2J2OY.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-IWT2HHEA.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-CI7A5IXQ.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-XXZPU5CA.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-O7TCK5TL.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-GI3QVUGD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-IQLPMFYI.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-O5BOTJGJ.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-JED4EKFH.js")).timeoutCommand},{name:"seq",load:async()=>(await import("./chunks/seq-AVK43XM2.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-RMGXYNQJ.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-2VAAFCTS.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-67P4ME4N.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-MV3WQ4QF.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-LNCFDPQZ.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-EPEXKI4B.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-7C5JICNL.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-73KOOLC6.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-KNRFDAY7.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WXDKRL2Z.js")).hostname},{name:"od",load:async()=>(await import("./chunks/od-SLM7SRWU.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ge.push({name:"tar",load:async()=>(await import("./chunks/tar-C27YYUAS.js")).tarCommand}),ge.push({name:"yq",load:async()=>(await import("./chunks/yq-MF2SNFGL.js")).yqCommand}),ge.push({name:"xan",load:async()=>(await import("./chunks/xan-6K2NGTHM.js")).xanCommand}),ge.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-THMDBIGF.js")).sqlite3Command}));var zn=[{name:"curl",load:async()=>(await import("./chunks/curl-LCMREE7R.js")).curlCommand}],hr=new Map;function mr(t){return{name:t.name,async execute(e,n){let r=hr.get(t.name);return r||(r=await t.load(),hr.set(t.name,r)),r.execute(e,n)}}}function pr(t){return(t?ge.filter(n=>t.includes(n.name)):ge).map(mr)}function yr(){return zn.map(mr)}function wr(t){return"load"in t&&typeof t.load=="function"}function Er(t){let e=null;return{name:t.name,async execute(n,r){return e||(e=await t.load()),e.execute(n,r)}}}var Un=new TextEncoder,jn=new TextDecoder;function Ae(t,e){if(t instanceof Uint8Array)return t;if(e==="base64")return Uint8Array.from(atob(t),n=>n.charCodeAt(0));if(e==="hex"){let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=parseInt(t.slice(r,r+2),16);return n}return e==="binary"||e==="latin1"?Uint8Array.from(t,n=>n.charCodeAt(0)):Un.encode(t)}function je(t,e){return e==="base64"?btoa(String.fromCharCode(...t)):e==="hex"?Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join(""):e==="binary"||e==="latin1"?String.fromCharCode(...t):jn.decode(t)}function oe(t){if(t!=null)return typeof t=="string"?t:t.encoding??void 0}var Ge=new TextEncoder;function Gn(t){return typeof t=="object"&&t!==null&&!(t instanceof Uint8Array)&&"content"in t}var ke=class{data=new Map;constructor(e){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),e)for(let[n,r]of Object.entries(e))Gn(r)?this.writeFileSync(n,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(n,r)}normalizePath(e){if(!e||e==="/")return"/";let n=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;n.startsWith("/")||(n=`/${n}`);let r=n.split("/").filter(o=>o&&o!=="."),s=[];for(let o of r)o===".."?s.pop():s.push(o);return`/${s.join("/")}`||"/"}dirname(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.lastIndexOf("/");return r===0?"/":n.slice(0,r)}ensureParentDirs(e){let n=this.dirname(e);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(e,n,r,s){let o=this.normalizePath(e);this.ensureParentDirs(o);let i=oe(r),a=Ae(n,i);this.data.set(o,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}async readFile(e,n){let r=await this.readFileBuffer(e),s=oe(n);return je(r,s)}async readFileBuffer(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${e}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${e}'`);return r.content instanceof Uint8Array?r.content:Ge.encode(r.content)}async writeFile(e,n,r){this.writeFileSync(e,n,r)}async appendFile(e,n,r){let s=this.normalizePath(e),o=this.data.get(s);if(o&&o.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${e}'`);let i=oe(r),a=Ae(n,i);if(o?.type==="file"){let l=o.content instanceof Uint8Array?o.content:Ge.encode(o.content),c=new Uint8Array(l.length+a.length);c.set(l),c.set(a,l.length),this.data.set(s,{type:"file",content:c,mode:o.mode,mtime:new Date})}else this.writeFileSync(e,n,r)}async exists(e){try{let n=this.resolvePathWithSymlinks(e);return this.data.has(n)}catch{return!1}}async stat(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${e}'`);let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=Ge.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}async lstat(e){let n=this.resolveIntermediateSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${e}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=Ge.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}resolveSymlink(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=this.dirname(e);return this.normalizePath(r==="/"?`/${n}`:`${r}/${n}`)}resolveIntermediateSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",o=new Set;for(let i=0;i<r.length-1;i++){let a=r[i];s=`${s}/${a}`;let l=this.data.get(s),c=0,f=40;for(;l&&l.type==="symlink"&&c<f;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`);o.add(s),s=this.resolveSymlink(s,l.target),l=this.data.get(s),c++}if(c>=f)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",o=new Set;for(let i of r){s=`${s}/${i}`;let a=this.data.get(s),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`);o.add(s),s=this.resolveSymlink(s,a.target),a=this.data.get(s),l++}if(l>=c)throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`)}return s}async mkdir(e,n){this.mkdirSync(e,n)}mkdirSync(e,n){let r=this.normalizePath(e);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${e}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${e}'`);return}let s=this.dirname(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(e){return(await this.readdirWithFileTypes(e)).map(r=>r.name)}async readdirWithFileTypes(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${e}'`);s.add(n),n=this.resolveSymlink(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);let o=n==="/"?"/":`${n}/`,i=new Map;for(let[a,l]of this.data.entries())if(a!==n&&a.startsWith(o)){let c=a.slice(o.length),f=c.split("/")[0];f&&!c.includes("/",f.length)&&!i.has(f)&&i.set(f,{name:f,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(i.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${e}'`)}if(s.type==="directory"){let o=await this.readdir(r);if(o.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${e}'`);for(let i of o){let a=r==="/"?`/${i}`:`${r}/${i}`;await this.rm(a,n)}}}this.data.delete(r)}async cp(e,n,r){let s=this.normalizePath(e),o=this.normalizePath(n),i=this.data.get(s);if(!i)throw new Error(`ENOENT: no such file or directory, cp '${e}'`);if(i.type==="file")this.ensureParentDirs(o),this.data.set(o,{...i});else if(i.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${e}'`);await this.mkdir(o,{recursive:!0});let a=await this.readdir(s);for(let l of a){let c=s==="/"?`/${l}`:`${s}/${l}`,f=o==="/"?`/${l}`:`${o}/${l}`;await this.cp(c,f,r)}}}async mv(e,n){await this.cp(e,n,{recursive:!0}),await this.rm(e,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=e==="/"?`/${n}`:`${e}/${n}`;return this.normalizePath(r)}async chmod(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${e}'`);s.mode=n}async symlink(e,n){let r=this.normalizePath(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:e,mode:511,mtime:new Date})}async link(e,n){let r=this.normalizePath(e),s=this.normalizePath(n),o=this.data.get(r);if(!o)throw new Error(`ENOENT: no such file or directory, link '${e}'`);if(o.type!=="file")throw new Error(`EPERM: operation not permitted, link '${e}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);this.ensureParentDirs(s),this.data.set(s,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${e}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${e}'`);return r.target}};var gr="5.1.0(1)-release",Ar="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT";function Re(){return{pid:process.pid,ppid:process.ppid,uid:process.getuid?.()??1e3,gid:process.getgid?.()??1e3}}function Sr(){let{pid:t,ppid:e,uid:n,gid:r}=Re();return`Name: bash
2
+ import{a as z,b as K,c as U,d as Y,e as X,f as k,g as W,h as me,i as B,j as ie,k as Ue}from"./chunks/chunk-NWWB2XRE.js";import"./chunks/chunk-OBH7XN5N.js";import{a as se}from"./chunks/chunk-4VDEBYW7.js";import"./chunks/chunk-KGOUQS5A.js";import{resolve as Mn}from"node:path";var ge=[{name:"echo",load:async()=>(await import("./chunks/echo-WSKTON6U.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-AJXZOSPN.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-HWUQKYUM.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-BEHQBUMC.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-XJABRAUN.js")).mkdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TSNAXMZ2.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-2PKAWTSQ.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XXWRVG2D.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-3ATZ2ABL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-EFFNQ3RY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-3DIKREF7.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-53KG2MCJ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-VL3R4LAM.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-DYK37Z24.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-BES27CZT.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-QSBRKIF5.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-UEQ7KMY5.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-IIVQXFNI.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-IIVQXFNI.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-IIVQXFNI.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-Q4OTJOEF.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-5LQMJYRJ.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-D2US2LMM.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-KUHOCH5S.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-IXHB2FVS.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-CPIFQTKY.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-IHF6BEOO.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-FT6WBQZG.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-MBLEXZBI.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-VP42N2JN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-DSM3NUGM.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-452R4I2C.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-77K5HH2M.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-BFVYAPOU.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-ZEKN6D4Q.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-JJFZRWRC.js")).split},{name:"column",load:async()=>(await import("./chunks/column-TSFEMTG6.js")).column},{name:"join",load:async()=>(await import("./chunks/join-3IXMEGNA.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-ZFIT2GTM.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-CBEJ35BR.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-SO5MVUEX.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-EES7TR26.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-DQBEJH47.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-XQPYLN3H.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-G5C2J2OY.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-IWT2HHEA.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-CI7A5IXQ.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-XXZPU5CA.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-O7TCK5TL.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-GI3QVUGD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-IQLPMFYI.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-O5BOTJGJ.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-JED4EKFH.js")).timeoutCommand},{name:"seq",load:async()=>(await import("./chunks/seq-AVK43XM2.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-RMGXYNQJ.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-2VAAFCTS.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-67P4ME4N.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-MV3WQ4QF.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-LNCFDPQZ.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-EPEXKI4B.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-7C5JICNL.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-73KOOLC6.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-KNRFDAY7.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WXDKRL2Z.js")).hostname},{name:"od",load:async()=>(await import("./chunks/od-SLM7SRWU.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ge.push({name:"tar",load:async()=>(await import("./chunks/tar-C27YYUAS.js")).tarCommand}),ge.push({name:"yq",load:async()=>(await import("./chunks/yq-MF2SNFGL.js")).yqCommand}),ge.push({name:"xan",load:async()=>(await import("./chunks/xan-6K2NGTHM.js")).xanCommand}),ge.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-THMDBIGF.js")).sqlite3Command}));var zn=[{name:"curl",load:async()=>(await import("./chunks/curl-LCMREE7R.js")).curlCommand}],hr=new Map;function mr(t){return{name:t.name,async execute(e,n){let r=hr.get(t.name);return r||(r=await t.load(),hr.set(t.name,r)),r.execute(e,n)}}}function pr(t){return(t?ge.filter(n=>t.includes(n.name)):ge).map(mr)}function yr(){return zn.map(mr)}function wr(t){return"load"in t&&typeof t.load=="function"}function Er(t){let e=null;return{name:t.name,async execute(n,r){return e||(e=await t.load()),e.execute(n,r)}}}var Un=new TextEncoder,jn=new TextDecoder;function Ae(t,e){if(t instanceof Uint8Array)return t;if(e==="base64")return Uint8Array.from(atob(t),n=>n.charCodeAt(0));if(e==="hex"){let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=parseInt(t.slice(r,r+2),16);return n}return e==="binary"||e==="latin1"?Uint8Array.from(t,n=>n.charCodeAt(0)):Un.encode(t)}function je(t,e){return e==="base64"?btoa(String.fromCharCode(...t)):e==="hex"?Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join(""):e==="binary"||e==="latin1"?String.fromCharCode(...t):jn.decode(t)}function oe(t){if(t!=null)return typeof t=="string"?t:t.encoding??void 0}var Ge=new TextEncoder;function Gn(t){return typeof t=="object"&&t!==null&&!(t instanceof Uint8Array)&&"content"in t}var ke=class{data=new Map;constructor(e){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),e)for(let[n,r]of Object.entries(e))Gn(r)?this.writeFileSync(n,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(n,r)}normalizePath(e){if(!e||e==="/")return"/";let n=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;n.startsWith("/")||(n=`/${n}`);let r=n.split("/").filter(o=>o&&o!=="."),s=[];for(let o of r)o===".."?s.pop():s.push(o);return`/${s.join("/")}`||"/"}dirname(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.lastIndexOf("/");return r===0?"/":n.slice(0,r)}ensureParentDirs(e){let n=this.dirname(e);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(e,n,r,s){let o=this.normalizePath(e);this.ensureParentDirs(o);let i=oe(r),a=Ae(n,i);this.data.set(o,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}async readFile(e,n){let r=await this.readFileBuffer(e),s=oe(n);return je(r,s)}async readFileBuffer(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${e}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${e}'`);return r.content instanceof Uint8Array?r.content:Ge.encode(r.content)}async writeFile(e,n,r){this.writeFileSync(e,n,r)}async appendFile(e,n,r){let s=this.normalizePath(e),o=this.data.get(s);if(o&&o.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${e}'`);let i=oe(r),a=Ae(n,i);if(o?.type==="file"){let l=o.content instanceof Uint8Array?o.content:Ge.encode(o.content),c=new Uint8Array(l.length+a.length);c.set(l),c.set(a,l.length),this.data.set(s,{type:"file",content:c,mode:o.mode,mtime:new Date})}else this.writeFileSync(e,n,r)}async exists(e){try{let n=this.resolvePathWithSymlinks(e);return this.data.has(n)}catch{return!1}}async stat(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${e}'`);let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=Ge.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}async lstat(e){let n=this.resolveIntermediateSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${e}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=Ge.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}resolveSymlink(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=this.dirname(e);return this.normalizePath(r==="/"?`/${n}`:`${r}/${n}`)}resolveIntermediateSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",o=new Set;for(let i=0;i<r.length-1;i++){let a=r[i];s=`${s}/${a}`;let l=this.data.get(s),c=0,f=40;for(;l&&l.type==="symlink"&&c<f;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`);o.add(s),s=this.resolveSymlink(s,l.target),l=this.data.get(s),c++}if(c>=f)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",o=new Set;for(let i of r){s=`${s}/${i}`;let a=this.data.get(s),l=0,c=40;for(;a&&a.type==="symlink"&&l<c;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`);o.add(s),s=this.resolveSymlink(s,a.target),a=this.data.get(s),l++}if(l>=c)throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`)}return s}async mkdir(e,n){this.mkdirSync(e,n)}mkdirSync(e,n){let r=this.normalizePath(e);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${e}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${e}'`);return}let s=this.dirname(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(e){return(await this.readdirWithFileTypes(e)).map(r=>r.name)}async readdirWithFileTypes(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${e}'`);s.add(n),n=this.resolveSymlink(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);let o=n==="/"?"/":`${n}/`,i=new Map;for(let[a,l]of this.data.entries())if(a!==n&&a.startsWith(o)){let c=a.slice(o.length),f=c.split("/")[0];f&&!c.includes("/",f.length)&&!i.has(f)&&i.set(f,{name:f,isFile:l.type==="file",isDirectory:l.type==="directory",isSymbolicLink:l.type==="symlink"})}return Array.from(i.values()).sort((a,l)=>a.name<l.name?-1:a.name>l.name?1:0)}async rm(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${e}'`)}if(s.type==="directory"){let o=await this.readdir(r);if(o.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${e}'`);for(let i of o){let a=r==="/"?`/${i}`:`${r}/${i}`;await this.rm(a,n)}}}this.data.delete(r)}async cp(e,n,r){let s=this.normalizePath(e),o=this.normalizePath(n),i=this.data.get(s);if(!i)throw new Error(`ENOENT: no such file or directory, cp '${e}'`);if(i.type==="file")this.ensureParentDirs(o),this.data.set(o,{...i});else if(i.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${e}'`);await this.mkdir(o,{recursive:!0});let a=await this.readdir(s);for(let l of a){let c=s==="/"?`/${l}`:`${s}/${l}`,f=o==="/"?`/${l}`:`${o}/${l}`;await this.cp(c,f,r)}}}async mv(e,n){await this.cp(e,n,{recursive:!0}),await this.rm(e,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=e==="/"?`/${n}`:`${e}/${n}`;return this.normalizePath(r)}async chmod(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${e}'`);s.mode=n}async symlink(e,n){let r=this.normalizePath(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:e,mode:511,mtime:new Date})}async link(e,n){let r=this.normalizePath(e),s=this.normalizePath(n),o=this.data.get(r);if(!o)throw new Error(`ENOENT: no such file or directory, link '${e}'`);if(o.type!=="file")throw new Error(`EPERM: operation not permitted, link '${e}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);this.ensureParentDirs(s),this.data.set(s,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${e}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${e}'`);return r.target}};var gr="5.1.0(1)-release",Ar="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT";function Re(){return{pid:process.pid,ppid:process.ppid,uid:process.getuid?.()??1e3,gid:process.getgid?.()??1e3}}function Sr(){let{pid:t,ppid:e,uid:n,gid:r}=Re();return`Name: bash
3
3
  State: R (running)
4
4
  Pid: ${t}
5
5
  PPid: ${e}
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ function _(t,n){return t.replace(/\$(&|\d+|<([^>]+)>)/g,(e,i,s)=>{if(i==="&")return n[0];if(s!==void 0)return n.groups?.[s]??"";let d=parseInt(i,10);return n[d]??""})}function F(t,n,e={}){let{invertMatch:i=!1,showLineNumbers:s=!1,countOnly:d=!1,countMatches:$=!1,filename:h="",onlyMatching:I=!1,beforeContext:z=0,afterContext:O=0,maxCount:A=0,contextSeparator:Z="--",showColumn:P=!1,vimgrep:E=!1,showByteOffset:S=!1,replace:b=null,passthru:R=!1,multiline:T=!1,kResetGroup:k}=e;if(T)return K(t,n,{invertMatch:i,showLineNumbers:s,countOnly:d,countMatches:$,filename:h,onlyMatching:I,beforeContext:z,afterContext:O,maxCount:A,contextSeparator:Z,showColumn:P,showByteOffset:S,replace:b,kResetGroup:k});let m=t.split(`
3
+ `),j=m.length,v=j>0&&m[j-1]===""?j-1:j;if(d||$){let f=0,a=($||I)&&!i;for(let l=0;l<v;l++)if(n.lastIndex=0,a)for(let u=n.exec(m[l]);u!==null;u=n.exec(m[l]))f++,u[0].length===0&&n.lastIndex++;else n.test(m[l])!==i&&f++;return{output:`${h?`${h}:${f}`:String(f)}
4
+ `,matched:f>0,matchCount:f}}if(z===0&&O===0&&!R){let f=[],a=!1,o=0,l=0;for(let u=0;u<v&&!(A>0&&o>=A);u++){let L=m[u];if(n.lastIndex=0,n.test(L)!==i)if(a=!0,o++,I){n.lastIndex=0;for(let r=n.exec(L);r!==null;r=n.exec(L)){let M=k!==void 0?r[k]??"":r[0],N=b!==null?_(b,r):M,y=h?`${h}:`:"";S&&(y+=`${l+r.index}:`),s&&(y+=`${u+1}:`),P&&(y+=`${r.index+1}:`),f.push(y+N),r[0].length===0&&n.lastIndex++}}else if(E){n.lastIndex=0;for(let r=n.exec(L);r!==null;r=n.exec(L)){let M=h?`${h}:`:"";S&&(M+=`${l+r.index}:`),s&&(M+=`${u+1}:`),P&&(M+=`${r.index+1}:`),f.push(M+L),r[0].length===0&&n.lastIndex++}}else{n.lastIndex=0;let r=n.exec(L),M=r?r.index+1:1,N=L;b!==null&&(n.lastIndex=0,N=L.replace(n,(...w)=>{if(w[0].length===0)return"";let U=w,B=w[w.length-1];return typeof B=="object"&&B!==null?(U.groups=B,U.input=w[w.length-2],U.index=w[w.length-3]):(U.input=w[w.length-1],U.index=w[w.length-2]),_(b,U)}));let y=h?`${h}:`:"";S&&(y+=`${l+(r?r.index:0)}:`),s&&(y+=`${u+1}:`),P&&(y+=`${M}:`),f.push(y+N)}l+=L.length+1}return{output:f.length>0?`${f.join(`
5
+ `)}
6
+ `:"",matched:a,matchCount:o}}if(R){let f=[],a=!1,o=0;for(let l=0;l<v;l++){let u=m[l];n.lastIndex=0;let G=n.test(u)!==i;G&&(a=!0,o++);let r=G?":":"-",M=h?`${h}${r}`:"";s&&(M+=`${l+1}${r}`),f.push(M+u)}return{output:f.length>0?`${f.join(`
7
+ `)}
8
+ `:"",matched:a,matchCount:o}}let x=[],C=0,p=new Set,g=-1,c=[];for(let f=0;f<v&&!(A>0&&C>=A);f++)n.lastIndex=0,n.test(m[f])!==i&&(c.push(f),C++);for(let f of c){let a=Math.max(0,f-z);g>=0&&a>g+1&&x.push(Z);for(let l=a;l<f;l++)if(!p.has(l)){p.add(l),g=l;let u=m[l];s&&(u=`${l+1}-${u}`),h&&(u=`${h}-${u}`),x.push(u)}if(!p.has(f)){p.add(f),g=f;let l=m[f];if(I){n.lastIndex=0;for(let u=n.exec(l);u!==null;u=n.exec(l)){let L=k!==void 0?u[k]??"":u[0],G=b!==null?b:L,r=h?`${h}:`:"";s&&(r+=`${f+1}:`),P&&(r+=`${u.index+1}:`),x.push(r+G),u[0].length===0&&n.lastIndex++}}else{let u=l;s&&(u=`${f+1}:${u}`),h&&(u=`${h}:${u}`),x.push(u)}}let o=Math.min(v-1,f+O);for(let l=f+1;l<=o;l++)if(!p.has(l)){p.add(l),g=l;let u=m[l];s&&(u=`${l+1}-${u}`),h&&(u=`${h}-${u}`),x.push(u)}}return{output:x.length>0?`${x.join(`
9
+ `)}
10
+ `:"",matched:C>0,matchCount:C}}function K(t,n,e){let{invertMatch:i,showLineNumbers:s,countOnly:d,countMatches:$,filename:h,onlyMatching:I,beforeContext:z,afterContext:O,maxCount:A,contextSeparator:Z,showColumn:P,showByteOffset:E,replace:S,kResetGroup:b}=e,R=t.split(`
11
+ `),T=R.length,k=T>0&&R[T-1]===""?T-1:T,m=[0];for(let c=0;c<t.length;c++)t[c]===`
12
+ `&&m.push(c+1);let j=c=>{let f=0;for(let a=0;a<m.length&&!(m[a]>c);a++)f=a;return f},v=c=>{let f=j(c);return c-m[f]+1},x=[];n.lastIndex=0;for(let c=n.exec(t);c!==null&&!(A>0&&x.length>=A);c=n.exec(t)){let f=j(c.index),a=j(c.index+Math.max(0,c[0].length-1)),o=b!==void 0?c[b]??"":c[0];x.push({startLine:f,endLine:a,byteOffset:c.index,column:v(c.index),matchText:o}),c[0].length===0&&n.lastIndex++}if(d||$){let c;if($)c=i?0:x.length;else{let a=new Set;for(let o of x)for(let l=o.startLine;l<=o.endLine;l++)a.add(l);c=i?k-a.size:a.size}return{output:`${h?`${h}:${c}`:String(c)}
13
+ `,matched:c>0,matchCount:c}}if(i){let c=new Set;for(let a of x)for(let o=a.startLine;o<=a.endLine;o++)c.add(o);let f=[];for(let a=0;a<k;a++)if(!c.has(a)){let o=R[a];s&&(o=`${a+1}:${o}`),h&&(o=`${h}:${o}`),f.push(o)}return{output:f.length>0?`${f.join(`
14
+ `)}
15
+ `:"",matched:f.length>0,matchCount:f.length}}if(x.length===0)return{output:"",matched:!1,matchCount:0};let C=new Set,p=-1,g=[];for(let c of x){let f=Math.max(0,c.startLine-z),a=Math.min(k-1,c.endLine+O);p>=0&&f>p+1&&g.push(Z);for(let o=f;o<c.startLine;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];s&&(l=`${o+1}-${l}`),h&&(l=`${h}-${l}`),g.push(l)}if(I){let o=S!==null?S:c.matchText,l=h?`${h}:`:"";E&&(l+=`${c.byteOffset}:`),s&&(l+=`${c.startLine+1}:`),P&&(l+=`${c.column}:`),g.push(l+o);for(let u=c.startLine;u<=c.endLine;u++)C.add(u),p=u}else for(let o=c.startLine;o<=c.endLine&&o<k;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];S!==null&&o===c.startLine&&(n.lastIndex=0,l=l.replace(n,S));let u=h?`${h}:`:"";E&&o===c.startLine&&(u+=`${c.byteOffset}:`),s&&(u+=`${o+1}:`),P&&o===c.startLine&&(u+=`${c.column}:`),g.push(u+l)}for(let o=c.endLine+1;o<=a;o++)if(!C.has(o)){C.add(o),p=o;let l=R[o];s&&(l=`${o+1}-${l}`),h&&(l=`${h}-${l}`),g.push(l)}}return{output:g.length>0?`${g.join(`
16
+ `)}
17
+ `:"",matched:!0,matchCount:x.length}}function Q(t,n){let e,i;switch(n.mode){case"fixed":e=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");break;case"extended":case"perl":{if(e=t.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),n.mode==="perl"){e=q(e),e=D(e),e=W(e);let $=X(e);e=$.pattern,i=$.kResetGroup}break}default:e=ne(t);break}n.wholeWord&&(e=`(?<![\\w])(?:${e})(?![\\w])`),n.lineRegexp&&(e=`^${e}$`);let s=/\\u\{[0-9A-Fa-f]+\}/.test(e),d="g"+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.multilineDotall?"s":"")+(s?"u":"");return{regex:new RegExp(e,d),kResetGroup:i}}function q(t){let n="",e=0;for(;e<t.length;)if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="Q"){e+=2;let i="";for(;e<t.length;){if(t[e]==="\\"&&e+1<t.length&&t[e+1]==="E"){e+=2;break}i+=t[e],e++}n+=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}else n+=t[e],e++;return n}function D(t){return t.replace(/\\x\{([0-9A-Fa-f]+)\}/g,"\\u{$1}")}function W(t){let n="",e=0;for(;e<t.length;){if(t[e]==="("&&e+1<t.length&&t[e+1]==="?"){let i=t.slice(e).match(/^\(\?([imsx]*)(-[imsx]*)?(:|$|\))/);if(i){let s=i[1]||"",d=i[2]||"",$=i[3];if($===":"){let h=e+i[0].length-1,I=H(t,e);if(I!==-1){let z=t.slice(h+1,I),O=J(z,s,d);n+=`(?:${O})`,e=I+1;continue}}else if($===")"||$===""){e+=i[0].length;continue}}}n+=t[e],e++}return n}function H(t,n){let e=0,i=n;for(;i<t.length;){if(t[i]==="\\"){i+=2;continue}if(t[i]==="["){for(i++;i<t.length&&t[i]!=="]";)t[i]==="\\"&&i++,i++;i++;continue}if(t[i]==="(")e++;else if(t[i]===")"&&(e--,e===0))return i;i++}return-1}function J(t,n,e){let i=t;return n.includes("i")&&(i=V(i)),i}function V(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"){e+1<t.length?(n+=i+t[e+1],e+=2):(n+=i,e++);continue}if(i==="["){n+=i,e++,e<t.length&&t[e]==="^"&&(n+=t[e],e++);let s=[];for(;e<t.length&&t[e]!=="]";)if(t[e]==="\\")s.push(t[e]),e++,e<t.length&&(s.push(t[e]),e++);else if(t[e]==="-"&&s.length>0&&e+1<t.length&&t[e+1]!=="]"){let d=s[s.length-1],$=t[e+1];s.push("-"),s.push($),/[a-z]/.test(d)&&/[a-z]/.test($)?(s.push(d.toUpperCase()),s.push("-"),s.push($.toUpperCase())):/[A-Z]/.test(d)&&/[A-Z]/.test($)&&(s.push(d.toLowerCase()),s.push("-"),s.push($.toLowerCase())),e+=2}else{let d=t[e];if(s.push(d),/[a-zA-Z]/.test(d)){let $=d===d.toLowerCase()?d.toUpperCase():d.toLowerCase();s.includes($)||s.push($)}e++}n+=s.join(""),e<t.length&&(n+=t[e],e++);continue}if(/[a-zA-Z]/.test(i)){let s=i.toLowerCase(),d=i.toUpperCase();n+=`[${d}${s}]`}else n+=i;e++}return n}function X(t){let n=Y(t);if(n===-1)return{pattern:t};let e=t.slice(0,n),i=t.slice(n+2),s=ee(e);return{pattern:`(?:${e})(${i})`,kResetGroup:s+1}}function Y(t){let n=0;for(;n<t.length-1;)if(t[n]==="\\"){if(t[n+1]==="K"){let e=0,i=n-1;for(;i>=0&&t[i]==="\\";)e++,i--;if(e%2===0)return n}n+=2}else n++;return-1}function ee(t){let n=0,e=0;for(;e<t.length;){if(t[e]==="\\"){e+=2;continue}if(t[e]==="["){for(e++;e<t.length&&t[e]!=="]";)t[e]==="\\"&&e++,e++;e++;continue}if(t[e]==="(")if(e+1<t.length&&t[e+1]==="?"){if(e+2<t.length){let i=t[e+2];if(i===":"||i==="="||i==="!"){e++;continue}if(i==="<"&&e+3<t.length){let s=t[e+3];if(s==="="||s==="!"){e++;continue}n++,e++;continue}}}else n++;e++}return n}function te(t){let n=t.replace(/\$\{0\}|\$0(?![0-9])/g,"$$&");return n=n.replace(/\$\{([^0-9}][^}]*)\}/g,"$$<$1>"),n=n.replace(/\$([a-zA-Z_][a-zA-Z0-9_]*)(?![>0-9])/g,"$$<$1>"),n}function ne(t){let n="",e=0;for(;e<t.length;){let i=t[e];if(i==="\\"&&e+1<t.length){let s=t[e+1];if(s==="|"||s==="("||s===")"){n+=s,e+=2;continue}else if(s==="{"||s==="}"){n+=`\\${s}`,e+=2;continue}}i==="+"||i==="?"||i==="|"||i==="("||i===")"||i==="{"||i==="}"?n+=`\\${i}`:n+=i,e++}return n}export{F as a,Q as b,te as c};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as y}from"./chunk-26Q3PZQ6.js";import{a as S,b as z}from"./chunk-UKYJ3JMW.js";import{a as _,b as j,c as G}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var te={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},J={name:"grep",async execute(t,s){if(j(t))return _(te);let o=!1,f=!1,c=!1,h=!1,m=!1,l=!1,i=!1,d=!1,w=!1,u=!1,p=!1,T=!1,x=!1,q=!1,B=!1,M=0,R=0,F=0,W=[],A=[],Q=[],N=null,I=[];for(let r=0;r<t.length;r++){let n=t[r];if(n.startsWith("-")&&n!=="-"){if(n==="-e"&&r+1<t.length){N=t[++r];continue}if(n.startsWith("--include=")){W.push(n.slice(10));continue}if(n.startsWith("--exclude=")){A.push(n.slice(10));continue}if(n.startsWith("--exclude-dir=")){Q.push(n.slice(14));continue}if(n.startsWith("--max-count=")){M=parseInt(n.slice(12),10);continue}let C=n.match(/^-m(\d+)$/);if(C){M=parseInt(C[1],10);continue}if(n==="-m"&&r+1<t.length){M=parseInt(t[++r],10);continue}let a=n.match(/^-([ABC])(\d+)$/);if(a){let e=parseInt(a[2],10);a[1]==="A"?F=e:a[1]==="B"?R=e:a[1]==="C"&&(R=e,F=e);continue}if((n==="-A"||n==="-B"||n==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);n==="-A"?F=e:n==="-B"?R=e:(R=e,F=e);continue}let g=n.startsWith("--")?[n]:n.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")o=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")h=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")l=!0;else if(e==="r"||e==="R"||e==="--recursive")i=!0;else if(e==="w"||e==="--word-regexp")d=!0;else if(e==="x"||e==="--line-regexp")w=!0;else if(e==="E"||e==="--extended-regexp")u=!0;else if(e==="P"||e==="--perl-regexp")p=!0;else if(e==="F"||e==="--fixed-strings")T=!0;else if(e==="o"||e==="--only-matching")x=!0;else if(e==="h"||e==="--no-filename")q=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else N===null?N=n:I.push(n)}if(N===null)return{stdout:"",stderr:`grep: missing pattern
2
+ import{a as y}from"./chunk-26Q3PZQ6.js";import{a as S,b as z}from"./chunk-DV5HL4K2.js";import{a as _,b as j,c as G}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var te={name:"grep",summary:"print lines that match patterns",usage:"grep [OPTION]... PATTERN [FILE]...",options:["-E, --extended-regexp PATTERN is an extended regular expression","-P, --perl-regexp PATTERN is a Perl regular expression","-F, --fixed-strings PATTERN is a set of newline-separated strings","-i, --ignore-case ignore case distinctions","-v, --invert-match select non-matching lines","-w, --word-regexp match only whole words","-x, --line-regexp match only whole lines","-c, --count print only a count of matching lines","-l, --files-with-matches print only names of files with matches","-L, --files-without-match print names of files with no matches","-m NUM, --max-count=NUM stop after NUM matches","-n, --line-number print line number with output lines","-h, --no-filename suppress the file name prefix on output","-o, --only-matching show only nonempty parts of lines that match","-q, --quiet, --silent suppress all normal output","-r, -R, --recursive search directories recursively","-A NUM print NUM lines of trailing context","-B NUM print NUM lines of leading context","-C NUM print NUM lines of context","-e PATTERN use PATTERN for matching"," --include=GLOB search only files matching GLOB"," --exclude=GLOB skip files matching GLOB"," --exclude-dir=DIR skip directories matching DIR"," --help display this help and exit"]},J={name:"grep",async execute(t,s){if(j(t))return _(te);let o=!1,f=!1,c=!1,h=!1,m=!1,l=!1,i=!1,d=!1,w=!1,u=!1,p=!1,T=!1,x=!1,q=!1,B=!1,M=0,R=0,F=0,W=[],A=[],Q=[],N=null,I=[];for(let r=0;r<t.length;r++){let n=t[r];if(n.startsWith("-")&&n!=="-"){if(n==="-e"&&r+1<t.length){N=t[++r];continue}if(n.startsWith("--include=")){W.push(n.slice(10));continue}if(n.startsWith("--exclude=")){A.push(n.slice(10));continue}if(n.startsWith("--exclude-dir=")){Q.push(n.slice(14));continue}if(n.startsWith("--max-count=")){M=parseInt(n.slice(12),10);continue}let C=n.match(/^-m(\d+)$/);if(C){M=parseInt(C[1],10);continue}if(n==="-m"&&r+1<t.length){M=parseInt(t[++r],10);continue}let a=n.match(/^-([ABC])(\d+)$/);if(a){let e=parseInt(a[2],10);a[1]==="A"?F=e:a[1]==="B"?R=e:a[1]==="C"&&(R=e,F=e);continue}if((n==="-A"||n==="-B"||n==="-C")&&r+1<t.length){let e=parseInt(t[++r],10);n==="-A"?F=e:n==="-B"?R=e:(R=e,F=e);continue}let g=n.startsWith("--")?[n]:n.slice(1).split("");for(let e of g)if(e==="i"||e==="--ignore-case")o=!0;else if(e==="n"||e==="--line-number")f=!0;else if(e==="v"||e==="--invert-match")c=!0;else if(e==="c"||e==="--count")h=!0;else if(e==="l"||e==="--files-with-matches")m=!0;else if(e==="L"||e==="--files-without-match")l=!0;else if(e==="r"||e==="R"||e==="--recursive")i=!0;else if(e==="w"||e==="--word-regexp")d=!0;else if(e==="x"||e==="--line-regexp")w=!0;else if(e==="E"||e==="--extended-regexp")u=!0;else if(e==="P"||e==="--perl-regexp")p=!0;else if(e==="F"||e==="--fixed-strings")T=!0;else if(e==="o"||e==="--only-matching")x=!0;else if(e==="h"||e==="--no-filename")q=!0;else if(e==="q"||e==="--quiet"||e==="--silent")B=!0;else{if(e.startsWith("--"))return G("grep",e);if(e.length===1)return G("grep",`-${e}`)}}else N===null?N=n:I.push(n)}if(N===null)return{stdout:"",stderr:`grep: missing pattern
3
3
  `,exitCode:2};let V=T?"fixed":u?"extended":p?"perl":"basic",U,b;try{let r=z(N,{mode:V,ignoreCase:o,wholeWord:d,lineRegexp:w});U=r.regex,b=r.kResetGroup}catch{return{stdout:"",stderr:`grep: invalid regular expression: ${N}
4
4
  `,exitCode:2}}if(I.length===0&&s.stdin){let r=S(s.stdin,U,{invertMatch:c,showLineNumbers:f,countOnly:h,filename:"",onlyMatching:x,beforeContext:R,afterContext:F,maxCount:M,kResetGroup:b});return B?{stdout:"",stderr:"",exitCode:r.matched?0:1}:{stdout:r.output,stderr:"",exitCode:r.matched?0:1}}if(I.length===0)return{stdout:"",stderr:`grep: no input files
5
5
  `,exitCode:2};let $="",D="",H=!1,k=!1,P=[];for(let r of I)if(r.includes("*")||r.includes("?")||r.includes("[")){let n=await se(r,s);if(i)for(let C of n){let a=await O(C.path,s,W,A,Q,C.isFile);P.push(...a)}else P.push(...n)}else if(i){let n=await O(r,s,W,A,Q);P.push(...n)}else P.push({path:r});let X=(P.length>1||i)&&!q,Z=50;for(let r=0;r<P.length;r+=Z){let n=P.slice(r,r+Z),C=await Promise.all(n.map(async a=>{let g=a.path,e=g.split("/").pop()||g;if(A.length>0&&!i&&A.some(v=>y(e,v,{stripQuotes:!0}))||W.length>0&&!i&&!W.some(v=>y(e,v,{stripQuotes:!0})))return null;try{let v=s.fs.resolvePath(s.cwd,g),L=!1;if(a.isFile===void 0?L=(await s.fs.stat(v)).isDirectory:L=!a.isFile,L)return i?null:{error:`grep: ${g}: Is a directory
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as E,b as A,c as z}from"./chunk-UKYJ3JMW.js";import{a as L,b as _,c as j}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var B={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},$=class{types;constructor(){this.types=new Map(Object.entries(B).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(new RegExp(`^${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(new RegExp(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function G(){let e=[];for(let[t,n]of Object.entries(B).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(`
2
+ import{a as E,b as A,c as z}from"./chunk-DV5HL4K2.js";import{a as L,b as _,c as j}from"./chunk-GTNBSMZR.js";import"./chunk-KGOUQS5A.js";var B={js:{extensions:[".js",".mjs",".cjs",".jsx"],globs:[]},ts:{extensions:[".ts",".tsx",".mts",".cts"],globs:[]},html:{extensions:[".html",".htm",".xhtml"],globs:[]},css:{extensions:[".css",".scss",".sass",".less"],globs:[]},json:{extensions:[".json",".jsonc",".json5"],globs:[]},xml:{extensions:[".xml",".xsl",".xslt"],globs:[]},c:{extensions:[".c",".h"],globs:[]},cpp:{extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx",".h"],globs:[]},rust:{extensions:[".rs"],globs:[]},go:{extensions:[".go"],globs:[]},zig:{extensions:[".zig"],globs:[]},java:{extensions:[".java"],globs:[]},kotlin:{extensions:[".kt",".kts"],globs:[]},scala:{extensions:[".scala",".sc"],globs:[]},clojure:{extensions:[".clj",".cljc",".cljs",".edn"],globs:[]},py:{extensions:[".py",".pyi",".pyw"],globs:[]},rb:{extensions:[".rb",".rake",".gemspec"],globs:["Rakefile","Gemfile"]},php:{extensions:[".php",".phtml",".php3",".php4",".php5"],globs:[]},perl:{extensions:[".pl",".pm",".pod",".t"],globs:[]},lua:{extensions:[".lua"],globs:[]},sh:{extensions:[".sh",".bash",".zsh",".fish"],globs:[".bashrc",".zshrc",".profile"]},bat:{extensions:[".bat",".cmd"],globs:[]},ps:{extensions:[".ps1",".psm1",".psd1"],globs:[]},yaml:{extensions:[".yaml",".yml"],globs:[]},toml:{extensions:[".toml"],globs:["Cargo.toml","pyproject.toml"]},ini:{extensions:[".ini",".cfg",".conf"],globs:[]},csv:{extensions:[".csv",".tsv"],globs:[]},md:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},markdown:{extensions:[".md",".mdx",".markdown",".mdown",".mkd"],globs:[]},rst:{extensions:[".rst"],globs:[]},txt:{extensions:[".txt",".text"],globs:[]},tex:{extensions:[".tex",".ltx",".sty",".cls"],globs:[]},sql:{extensions:[".sql"],globs:[]},graphql:{extensions:[".graphql",".gql"],globs:[]},proto:{extensions:[".proto"],globs:[]},make:{extensions:[".mk",".mak"],globs:["Makefile","GNUmakefile","makefile"]},docker:{extensions:[],globs:["Dockerfile","Dockerfile.*","*.dockerfile"]},tf:{extensions:[".tf",".tfvars"],globs:[]}},$=class{types;constructor(){this.types=new Map(Object.entries(B).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(new RegExp(`^${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(new RegExp(`^${l}$`,"i").test(t))return!0}else if(n===r.toLowerCase())return!0}return!1}};function G(){let e=[];for(let[t,n]of Object.entries(B).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 U(){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:1/0,maxFilesize:0,followSymlinks:!1,searchZip:!1,searchBinary:!1,preprocessor:null,preprocessorGlobs:[]}}function X(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 Q(e){return/^\d+[KMG]?$/i.test(e)?null:{stdout:"",stderr:`rg: invalid --max-filesize value: ${e}
5
5
  `,exitCode:1}}function q(e){return null}var V=[{short:"g",long:"glob",target:"globs",multi:!0},{long:"iglob",target:"iglobs",multi:!0},{short:"t",long:"type",target:"types",multi:!0,validate:q},{short:"T",long:"type-not",target:"typesNot",multi:!0,validate:q},{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:X,validate:Q},{long:"context-separator",target:"contextSeparator"},{short:"j",long:"threads",target:"maxDepth",parse:()=>1/0},{long:"ignore-file",target:"ignoreFiles",multi:!0},{long:"pre",target:"preprocessor"},{long:"pre-glob",target:"preprocessorGlobs",multi:!0}],ee={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}},te=new Set(["n","--line-number"]);function se(e){e.hidden?e.searchBinary=!0:e.noIgnore?e.hidden=!0:e.noIgnore=!0}function ne(e,t,n){let s=e[t];for(let r of V){if(s.startsWith(`--${r.long}=`)){let l=s.slice(`--${r.long}=`.length),i=D(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=D(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=D(n,r,l);return i?{newIndex:t+1,error:i}:{newIndex:t+1}}}return null}function re(e){return V.find(t=>t.short===e)}function D(e,t,n){if(t.validate){let r=t.validate(n);if(r)return r}let s=t.parse?t.parse(n):n;t.multi?e[t.target].push(s):e[t.target]=s}function ie(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 le(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 oe(e){let t=e.match(/^-m(\d+)$/);return t?parseInt(t[1],10):null}function Z(e){let t=U(),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=le(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 m=oe(a);if(m!==null){t.maxCount=m;continue}let p=ne(e,c,t);if(p){if(p.error)return{success:!1,error:p.error};c=p.newIndex;continue}let g=ie(e,c);if(g){t.sort=g.value,c=g.newIndex;continue}let w=a.startsWith("--")?[a]:a.slice(1).split(""),d=!1;for(let f of w){if(te.has(f)){t.lineNumber=!0,o=!0;continue}if(f==="u"||f==="--unrestricted"){se(t);continue}if(f==="P"||f==="--pcre2")return{success:!1,error:{stdout:"",stderr:`rg: PCRE2 is not supported. Use standard regex syntax instead.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{a as U,b as X,c as G,d as ee,e as J,f as k,g as F,h as pe,i as z,j as oe,k as Ue}from"./chunks/chunk-NWWB2XRE.js";import"./chunks/chunk-OBH7XN5N.js";import{a as Y}from"./chunks/chunk-4VDEBYW7.js";import"./chunks/chunk-KGOUQS5A.js";import*as zn from"node:fs";import*as Un from"node:readline";var Ae=[{name:"echo",load:async()=>(await import("./chunks/echo-WSKTON6U.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-AJXZOSPN.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-HWUQKYUM.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-BEHQBUMC.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-XJABRAUN.js")).mkdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TSNAXMZ2.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-2PKAWTSQ.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XXWRVG2D.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-3ATZ2ABL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-EFFNQ3RY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-3DIKREF7.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-53KG2MCJ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-VL3R4LAM.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-DYK37Z24.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-BES27CZT.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-QSBRKIF5.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-UEQ7KMY5.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-JUSJYJL4.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-JUSJYJL4.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-JUSJYJL4.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-4VGBMMUO.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-5LQMJYRJ.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-D2US2LMM.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-KUHOCH5S.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-IXHB2FVS.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-CPIFQTKY.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-IHF6BEOO.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-FT6WBQZG.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-MBLEXZBI.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-VP42N2JN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-DSM3NUGM.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-452R4I2C.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-77K5HH2M.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-BFVYAPOU.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-ZEKN6D4Q.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-JJFZRWRC.js")).split},{name:"column",load:async()=>(await import("./chunks/column-TSFEMTG6.js")).column},{name:"join",load:async()=>(await import("./chunks/join-3IXMEGNA.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-ZFIT2GTM.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-CBEJ35BR.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-SO5MVUEX.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-EES7TR26.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-DQBEJH47.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-XQPYLN3H.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-G5C2J2OY.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-IWT2HHEA.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-CI7A5IXQ.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-XXZPU5CA.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-O7TCK5TL.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-GI3QVUGD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-IQLPMFYI.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-O5BOTJGJ.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-JED4EKFH.js")).timeoutCommand},{name:"seq",load:async()=>(await import("./chunks/seq-AVK43XM2.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-RMGXYNQJ.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-2VAAFCTS.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-67P4ME4N.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-MV3WQ4QF.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-LNCFDPQZ.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-EPEXKI4B.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-7C5JICNL.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-73KOOLC6.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-KNRFDAY7.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WXDKRL2Z.js")).hostname},{name:"od",load:async()=>(await import("./chunks/od-SLM7SRWU.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ae.push({name:"tar",load:async()=>(await import("./chunks/tar-C27YYUAS.js")).tarCommand}),Ae.push({name:"yq",load:async()=>(await import("./chunks/yq-MF2SNFGL.js")).yqCommand}),Ae.push({name:"xan",load:async()=>(await import("./chunks/xan-6K2NGTHM.js")).xanCommand}),Ae.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-THMDBIGF.js")).sqlite3Command}));var Gn=[{name:"curl",load:async()=>(await import("./chunks/curl-LCMREE7R.js")).curlCommand}],pr=new Map;function yr(t){return{name:t.name,async execute(e,n){let r=pr.get(t.name);return r||(r=await t.load(),pr.set(t.name,r)),r.execute(e,n)}}}function wr(t){return(t?Ae.filter(n=>t.includes(n.name)):Ae).map(yr)}function Er(){return Gn.map(yr)}function gr(t){return"load"in t&&typeof t.load=="function"}function Ar(t){let e=null;return{name:t.name,async execute(n,r){return e||(e=await t.load()),e.execute(n,r)}}}var Hn=new TextEncoder,Vn=new TextDecoder;function Se(t,e){if(t instanceof Uint8Array)return t;if(e==="base64")return Uint8Array.from(atob(t),n=>n.charCodeAt(0));if(e==="hex"){let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=parseInt(t.slice(r,r+2),16);return n}return e==="binary"||e==="latin1"?Uint8Array.from(t,n=>n.charCodeAt(0)):Hn.encode(t)}function Ge(t,e){return e==="base64"?btoa(String.fromCharCode(...t)):e==="hex"?Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join(""):e==="binary"||e==="latin1"?String.fromCharCode(...t):Vn.decode(t)}function ae(t){if(t!=null)return typeof t=="string"?t:t.encoding??void 0}var He=new TextEncoder;function jn(t){return typeof t=="object"&&t!==null&&!(t instanceof Uint8Array)&&"content"in t}var ke=class{data=new Map;constructor(e){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),e)for(let[n,r]of Object.entries(e))jn(r)?this.writeFileSync(n,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(n,r)}normalizePath(e){if(!e||e==="/")return"/";let n=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;n.startsWith("/")||(n=`/${n}`);let r=n.split("/").filter(o=>o&&o!=="."),s=[];for(let o of r)o===".."?s.pop():s.push(o);return`/${s.join("/")}`||"/"}dirname(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.lastIndexOf("/");return r===0?"/":n.slice(0,r)}ensureParentDirs(e){let n=this.dirname(e);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(e,n,r,s){let o=this.normalizePath(e);this.ensureParentDirs(o);let i=ae(r),a=Se(n,i);this.data.set(o,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}async readFile(e,n){let r=await this.readFileBuffer(e),s=ae(n);return Ge(r,s)}async readFileBuffer(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${e}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${e}'`);return r.content instanceof Uint8Array?r.content:He.encode(r.content)}async writeFile(e,n,r){this.writeFileSync(e,n,r)}async appendFile(e,n,r){let s=this.normalizePath(e),o=this.data.get(s);if(o&&o.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${e}'`);let i=ae(r),a=Se(n,i);if(o?.type==="file"){let c=o.content instanceof Uint8Array?o.content:He.encode(o.content),l=new Uint8Array(c.length+a.length);l.set(c),l.set(a,c.length),this.data.set(s,{type:"file",content:l,mode:o.mode,mtime:new Date})}else this.writeFileSync(e,n,r)}async exists(e){try{let n=this.resolvePathWithSymlinks(e);return this.data.has(n)}catch{return!1}}async stat(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${e}'`);let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=He.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}async lstat(e){let n=this.resolveIntermediateSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${e}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=He.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}resolveSymlink(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=this.dirname(e);return this.normalizePath(r==="/"?`/${n}`:`${r}/${n}`)}resolveIntermediateSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",o=new Set;for(let i=0;i<r.length-1;i++){let a=r[i];s=`${s}/${a}`;let c=this.data.get(s),l=0,u=40;for(;c&&c.type==="symlink"&&l<u;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`);o.add(s),s=this.resolveSymlink(s,c.target),c=this.data.get(s),l++}if(l>=u)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",o=new Set;for(let i of r){s=`${s}/${i}`;let a=this.data.get(s),c=0,l=40;for(;a&&a.type==="symlink"&&c<l;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`);o.add(s),s=this.resolveSymlink(s,a.target),a=this.data.get(s),c++}if(c>=l)throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`)}return s}async mkdir(e,n){this.mkdirSync(e,n)}mkdirSync(e,n){let r=this.normalizePath(e);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${e}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${e}'`);return}let s=this.dirname(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(e){return(await this.readdirWithFileTypes(e)).map(r=>r.name)}async readdirWithFileTypes(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${e}'`);s.add(n),n=this.resolveSymlink(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);let o=n==="/"?"/":`${n}/`,i=new Map;for(let[a,c]of this.data.entries())if(a!==n&&a.startsWith(o)){let l=a.slice(o.length),u=l.split("/")[0];u&&!l.includes("/",u.length)&&!i.has(u)&&i.set(u,{name:u,isFile:c.type==="file",isDirectory:c.type==="directory",isSymbolicLink:c.type==="symlink"})}return Array.from(i.values()).sort((a,c)=>a.name<c.name?-1:a.name>c.name?1:0)}async rm(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${e}'`)}if(s.type==="directory"){let o=await this.readdir(r);if(o.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${e}'`);for(let i of o){let a=r==="/"?`/${i}`:`${r}/${i}`;await this.rm(a,n)}}}this.data.delete(r)}async cp(e,n,r){let s=this.normalizePath(e),o=this.normalizePath(n),i=this.data.get(s);if(!i)throw new Error(`ENOENT: no such file or directory, cp '${e}'`);if(i.type==="file")this.ensureParentDirs(o),this.data.set(o,{...i});else if(i.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${e}'`);await this.mkdir(o,{recursive:!0});let a=await this.readdir(s);for(let c of a){let l=s==="/"?`/${c}`:`${s}/${c}`,u=o==="/"?`/${c}`:`${o}/${c}`;await this.cp(l,u,r)}}}async mv(e,n){await this.cp(e,n,{recursive:!0}),await this.rm(e,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=e==="/"?`/${n}`:`${e}/${n}`;return this.normalizePath(r)}async chmod(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${e}'`);s.mode=n}async symlink(e,n){let r=this.normalizePath(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:e,mode:511,mtime:new Date})}async link(e,n){let r=this.normalizePath(e),s=this.normalizePath(n),o=this.data.get(r);if(!o)throw new Error(`ENOENT: no such file or directory, link '${e}'`);if(o.type!=="file")throw new Error(`EPERM: operation not permitted, link '${e}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);this.ensureParentDirs(s),this.data.set(s,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${e}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${e}'`);return r.target}};var Sr="5.1.0(1)-release",xr="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT";function Re(){return{pid:process.pid,ppid:process.ppid,uid:process.getuid?.()??1e3,gid:process.getgid?.()??1e3}}function br(){let{pid:t,ppid:e,uid:n,gid:r}=Re();return`Name: bash
2
+ import{a as U,b as X,c as G,d as ee,e as J,f as k,g as F,h as pe,i as z,j as oe,k as Ue}from"./chunks/chunk-NWWB2XRE.js";import"./chunks/chunk-OBH7XN5N.js";import{a as Y}from"./chunks/chunk-4VDEBYW7.js";import"./chunks/chunk-KGOUQS5A.js";import*as zn from"node:fs";import*as Un from"node:readline";var Ae=[{name:"echo",load:async()=>(await import("./chunks/echo-WSKTON6U.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-AJXZOSPN.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-HWUQKYUM.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-BEHQBUMC.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-XJABRAUN.js")).mkdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TSNAXMZ2.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-2PKAWTSQ.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XXWRVG2D.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-3ATZ2ABL.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-EFFNQ3RY.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-3DIKREF7.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-53KG2MCJ.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-VL3R4LAM.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-DYK37Z24.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-BES27CZT.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-QSBRKIF5.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-UEQ7KMY5.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-IIVQXFNI.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-IIVQXFNI.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-IIVQXFNI.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-Q4OTJOEF.js")).rgCommand},{name:"sed",load:async()=>(await import("./chunks/sed-5LQMJYRJ.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-D2US2LMM.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-KUHOCH5S.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-IXHB2FVS.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-CPIFQTKY.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-IHF6BEOO.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-FT6WBQZG.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-MBLEXZBI.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-VP42N2JN.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-DSM3NUGM.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-452R4I2C.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-77K5HH2M.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-BFVYAPOU.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-ZEKN6D4Q.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-JJFZRWRC.js")).split},{name:"column",load:async()=>(await import("./chunks/column-TSFEMTG6.js")).column},{name:"join",load:async()=>(await import("./chunks/join-3IXMEGNA.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-ZFIT2GTM.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-CBEJ35BR.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-SO5MVUEX.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-EES7TR26.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-DQBEJH47.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-XQPYLN3H.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-YLLSNZZN.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-PCMLRCRW.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-G5C2J2OY.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-IWT2HHEA.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-OVATH2SQ.js")).falseCommand},{name:"clear",load:async()=>(await import("./chunks/clear-CI7A5IXQ.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-UT3MT5UU.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-XXZPU5CA.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-O7TCK5TL.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-GI3QVUGD.js")).diffCommand},{name:"date",load:async()=>(await import("./chunks/date-IQLPMFYI.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-O5BOTJGJ.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-JED4EKFH.js")).timeoutCommand},{name:"seq",load:async()=>(await import("./chunks/seq-AVK43XM2.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-RMGXYNQJ.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-2VAAFCTS.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-67P4ME4N.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-MV3WQ4QF.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-LNCFDPQZ.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-EPEXKI4B.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-7C5JICNL.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-73KOOLC6.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-KNRFDAY7.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-WXDKRL2Z.js")).hostname},{name:"od",load:async()=>(await import("./chunks/od-SLM7SRWU.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-YXK3WZQL.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Ae.push({name:"tar",load:async()=>(await import("./chunks/tar-C27YYUAS.js")).tarCommand}),Ae.push({name:"yq",load:async()=>(await import("./chunks/yq-MF2SNFGL.js")).yqCommand}),Ae.push({name:"xan",load:async()=>(await import("./chunks/xan-6K2NGTHM.js")).xanCommand}),Ae.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-THMDBIGF.js")).sqlite3Command}));var Gn=[{name:"curl",load:async()=>(await import("./chunks/curl-LCMREE7R.js")).curlCommand}],pr=new Map;function yr(t){return{name:t.name,async execute(e,n){let r=pr.get(t.name);return r||(r=await t.load(),pr.set(t.name,r)),r.execute(e,n)}}}function wr(t){return(t?Ae.filter(n=>t.includes(n.name)):Ae).map(yr)}function Er(){return Gn.map(yr)}function gr(t){return"load"in t&&typeof t.load=="function"}function Ar(t){let e=null;return{name:t.name,async execute(n,r){return e||(e=await t.load()),e.execute(n,r)}}}var Hn=new TextEncoder,Vn=new TextDecoder;function Se(t,e){if(t instanceof Uint8Array)return t;if(e==="base64")return Uint8Array.from(atob(t),n=>n.charCodeAt(0));if(e==="hex"){let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=parseInt(t.slice(r,r+2),16);return n}return e==="binary"||e==="latin1"?Uint8Array.from(t,n=>n.charCodeAt(0)):Hn.encode(t)}function Ge(t,e){return e==="base64"?btoa(String.fromCharCode(...t)):e==="hex"?Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join(""):e==="binary"||e==="latin1"?String.fromCharCode(...t):Vn.decode(t)}function ae(t){if(t!=null)return typeof t=="string"?t:t.encoding??void 0}var He=new TextEncoder;function jn(t){return typeof t=="object"&&t!==null&&!(t instanceof Uint8Array)&&"content"in t}var ke=class{data=new Map;constructor(e){if(this.data.set("/",{type:"directory",mode:493,mtime:new Date}),e)for(let[n,r]of Object.entries(e))jn(r)?this.writeFileSync(n,r.content,void 0,{mode:r.mode,mtime:r.mtime}):this.writeFileSync(n,r)}normalizePath(e){if(!e||e==="/")return"/";let n=e.endsWith("/")&&e!=="/"?e.slice(0,-1):e;n.startsWith("/")||(n=`/${n}`);let r=n.split("/").filter(o=>o&&o!=="."),s=[];for(let o of r)o===".."?s.pop():s.push(o);return`/${s.join("/")}`||"/"}dirname(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.lastIndexOf("/");return r===0?"/":n.slice(0,r)}ensureParentDirs(e){let n=this.dirname(e);n!=="/"&&(this.data.has(n)||(this.ensureParentDirs(n),this.data.set(n,{type:"directory",mode:493,mtime:new Date})))}writeFileSync(e,n,r,s){let o=this.normalizePath(e);this.ensureParentDirs(o);let i=ae(r),a=Se(n,i);this.data.set(o,{type:"file",content:a,mode:s?.mode??420,mtime:s?.mtime??new Date})}async readFile(e,n){let r=await this.readFileBuffer(e),s=ae(n);return Ge(r,s)}async readFileBuffer(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, open '${e}'`);if(r.type!=="file")throw new Error(`EISDIR: illegal operation on a directory, read '${e}'`);return r.content instanceof Uint8Array?r.content:He.encode(r.content)}async writeFile(e,n,r){this.writeFileSync(e,n,r)}async appendFile(e,n,r){let s=this.normalizePath(e),o=this.data.get(s);if(o&&o.type==="directory")throw new Error(`EISDIR: illegal operation on a directory, write '${e}'`);let i=ae(r),a=Se(n,i);if(o?.type==="file"){let c=o.content instanceof Uint8Array?o.content:He.encode(o.content),l=new Uint8Array(c.length+a.length);l.set(c),l.set(a,c.length),this.data.set(s,{type:"file",content:l,mode:o.mode,mtime:new Date})}else this.writeFileSync(e,n,r)}async exists(e){try{let n=this.resolvePathWithSymlinks(e);return this.data.has(n)}catch{return!1}}async stat(e){let n=this.resolvePathWithSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, stat '${e}'`);let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=He.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}async lstat(e){let n=this.resolveIntermediateSymlinks(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${e}'`);if(r.type==="symlink")return{isFile:!1,isDirectory:!1,isSymbolicLink:!0,mode:r.mode,size:r.target.length,mtime:r.mtime||new Date};let s=0;return r.type==="file"&&r.content&&(r.content instanceof Uint8Array?s=r.content.length:s=He.encode(r.content).length),{isFile:r.type==="file",isDirectory:r.type==="directory",isSymbolicLink:!1,mode:r.mode,size:s,mtime:r.mtime||new Date}}resolveSymlink(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=this.dirname(e);return this.normalizePath(r==="/"?`/${n}`:`${r}/${n}`)}resolveIntermediateSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/");if(r.length<=1)return n;let s="",o=new Set;for(let i=0;i<r.length-1;i++){let a=r[i];s=`${s}/${a}`;let c=this.data.get(s),l=0,u=40;for(;c&&c.type==="symlink"&&l<u;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`);o.add(s),s=this.resolveSymlink(s,c.target),c=this.data.get(s),l++}if(l>=u)throw new Error(`ELOOP: too many levels of symbolic links, lstat '${e}'`)}return`${s}/${r[r.length-1]}`}resolvePathWithSymlinks(e){let n=this.normalizePath(e);if(n==="/")return"/";let r=n.slice(1).split("/"),s="",o=new Set;for(let i of r){s=`${s}/${i}`;let a=this.data.get(s),c=0,l=40;for(;a&&a.type==="symlink"&&c<l;){if(o.has(s))throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`);o.add(s),s=this.resolveSymlink(s,a.target),a=this.data.get(s),c++}if(c>=l)throw new Error(`ELOOP: too many levels of symbolic links, open '${e}'`)}return s}async mkdir(e,n){this.mkdirSync(e,n)}mkdirSync(e,n){let r=this.normalizePath(e);if(this.data.has(r)){if(this.data.get(r)?.type==="file")throw new Error(`EEXIST: file already exists, mkdir '${e}'`);if(!n?.recursive)throw new Error(`EEXIST: directory already exists, mkdir '${e}'`);return}let s=this.dirname(r);if(s!=="/"&&!this.data.has(s))if(n?.recursive)this.mkdirSync(s,{recursive:!0});else throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`);this.data.set(r,{type:"directory",mode:493,mtime:new Date})}async readdir(e){return(await this.readdirWithFileTypes(e)).map(r=>r.name)}async readdirWithFileTypes(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);let s=new Set;for(;r&&r.type==="symlink";){if(s.has(n))throw new Error(`ELOOP: too many levels of symbolic links, scandir '${e}'`);s.add(n),n=this.resolveSymlink(n,r.target),r=this.data.get(n)}if(!r)throw new Error(`ENOENT: no such file or directory, scandir '${e}'`);if(r.type!=="directory")throw new Error(`ENOTDIR: not a directory, scandir '${e}'`);let o=n==="/"?"/":`${n}/`,i=new Map;for(let[a,c]of this.data.entries())if(a!==n&&a.startsWith(o)){let l=a.slice(o.length),u=l.split("/")[0];u&&!l.includes("/",u.length)&&!i.has(u)&&i.set(u,{name:u,isFile:c.type==="file",isDirectory:c.type==="directory",isSymbolicLink:c.type==="symlink"})}return Array.from(i.values()).sort((a,c)=>a.name<c.name?-1:a.name>c.name?1:0)}async rm(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s){if(n?.force)return;throw new Error(`ENOENT: no such file or directory, rm '${e}'`)}if(s.type==="directory"){let o=await this.readdir(r);if(o.length>0){if(!n?.recursive)throw new Error(`ENOTEMPTY: directory not empty, rm '${e}'`);for(let i of o){let a=r==="/"?`/${i}`:`${r}/${i}`;await this.rm(a,n)}}}this.data.delete(r)}async cp(e,n,r){let s=this.normalizePath(e),o=this.normalizePath(n),i=this.data.get(s);if(!i)throw new Error(`ENOENT: no such file or directory, cp '${e}'`);if(i.type==="file")this.ensureParentDirs(o),this.data.set(o,{...i});else if(i.type==="directory"){if(!r?.recursive)throw new Error(`EISDIR: is a directory, cp '${e}'`);await this.mkdir(o,{recursive:!0});let a=await this.readdir(s);for(let c of a){let l=s==="/"?`/${c}`:`${s}/${c}`,u=o==="/"?`/${c}`:`${o}/${c}`;await this.cp(l,u,r)}}}async mv(e,n){await this.cp(e,n,{recursive:!0}),await this.rm(e,{recursive:!0})}getAllPaths(){return Array.from(this.data.keys())}resolvePath(e,n){if(n.startsWith("/"))return this.normalizePath(n);let r=e==="/"?`/${n}`:`${e}/${n}`;return this.normalizePath(r)}async chmod(e,n){let r=this.normalizePath(e),s=this.data.get(r);if(!s)throw new Error(`ENOENT: no such file or directory, chmod '${e}'`);s.mode=n}async symlink(e,n){let r=this.normalizePath(n);if(this.data.has(r))throw new Error(`EEXIST: file already exists, symlink '${n}'`);this.ensureParentDirs(r),this.data.set(r,{type:"symlink",target:e,mode:511,mtime:new Date})}async link(e,n){let r=this.normalizePath(e),s=this.normalizePath(n),o=this.data.get(r);if(!o)throw new Error(`ENOENT: no such file or directory, link '${e}'`);if(o.type!=="file")throw new Error(`EPERM: operation not permitted, link '${e}'`);if(this.data.has(s))throw new Error(`EEXIST: file already exists, link '${n}'`);this.ensureParentDirs(s),this.data.set(s,{type:"file",content:o.content,mode:o.mode,mtime:o.mtime})}async readlink(e){let n=this.normalizePath(e),r=this.data.get(n);if(!r)throw new Error(`ENOENT: no such file or directory, readlink '${e}'`);if(r.type!=="symlink")throw new Error(`EINVAL: invalid argument, readlink '${e}'`);return r.target}};var Sr="5.1.0(1)-release",xr="Linux version 5.15.0-generic (just-bash) #1 SMP PREEMPT";function Re(){return{pid:process.pid,ppid:process.ppid,uid:process.getuid?.()??1e3,gid:process.getgid?.()??1e3}}function br(){let{pid:t,ppid:e,uid:n,gid:r}=Re();return`Name: bash
3
3
  State: R (running)
4
4
  Pid: ${t}
5
5
  PPid: ${e}