@jerryan/just-bash 3.11.0 → 3.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/bin/chunks/chunk-JZR2C63H.js +17 -0
- package/dist/bin/{shell/chunks/find-3QDGII35.js → chunks/find-QM4ZVJ2E.js} +1 -1
- package/dist/bin/{shell/chunks/flag-coverage-AGEO3F6X.js → chunks/flag-coverage-ERCJF44K.js} +1 -1
- package/dist/bin/just-bash.js +2 -2
- package/dist/bin/shell/chunks/chunk-JZR2C63H.js +17 -0
- package/dist/bin/{chunks/find-3QDGII35.js → shell/chunks/find-QM4ZVJ2E.js} +1 -1
- package/dist/bin/{chunks/flag-coverage-AGEO3F6X.js → shell/chunks/flag-coverage-ERCJF44K.js} +1 -1
- package/dist/bin/shell/shell.js +2 -2
- package/dist/bundle/browser.js +109 -109
- package/dist/bundle/chunks/chunk-6X2Y5CA2.js +16 -0
- package/dist/bundle/chunks/{find-3AONTPPM.js → find-BFNQSA5B.js} +1 -1
- package/dist/bundle/chunks/{flag-coverage-6YGO7STE.js → flag-coverage-7PBO3TUZ.js} +1 -1
- package/dist/bundle/index.cjs +70 -70
- package/dist/bundle/index.js +2 -2
- package/package.json +1 -1
- package/dist/bin/chunks/chunk-4NYJ4ZTO.js +0 -17
- package/dist/bin/shell/chunks/chunk-4NYJ4ZTO.js +0 -17
- package/dist/bundle/chunks/chunk-L7NEGEOJ.js +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# just-bash
|
|
2
2
|
|
|
3
|
+
## 3.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4cb67f9`](https://github.com/JerryAZR/just-bash/commit/4cb67f99d9b4f3655b0cd68a1c2cfcc674bb394d) Thanks [@JerryAZR](https://github.com/JerryAZR)! - fix: find command no longer crashes host process on abort
|
|
8
|
+
|
|
9
|
+
When an AbortSignal fires during `find`'s parallel batch traversal,
|
|
10
|
+
all concurrent `processNode` promises throw `ExecutionAbortedError`
|
|
11
|
+
from the traversal budget checkpoint. `Promise.all` only catches the
|
|
12
|
+
first rejection — the rest become unhandled rejections that crash the
|
|
13
|
+
host process (e.g. pi) with `uncaughtException`.
|
|
14
|
+
|
|
15
|
+
Fix: catch `ExecutionAbortedError` inside the `Promise.all` map
|
|
16
|
+
callbacks and return null. The abort is still detected on the next
|
|
17
|
+
sequential checkpoint and properly propagated as exit code 124.
|
|
18
|
+
|
|
3
19
|
## 3.11.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as Te}from"./chunk-BIJXTWZ4.js";import{a as Z}from"./chunk-BRB5PJ3E.js";import{a as ce}from"./chunk-3MRB66F4.js";import{a as Se}from"./chunk-K27FY3ES.js";import{a as oe}from"./chunk-623Q77WZ.js";import{b as he,c as me,d as ye}from"./chunk-YERKK5B3.js";import{d as be}from"./chunk-AIWBN36Z.js";import{l as ae,m as le}from"./chunk-FUT3X2GJ.js";import{a as ie}from"./chunk-CPKBPQ2C.js";import{a as ge,b as we}from"./chunk-MUFNRCMY.js";function R(e,t){switch(e.type){case"name":{let n=e.pattern,s=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(s){let a=s[1],l=t.name;if(e.ignoreCase){if(!l.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!l.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Z(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,s=t.relativePath,a=n.split("/");for(let d=0;d<a.length-1;d++){let r=a[d];if(r&&r!=="."&&r!==".."&&!r.includes("*")&&!r.includes("?")&&!r.includes("[")){let i=`/${r}/`;if(e.ignoreCase){if(!s.toLowerCase().includes(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!s.includes(i))return{matches:!1,pruned:!1,printed:!1}}}let l=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(l){let d=l[1];if(e.ignoreCase){if(!s.toLowerCase().endsWith(d.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!s.endsWith(d))return{matches:!1,pruned:!1,printed:!1}}return{matches:Z(s,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:oe(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let s=(Date.now()-t.mtime)/(1e3*60*60*24),a;return e.comparison==="more"?a=s>e.days:e.comparison==="less"?a=s<e.days:a=Math.floor(s)===e.days,{matches:a,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let s;return e.comparison==="more"?s=t.size>n:e.comparison==="less"?s=t.size<n:e.unit==="b"?s=Math.ceil(t.size/512)===e.value:s=t.size===n,{matches:s,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,s=e.mode&511,a;return e.matchType==="exact"?a=n===s:e.matchType==="all"?a=(n&s)===s:a=(n&s)!==0,{matches:a,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"action":return{matches:!0,pruned:!1,printed:!1,actions:[e.action]};case"not":{let n=R(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1,actions:n.actions}}case"and":{let n=R(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1,actions:n.actions};let s=R(e.right,t);return{matches:s.matches,pruned:n.pruned||s.pruned,printed:n.printed||s.printed,actions:[...n.actions??[],...s.actions??[]]}}case"or":{let n=R(e.left,t);if(n.matches)return n;let s=R(e.right,t);return{matches:s.matches,pruned:n.pruned||s.pruned,printed:s.printed,actions:[...n.actions??[],...s.actions??[]]}}}}function _(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!1;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return _(e.expr);case"and":case"or":return _(e.left)||_(e.right)}}function j(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return j(e.expr);case"and":case"or":return j(e.left)||j(e.right);default:return!1}}function Ce(e){let t=[],n=s=>{s&&(s.type==="newer"?t.push(s.refPath):s.type==="not"?n(s.expr):(s.type==="and"||s.type==="or")&&(n(s.left),n(s.right)))};return n(e),t}function J(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!0;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return J(e.expr);case"and":case"or":return J(e.left)&&J(e.right)}}function B(e,t,n,s,a){switch(e.type){case"name":{let l=e.pattern,d=l.match(/^\*(\.[a-zA-Z0-9]+)$/);if(d){let r=d[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(r.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(r))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Z(t,l,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let l=e.pattern,d=l.split("/");for(let i=0;i<d.length-1;i++){let o=d[i];if(o&&o!=="."&&o!==".."&&!o.includes("*")&&!o.includes("?")&&!o.includes("[")){let u=`/${o}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let r=l.match(/\*(\.[a-zA-Z0-9]+)$/);if(r){let i=r[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:Z(n,l,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let l=e.ignoreCase?"i":"";return{matches:oe(e.pattern,l).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:s,pruned:!1,printed:!1}:e.fileType==="d"?{matches:a,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"action":return{matches:!0,pruned:!1,printed:!1,actions:[e.action]};case"not":{let l=B(e.expr,t,n,s,a);return{matches:!l.matches,pruned:l.pruned,printed:!1,actions:l.actions}}case"and":{let l=B(e.left,t,n,s,a);if(!l.matches)return{matches:!1,pruned:l.pruned,printed:!1,actions:l.actions};let d=B(e.right,t,n,s,a);return{matches:d.matches,pruned:l.pruned||d.pruned,printed:l.printed||d.printed,actions:[...l.actions??[],...d.actions??[]]}}case"or":{let l=B(e.left,t,n,s,a);if(l.matches)return l;let d=B(e.right,t,n,s,a);return{matches:d.matches,pruned:l.pruned||d.pruned,printed:d.printed,actions:[...l.actions??[],...d.actions??[]]}}default:return{matches:!1,pruned:!1,printed:!1}}}function U(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return U(e.expr);case"and":case"or":return U(e.left)||U(e.right);default:return!1}}function L(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!0;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return L(e.expr);case"and":case"or":return L(e.left)&&L(e.right)}}function Ee(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!L(e))return fe(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:R(e,n).pruned}}function fe(e,t){switch(e.type){case"or":{if(L(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(R(e.left,n).pruned)return{shouldPrune:!0}}return fe(e.right,t)}case"and":{if(L(e.left)&&L(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:R(e,n).pruned}}if(L(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return R(e.left,n).matches?fe(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function ve(e,t){let n=[],s=t,a=r=>({expr:null,pathIndex:s,error:`find: missing argument to \`${r}'
|
|
4
|
+
`}),l=(r,i)=>({expr:null,pathIndex:s,error:`find: invalid argument \`${i}' to \`${r}'
|
|
5
|
+
`});for(;s<e.length;){let r=e[s];if(r==="("||r==="\\("){n.push({type:"lparen"}),s++;continue}if(r===")"||r==="\\)"){n.push({type:"rparen"}),s++;continue}if(r==="-name"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"name",pattern:e[++s]}})}else if(r==="-iname"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}})}else if(r==="-path"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"path",pattern:e[++s]}})}else if(r==="-ipath"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}})}else if(r==="-regex"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}})}else if(r==="-iregex"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}})}else if(r==="-type"){if(s+1>=e.length)return a(r);let i=e[++s];if(i==="f"||i==="d")n.push({type:"expr",expr:{type:"type",fileType:i}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${i}
|
|
6
|
+
`}}else if(r==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(r==="-mtime"){if(s+1>=e.length)return a(r);let i=e[++s],o="exact",u=i;if(i.startsWith("+")?(o="more",u=i.slice(1)):i.startsWith("-")&&(o="less",u=i.slice(1)),!/^\d+$/.test(u))return l(r,i);let N=Number(u);if(!Number.isSafeInteger(N))return l(r,i);n.push({type:"expr",expr:{type:"mtime",days:N,comparison:o}})}else if(r==="-newer"){if(s+1>=e.length)return a(r);let i=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:i}})}else if(r==="-size"){if(s+1>=e.length)return a(r);let i=e[++s],o="exact",u=i;i.startsWith("+")?(o="more",u=i.slice(1)):i.startsWith("-")&&(o="less",u=i.slice(1));let N=u.match(/^(\d+)([ckMGb])?$/);if(!N)return l(r,i);let F=Number(N[1]);if(!Number.isSafeInteger(F))return l(r,i);let P=N[2]||"b",V=P==="G"?1024**3:P==="M"?1024**2:P==="k"?1024:P==="b"?512:1;if(!Number.isSafeInteger(F*V))return l(r,i);n.push({type:"expr",expr:{type:"size",value:F,unit:P,comparison:o}})}else if(r==="-perm"){if(s+1>=e.length)return a(r);let i=e[++s],o="exact",u=i;if(i.startsWith("-")?(o="all",u=i.slice(1)):i.startsWith("/")&&(o="any",u=i.slice(1)),!/^[0-7]{1,4}$/.test(u))return l(r,i);let N=Number.parseInt(u,8);n.push({type:"expr",expr:{type:"perm",mode:N,matchType:o}})}else if(r==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(r==="-not"||r==="!")n.push({type:"not"});else if(r==="-o"||r==="-or")n.push({type:"op",op:"or"});else if(r==="-a"||r==="-and")n.push({type:"op",op:"and"});else if(r==="-maxdepth"||r==="-mindepth"){if(s+1>=e.length)return a(r);s++}else if(r!=="-depth")if(r==="-exec"){let i=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)i.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n"};if(i.length===0)return a("-exec");let o=e[s]==="+";if(o&&(i.at(-1)!=="{}"||i.filter(u=>u==="{}").length!==1))return l("-exec","+");n.push({type:"expr",expr:{type:"action",action:{type:"exec",command:i,batchMode:o}}})}else if(r==="-print")n.push({type:"expr",expr:{type:"action",action:{type:"print"}}});else if(r==="-print0")n.push({type:"expr",expr:{type:"action",action:{type:"print0"}}});else if(r==="-printf"){if(s+1>=e.length)return a(r);let i=e[++s];n.push({type:"expr",expr:{type:"action",action:{type:"printf",format:i}}})}else if(r==="-delete")n.push({type:"expr",expr:{type:"action",action:{type:"delete"}}});else return r.startsWith("-")?{expr:null,pathIndex:s,error:`find: unknown predicate '${r}'
|
|
7
|
+
`}:{expr:null,pathIndex:s,error:`find: paths must precede expression: \`${r}'
|
|
8
|
+
`};s++}if(n.length===0)return{expr:null,pathIndex:s};let d=Re(n);return d.error?{expr:null,pathIndex:s,error:d.error}:{expr:d.expr,pathIndex:s}}function Re(e){let t=0,n;function s(){let i=a();if(!i)return null;for(;t<e.length;){let o=e[t];if(o.type==="op"&&o.op==="or"){t++;let u=a();if(!u)return n="find: expected an expression after `-o'\n",null;i={type:"or",left:i,right:u}}else break}return i}function a(){let i=l();if(!i)return null;for(;t<e.length;){let o=e[t];if(o.type==="op"&&o.op==="and"){t++;let u=l();if(!u)return n="find: expected an expression after `-a'\n",null;i={type:"and",left:i,right:u}}else if(o.type==="expr"||o.type==="not"||o.type==="lparen"){let u=l();if(!u)return i;i={type:"and",left:i,right:u}}else break}return i}function l(){if(t<e.length&&e[t].type==="not"){t++;let i=l();return i?{type:"not",expr:i}:(n="find: expected an expression after `!'\n",null)}return d()}function d(){if(t>=e.length)return null;let i=e[t];if(i.type==="lparen"){t++;let o=s();return!o||t>=e.length||e[t].type!=="rparen"?(n="find: missing closing `)'\n",null):(t++,o)}return i.type==="expr"?(t++,i.expr):(i.type==="rparen",null)}let r=s();return!n&&t<e.length&&(n=e[t].type==="rparen"?"find: unexpected `)'\n":`find: invalid expression
|
|
9
|
+
`),!n&&r&&ee(r)&&(n="find: refusing to evaluate `-delete' under negation\n"),{expr:n?null:r,error:n}}function ee(e,t=!1){return e.type==="action"?t&&e.action.type==="delete":e.type==="not"?ee(e.expr,!t):e.type==="and"||e.type==="or"?ee(e.left,t)||ee(e.right,t):!1}var De=500;function Fe(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function ze(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var Ae={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},st={name:"find",async execute(e,t){if(we(e))return ge(Ae);let n=[],s=null,a=null,l=!1,d=e.length;for(let c=0;c<e.length;c++){let f=e[c];if(f.startsWith("-")||f==="("||f==="\\("||f===")"||f==="\\)"||f==="!"){d=c;break}n.push(f)}n.length===0&&n.push(".");for(let c=d;c<e.length;c++){let f=e[c];if(f==="-exec")for(c++;c<e.length&&e[c]!==";"&&e[c]!=="+";)c++;else if(f==="-maxdepth"||f==="-mindepth"){let p=e[c+1];if(p===void 0||!/^\d+$/.test(p))return{stdout:"",stderr:p===void 0?`find: missing argument to \`${f}'
|
|
10
|
+
`:`find: invalid argument \`${p}' to \`${f}'
|
|
11
|
+
`,exitCode:1};let D=Number(p);if(!Number.isSafeInteger(D))return{stdout:"",stderr:`find: invalid argument \`${p}' to \`${f}'
|
|
12
|
+
`,exitCode:1};f==="-maxdepth"?s=D:a=D,c++}else f==="-depth"&&(l=!0)}let{expr:r,error:i}=ve(e,d);if(i)return{stdout:"",stderr:i,exitCode:1};let o=te(r),u=o.length>0;o.some(c=>c.type==="delete")&&(l=!0);let N=[],F=0,P=t.executionScope?new Se(t.executionScope,"find"):void 0,V=[],ue=[],Q=0,O=new be({limits:t.limits,signal:t.signal,executionScope:t.executionScope,site:"find"}),G=c=>{if(P)P.append("stdout",c);else{let f=ie(c);if(f>t.limits.maxOutputSize-Q)throw new ae(`find: output size limit exceeded (${t.limits.maxOutputSize} bytes)`,"output_size");c&&V.push(c),Q+=f}},q=c=>{if(P)P.append("stderr",c);else{let f=ie(c);if(f>t.limits.maxOutputSize-Q)throw new ae(`find: output size limit exceeded (${t.limits.maxOutputSize} bytes)`,"output_size");c&&ue.push(c),Q+=f}},Me=Ce(r),ne=new Map;for(let c of Me){let f=t.fs.resolvePath(t.cwd,c);try{let p=await t.fs.stat(f);ne.set(c,p.mtime?.getTime()??Date.now())}catch{}}let Pe=o.some(c=>{if(c.type!=="printf")return!1;let f=c.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),xe=_(r)||Pe,$e=j(r),pe=U(r),Ie=J(r),ke=typeof t.fs.readdirWithFileTypes=="function";for(let c of n){let z=function(h){let y={path:h.relativePath,name:h.name,size:h.stat?.size??0,mtime:h.stat?.mtime?.getTime()??Date.now(),mode:h.stat?.mode??420,isDirectory:h.isDirectory,depth:h.depth,startingPoint:c},C=h.unreadable===void 0?[]:[{action:{type:"diagnostic",message:`find: ${h.relativePath}: ${h.unreadable}
|
|
13
|
+
`},path:h.relativePath,printfData:y}],k=w=>l?[...C,...w]:[...w,...C];if(!(a===null||h.depth>=a))return C;let g=!0,m=[];if(r!==null){let w=Date.now(),S;if(Ie)S=B(r,h.name,h.relativePath,h.isFile,h.isDirectory);else{let b={name:h.name,relativePath:h.relativePath,isFile:h.isFile,isDirectory:h.isDirectory,isEmpty:h.isEmpty,mtime:h.stat?.mtime?.getTime()??Date.now(),size:h.stat?.size??0,mode:h.stat?.mode??420,newerRefTimes:ne};S=R(r,b)}g=S.matches,m=S.actions??[],p.evalCalls++,p.evalTime+=Date.now()-w}if(!u&&g&&(m=[{type:"print"}]),m.length===0)return C;O.checkpoint(m.length);let T=[];for(let w of m)T.push({action:w,path:h.relativePath,printfData:y});return k(T)};var Ge=z;c.length>1&&c.endsWith("/")&&(c=c.slice(0,-1));let f=t.fs.resolvePath(t.cwd,c);try{await t.fs.stat(f)}catch{q(`find: ${c}: No such file or directory
|
|
14
|
+
`),F=1;continue}let p=Fe(),D=Date.now();async function x(h){let{path:y,depth:C,typeInfo:k}=h;if(O.visit(C),p.nodeCount++,C>(s??t.limits.maxTraversalDepth))return null;let $,g,m;if(k&&!xe)$=k.isFile,g=k.isDirectory;else{try{let W=Date.now();m=await t.fs.lstat(y),p.statCalls++,p.statTime+=Date.now()-W}catch{return null}if(!m)return null;$=m.isFile,g=m.isDirectory}let T;y===f?T=c.split("/").pop()||c:T=y.split("/").pop()||"";let w=y===f?c:c==="."?`./${y.slice(f==="/"?f.length:f.length+1)}`:c+y.slice(f.length),S=[],b=null,E=null,I=!1;g&&pe&&!l&&(I=Ee(r,{name:T,relativePath:w,isFile:$,isDirectory:g}).shouldPrune,I&&p.earlyPrunes++);let H=!(C>=(s??t.limits.maxTraversalDepth))&&!I,K=(H||$e)&&!I,X;if(g&&K){let W=Date.now();try{ke&&t.fs.readdirWithFileTypes?b=await t.fs.readdirWithFileTypes(y):E=await t.fs.readdir(y)}catch(M){let A=Be(M);if(A===null)throw M;X=A,p.readdirCalls++,p.readdirTime+=Date.now()-W}if(b!==null){O.checkpoint(),O.discover(b.length),E=[];for(let M of b)E.push(M.name);if(p.readdirCalls++,p.readdirTime+=Date.now()-W,H)for(let M=0;M<b.length;M++){let A=b[M];S.push({path:y==="/"?`/${A.name}`:`${y}/${A.name}`,depth:C+1,typeInfo:{isFile:A.isFile,isDirectory:A.isDirectory},resultIndex:M})}}else if(E!==null&&(O.checkpoint(),O.discover(E.length),p.readdirCalls++,p.readdirTime+=Date.now()-W,H))for(let M=0;M<E.length;M++){let A=E[M];S.push({path:y==="/"?`/${A}`:`${y}/${A}`,depth:C+1,resultIndex:M})}}let Y=$?(m?.size??0)===0:E!==null&&E.length===0,re=I;if(!l&&r!==null&&!I&&pe){let W=Date.now(),M={name:T,relativePath:w,isFile:$,isDirectory:g,isEmpty:Y,mtime:m?.mtime?.getTime()??Date.now(),size:m?.size??0,mode:m?.mode??420,newerRefTimes:ne};re=R(r,M).pruned,p.evalCalls++,p.evalTime+=Date.now()-W}return{relativePath:w,name:T,isFile:$,isDirectory:g,isEmpty:Y,stat:m,depth:C,children:re?[]:S,pruned:re,unreadable:X}}async function Ne(){let h={effects:[]};if(l){let y=[],C=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],k=new Map,$=0;for(;$<C.length;){let g=Date.now(),m=Math.min(C.length,$+De),T=C.slice($,m);$=m;let w=await Promise.all(T.map(S=>x(S.item).catch(b=>{if(b instanceof le)return null;throw b})));p.batchCount++,p.batchTime+=Date.now()-g;for(let S=0;S<T.length;S++){let b=w[S],E=T[S];if(!b)continue;let I=y.length;if(E.parentIndex>=0){let v=k.get(E.parentIndex)||[];v.push(I),k.set(E.parentIndex,v)}y.push({node:b,parentIndex:E.parentIndex,childIndices:[]});for(let v=0;v<b.children.length;v++)C.push({item:b.children[v],parentIndex:I,childOrderInParent:v})}}for(let[g,m]of k)g>=0&&g<y.length&&(y[g].childIndices=m);if(y.length>0){let g=[{index:0,visited:!1}];for(;g.length>0;){O.checkpoint();let m=g.pop();if(!m)break;let T=y[m.index];if(T){if(m.visited){for(let w of z(T.node))h.effects.push(w);continue}g.push({index:m.index,visited:!0});for(let w=T.childIndices.length-1;w>=0;w--)g.push({index:T.childIndices[w],visited:!1})}}}}else{let y=new Map,C=0,k=[{item:{path:f,depth:0,resultIndex:0},orderIndex:C++}],$=new Map,g=0;for(;g<k.length;){let T=Date.now(),w=Math.min(k.length,g+De),S=k.slice(g,w);g=w;let b=await Promise.all(S.map(async({item:E,orderIndex:I})=>{try{let v=await x(E);return v?{node:v,orderIndex:I}:null}catch(v){if(v instanceof le)return null;throw v}}));p.batchCount++,p.batchTime+=Date.now()-T;for(let E of b){if(!E)continue;let{node:I,orderIndex:v}=E,H=z(I);if(H.length>0&&y.set(v,H),I.children.length>0){let K=[];for(let X of I.children){let Y=C++;K.push(Y),k.push({item:X,orderIndex:Y})}$.set(v,K)}}}let m=[0];for(;m.length>0;){O.checkpoint();let T=m.pop();if(T===void 0)break;let w=y.get(T);if(w)for(let b of w)h.effects.push(b);let S=$.get(T);if(S)for(let b=S.length-1;b>=0;b--)m.push(S[b])}}return h}let de=await Ne();for(let h of de.effects)N.push(h);if(t.trace){let h=Date.now()-D;ze(t.trace,p,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:c,resultsFound:de.effects.filter(y=>y.action.type!=="diagnostic").length}})}}let se=new Map;for(let c of N){let{action:f,path:p}=c;switch(f.type){case"diagnostic":q(f.message),F=1;break;case"print":G(`${p}
|
|
15
|
+
`);break;case"print0":G(`${p}\0`);break;case"printf":G(Oe(f.format,c.printfData));break;case"delete":{let D=t.fs.resolvePath(t.cwd,p);try{await t.fs.rm(D,{recursive:!1})}catch(x){let z=x instanceof Error?x.message:String(x);q(`find: cannot delete '${p}': ${z}
|
|
16
|
+
`),F=1}break}case"exec":{if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context
|
|
17
|
+
`,exitCode:1};if(f.batchMode){let z=se.get(f)??[];z.push(p),se.set(f,z);break}let D=f.command.map(z=>z==="{}"?p:z),x=await t.exec(ce([D[0]]),{cwd:t.cwd,signal:t.signal,args:D.slice(1)});P?P.appendResult(x):(G(x.stdout),q(x.stderr)),x.exitCode!==0&&(F=x.exitCode);break}}}for(let[c,f]of se){if(c.type!=="exec"||!t.exec||f.length===0)continue;let p=[];for(let x of c.command)x==="{}"?p.push(...f):p.push(x);let D=await t.exec(ce([p[0]]),{cwd:t.cwd,signal:t.signal,args:p.slice(1)});P?P.appendResult(D):(G(D.stdout),q(D.stderr)),D.exitCode!==0&&(F=D.exitCode)}return P?.build(F)??{stdout:V.join(""),stderr:ue.join(""),exitCode:F}}};function te(e){return e?e.type==="action"?[e.action]:e.type==="not"?te(e.expr):e.type==="and"||e.type==="or"?[...te(e.left),...te(e.right)]:[]:[]}function Oe(e,t){let n=ye(e),s="",a=0;for(;a<n.length;)if(n[a]==="%"&&a+1<n.length){if(a++,n[a]==="%"){s+="%",a++;continue}let[l,d,r]=me(n,a);if(a+=r,a>=n.length){s+="%";break}let i=n[a],o;switch(i){case"f":o=t.name,a++;break;case"h":{let u=t.path.lastIndexOf("/");o=u>0?t.path.slice(0,u):".",a++;break}case"p":o=t.path,a++;break;case"P":{let u=t.startingPoint;t.path===u?o="":t.path.startsWith(`${u}/`)?o=t.path.slice(u.length+1):u==="."&&t.path.startsWith("./")?o=t.path.slice(2):o=t.path,a++;break}case"s":o=String(t.size),a++;break;case"d":o=String(t.depth),a++;break;case"m":o=(t.mode&511).toString(8),a++;break;case"M":o=Te(t.mode,t.isDirectory),a++;break;case"t":{let u=new Date(t.mtime);o=We(u),a++;break}case"T":{if(a+1<n.length){let u=n[a+1],N=new Date(t.mtime);o=He(N,u),a+=2}else o="%T",a++;break}default:s+=`%${l!==0||d!==-1?`${l}.${d}`:""}${i}`,a++;continue}s+=he(o,l,d)}else s+=n[a],a++;return s}function We(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=t[e.getDay()],a=n[e.getMonth()],l=String(e.getDate()).padStart(2," "),d=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0"),o=e.getFullYear();return`${s} ${a} ${l} ${d}:${r}:${i} ${o}`}var Le=new Map([["EACCES","Permission denied"],["EIO","Input/output error"],["ELOOP","Too many levels of symbolic links"],["ENAMETOOLONG","File name too long"],["ENOENT","No such file or directory"],["ENOTDIR","Not a directory"],["EPERM","Permission denied"]]);function Be(e){let t=typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"?e.code:e instanceof Error?/^(E[A-Z]+)\b/.exec(e.message)?.[1]:void 0;return t===void 0?null:Le.get(t)??null}function He(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var rt={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0};export{st as a,rt as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-JZR2C63H.js";import"./chunk-BIJXTWZ4.js";import"./chunk-BRB5PJ3E.js";import"./chunk-3MRB66F4.js";import"./chunk-K27FY3ES.js";import"./chunk-623Q77WZ.js";import"./chunk-YERKK5B3.js";import"./chunk-O3PNT72D.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as findCommand,b as flagsForFuzzing};
|
package/dist/bin/{shell/chunks/flag-coverage-AGEO3F6X.js → chunks/flag-coverage-ERCJF44K.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{b as yr}from"./chunk-2ETT4ELS.js";import{b as Ir}from"./chunk-JBYLHCKP.js";import{d as Mr,e as jr,f as Ar}from"./chunk-UU42WPB7.js";import{b as $r}from"./chunk-572NXISH.js";import"./chunk-QES5OSUC.js";import{b as Sr}from"./chunk-SCQRBEQW.js";import{b as Tr}from"./chunk-XBOBVLRL.js";import"./chunk-IOFXLMNJ.js";import"./chunk-KP2UH5CJ.js";import{c as Br}from"./chunk-KH6YLKPE.js";import"./chunk-SS2OPV62.js";import{b as wr}from"./chunk-KG2KXL4Y.js";import{b as xr}from"./chunk-RE7Z53A3.js";import{b as kr}from"./chunk-GB3KUAFV.js";import{b as vr}from"./chunk-LOU52GPJ.js";import{b as qr}from"./chunk-VMVXACZ5.js";import{b as Cr}from"./chunk-TYBXHT6W.js";import{b as br}from"./chunk-AJF3OBTR.js";import{b as tr}from"./chunk-LJQIAFWS.js";import{b as lr}from"./chunk-LVT5R45K.js";import{b as ur}from"./chunk-QELDDRV5.js";import"./chunk-B2DRBHGQ.js";import{b as pr}from"./chunk-U6JTVQU6.js";import{b as er}from"./chunk-OY25E3ZN.js";import{b as dr}from"./chunk-UW4E5XU5.js";import{b as cr}from"./chunk-LXFMIXGA.js";import{b as hr}from"./chunk-WFVCEB5T.js";import"./chunk-2YLY6FJA.js";import{b as or}from"./chunk-SDGPS6XI.js";import{c as ar,d as sr}from"./chunk-KI54R2QB.js";import{b as ir}from"./chunk-IX6QY5JW.js";import{b as gr}from"./chunk-KUMHQGUR.js";import{c as mr,d as Fr}from"./chunk-MYTNZ7MA.js";import{b as zr}from"./chunk-2TEF4USR.js";import"./chunk-5NWK7A4R.js";import{b as fr}from"./chunk-OXV2B2YS.js";import{b as nr}from"./chunk-3ASHUC7C.js";import{b as R}from"./chunk-
|
|
3
|
+
import{b as yr}from"./chunk-2ETT4ELS.js";import{b as Ir}from"./chunk-JBYLHCKP.js";import{d as Mr,e as jr,f as Ar}from"./chunk-UU42WPB7.js";import{b as $r}from"./chunk-572NXISH.js";import"./chunk-QES5OSUC.js";import{b as Sr}from"./chunk-SCQRBEQW.js";import{b as Tr}from"./chunk-XBOBVLRL.js";import"./chunk-IOFXLMNJ.js";import"./chunk-KP2UH5CJ.js";import{c as Br}from"./chunk-KH6YLKPE.js";import"./chunk-SS2OPV62.js";import{b as wr}from"./chunk-KG2KXL4Y.js";import{b as xr}from"./chunk-RE7Z53A3.js";import{b as kr}from"./chunk-GB3KUAFV.js";import{b as vr}from"./chunk-LOU52GPJ.js";import{b as qr}from"./chunk-VMVXACZ5.js";import{b as Cr}from"./chunk-TYBXHT6W.js";import{b as br}from"./chunk-AJF3OBTR.js";import{b as tr}from"./chunk-LJQIAFWS.js";import{b as lr}from"./chunk-LVT5R45K.js";import{b as ur}from"./chunk-QELDDRV5.js";import"./chunk-B2DRBHGQ.js";import{b as pr}from"./chunk-U6JTVQU6.js";import{b as er}from"./chunk-OY25E3ZN.js";import{b as dr}from"./chunk-UW4E5XU5.js";import{b as cr}from"./chunk-LXFMIXGA.js";import{b as hr}from"./chunk-WFVCEB5T.js";import"./chunk-2YLY6FJA.js";import{b as or}from"./chunk-SDGPS6XI.js";import{c as ar,d as sr}from"./chunk-KI54R2QB.js";import{b as ir}from"./chunk-IX6QY5JW.js";import{b as gr}from"./chunk-KUMHQGUR.js";import{c as mr,d as Fr}from"./chunk-MYTNZ7MA.js";import{b as zr}from"./chunk-2TEF4USR.js";import"./chunk-5NWK7A4R.js";import{b as fr}from"./chunk-OXV2B2YS.js";import{b as nr}from"./chunk-3ASHUC7C.js";import{b as R}from"./chunk-JZR2C63H.js";import{b as U}from"./chunk-YJ5OCPSK.js";import{b as V}from"./chunk-Q2GOPGDA.js";import{b as W}from"./chunk-PXP4YYZA.js";import{b as X}from"./chunk-7LGT4LHQ.js";import{c as Y,d as Z}from"./chunk-YUZRUF5F.js";import{c as _,d as N}from"./chunk-DJAX3ZRG.js";import{b as rr}from"./chunk-PZQVSQX6.js";import{b as G}from"./chunk-Q3LE3Y66.js";import{b as H}from"./chunk-SC5TEGMM.js";import{b as J}from"./chunk-5SKEZPTU.js";import{b as K}from"./chunk-OYXHOZZ4.js";import{b as L}from"./chunk-C45GTJTD.js";import{b as O}from"./chunk-3M5OMKFS.js";import{b as P}from"./chunk-4JF56A3P.js";import{b as Q}from"./chunk-AGKL4LDL.js";import{b as j}from"./chunk-FONAGXRJ.js";import{b as A}from"./chunk-FHMIEBRM.js";import{b as $}from"./chunk-7FGDUBSN.js";import{b as S}from"./chunk-CTS7QXCJ.js";import{b as T}from"./chunk-I6MS5ZWE.js";import{b as B}from"./chunk-WPJ5CECR.js";import{b as D}from"./chunk-YIANER7Y.js";import{b as E}from"./chunk-HDWHYM2T.js";import{b as w}from"./chunk-APEQNYAO.js";import{b as x}from"./chunk-RC4UXNHA.js";import"./chunk-PLLMJHMV.js";import{b as k}from"./chunk-45DUHCXR.js";import{b as v}from"./chunk-Z3MXFCN7.js";import"./chunk-BIJXTWZ4.js";import{d as q,e as C,f as b}from"./chunk-OSW4MDDH.js";import"./chunk-BRB5PJ3E.js";import{b as y}from"./chunk-UFAYH3WW.js";import"./chunk-47IFMQYS.js";import"./chunk-3MRB66F4.js";import"./chunk-726WDFMQ.js";import{b as I}from"./chunk-M345X45Z.js";import{b as M}from"./chunk-BVBYPYA5.js";import{b as t}from"./chunk-QL33F2W6.js";import{b as l}from"./chunk-WLQ2KWS3.js";import{b as u}from"./chunk-HSWCKN2X.js";import{b as p}from"./chunk-KXSDVBJA.js";import{b as e}from"./chunk-KNTDFP7X.js";import{b as d}from"./chunk-BZJ77YQD.js";import{b as c}from"./chunk-G4AUMZUY.js";import{b as h}from"./chunk-OXEDIWNZ.js";import"./chunk-OGOISDGZ.js";import"./chunk-IXTPVJ6W.js";import"./chunk-ENEHPI32.js";import"./chunk-K27FY3ES.js";import"./chunk-MROECM42.js";import"./chunk-DTNGYQCJ.js";import"./chunk-623Q77WZ.js";import{b as i}from"./chunk-CMTQFWZK.js";import{b as g}from"./chunk-JLRB7DV3.js";import"./chunk-2UV6ZFHK.js";import"./chunk-C2BLJ3AE.js";import"./chunk-BFLKIASG.js";import{b as m}from"./chunk-WAJVRK5B.js";import"./chunk-HW2VJKFH.js";import"./chunk-YERKK5B3.js";import{b as F}from"./chunk-NDS7PYKD.js";import"./chunk-O3PNT72D.js";import"./chunk-7JZKVC3F.js";import{b as z}from"./chunk-HFVQCXYX.js";import{b as f}from"./chunk-6NG4ULJM.js";import"./chunk-UPUFWGHR.js";import{b as n}from"./chunk-AJ3CSZ34.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-I4IRHQDW.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";var Hr=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,k,v,q,C,b,y,I,M,j,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,kr,vr,qr,Cr,br,yr,Ir,Mr,jr,Ar,$r,Sr,Tr,Br];function Dr(){return Hr}var Er=new Map;for(let r of Dr())Er.set(r.name,new Set(r.flags.map(o=>o.flag)));function ta(r,o,Gr){let a=Er.get(o);if(!(!a||a.size===0))for(let s of Gr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{ta as emitFlagCoverage};
|
package/dist/bin/just-bash.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as Ln,b as Tn,c as Qt}from"./chunks/chunk-PEJXCXSY.js";import{b as kt,c as Ra,d as Da,e as Ia}from"./chunks/chunk-AQKIHX3Q.js";import{a as Br,b as sr}from"./chunks/chunk-OGOISDGZ.js";import{a as va,b as xa,d as nr,e as rr}from"./chunks/chunk-IXTPVJ6W.js";import{c as ai,e as Ca,f as Na}from"./chunks/chunk-ENEHPI32.js";import{a as Zt}from"./chunks/chunk-K27FY3ES.js";import{a as Gt,b as je,c as oi}from"./chunks/chunk-MROECM42.js";import{a as or,b as Pa}from"./chunks/chunk-DTNGYQCJ.js";import{a as me}from"./chunks/chunk-623Q77WZ.js";import{a as Wr,b as Vr}from"./chunks/chunk-C2BLJ3AE.js";import{a as Tr,b as Te}from"./chunks/chunk-BFLKIASG.js";import"./chunks/chunk-YERKK5B3.js";import{d as jt,e as In}from"./chunks/chunk-O3PNT72D.js";import"./chunks/chunk-7JZKVC3F.js";import{a as $a}from"./chunks/chunk-UPUFWGHR.js";import{a as ir,b as mt,c as Ht,d as zr,e as z,f as Mt,g as K,h as yt,i as On,j as ka,k as ot,l as _n}from"./chunks/chunk-UBA7DOWE.js";import{a as zt,b as Qe,c as Ke,d as _e,e as ze,f as Ue,g as q,h as ae,i as Xe,j as Ut,k as Fr,l as P,m as Ye,n as Pe,o as qt,p as Mr,q as st}from"./chunks/chunk-FUT3X2GJ.js";import{a as M,c as wn,e as Dn,f as Vt,g as ii}from"./chunks/chunk-CPKBPQ2C.js";import{a as N,c as it}from"./chunks/chunk-OHFB3M3X.js";import{a as Ft}from"./chunks/chunk-I4IRHQDW.js";import{a as qe}from"./chunks/chunk-PBOVSFTJ.js";import"./chunks/chunk-DN2YCFOR.js";import{resolve as ld}from"node:path";var Fn=[{name:"echo",load:async()=>(await import("./chunks/echo-NYDCCFWB.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-UJLF2DU2.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-YXCSED2H.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-EEX3YIOF.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-KDEZTR53.js")).mkdirCommand},{name:"mktemp",load:async()=>(await import("./chunks/mktemp-OYQYUB5H.js")).mktempCommand,handlesOwnVersion:!0},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-WGVUYGPF.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TVQAUQOG.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-HCMKNRM2.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XJWV46T5.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-35V6IA5V.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-XVC53673.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-V5F4BXZ2.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-YKLNXWZI.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-BF435HNQ.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-ABLEKDMV.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-PAHZX3MA.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-3KLVOCI2.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-VNNI7JDZ.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-B2DVJQVY.js")).rgCommand,handlesOwnVersion:!0},{name:"sed",load:async()=>(await import("./chunks/sed-66XZQ75T.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-LCV2AUIX.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-HBOCBBJQ.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-JMHDIJXT.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-URDMZCXL.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-LNJEMWBJ.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-QJG6BYAP.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-ETPC3LHV.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-CZTQCNOZ.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-4IZRRT7U.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-YEY7X54W.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-IQRKKT7D.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-JPOQORZF.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-CNUK76JL.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-OK6JHDWZ.js")).split},{name:"column",load:async()=>(await import("./chunks/column-AL4LR5PO.js")).column},{name:"join",load:async()=>(await import("./chunks/join-34DX7YK5.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-L4HKV5PD.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-
|
|
4
|
-
`)),Oa.set(e.name,r)),n.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:s}=await sr(import("./chunks/flag-coverage-
|
|
3
|
+
import{a as Ln,b as Tn,c as Qt}from"./chunks/chunk-PEJXCXSY.js";import{b as kt,c as Ra,d as Da,e as Ia}from"./chunks/chunk-AQKIHX3Q.js";import{a as Br,b as sr}from"./chunks/chunk-OGOISDGZ.js";import{a as va,b as xa,d as nr,e as rr}from"./chunks/chunk-IXTPVJ6W.js";import{c as ai,e as Ca,f as Na}from"./chunks/chunk-ENEHPI32.js";import{a as Zt}from"./chunks/chunk-K27FY3ES.js";import{a as Gt,b as je,c as oi}from"./chunks/chunk-MROECM42.js";import{a as or,b as Pa}from"./chunks/chunk-DTNGYQCJ.js";import{a as me}from"./chunks/chunk-623Q77WZ.js";import{a as Wr,b as Vr}from"./chunks/chunk-C2BLJ3AE.js";import{a as Tr,b as Te}from"./chunks/chunk-BFLKIASG.js";import"./chunks/chunk-YERKK5B3.js";import{d as jt,e as In}from"./chunks/chunk-O3PNT72D.js";import"./chunks/chunk-7JZKVC3F.js";import{a as $a}from"./chunks/chunk-UPUFWGHR.js";import{a as ir,b as mt,c as Ht,d as zr,e as z,f as Mt,g as K,h as yt,i as On,j as ka,k as ot,l as _n}from"./chunks/chunk-UBA7DOWE.js";import{a as zt,b as Qe,c as Ke,d as _e,e as ze,f as Ue,g as q,h as ae,i as Xe,j as Ut,k as Fr,l as P,m as Ye,n as Pe,o as qt,p as Mr,q as st}from"./chunks/chunk-FUT3X2GJ.js";import{a as M,c as wn,e as Dn,f as Vt,g as ii}from"./chunks/chunk-CPKBPQ2C.js";import{a as N,c as it}from"./chunks/chunk-OHFB3M3X.js";import{a as Ft}from"./chunks/chunk-I4IRHQDW.js";import{a as qe}from"./chunks/chunk-PBOVSFTJ.js";import"./chunks/chunk-DN2YCFOR.js";import{resolve as ld}from"node:path";var Fn=[{name:"echo",load:async()=>(await import("./chunks/echo-NYDCCFWB.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-UJLF2DU2.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-YXCSED2H.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-EEX3YIOF.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-KDEZTR53.js")).mkdirCommand},{name:"mktemp",load:async()=>(await import("./chunks/mktemp-OYQYUB5H.js")).mktempCommand,handlesOwnVersion:!0},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-WGVUYGPF.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TVQAUQOG.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-HCMKNRM2.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XJWV46T5.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-35V6IA5V.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-XVC53673.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-V5F4BXZ2.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-YKLNXWZI.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-BF435HNQ.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-ABLEKDMV.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-PAHZX3MA.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-3KLVOCI2.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-VNNI7JDZ.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-B2DVJQVY.js")).rgCommand,handlesOwnVersion:!0},{name:"sed",load:async()=>(await import("./chunks/sed-66XZQ75T.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-LCV2AUIX.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-HBOCBBJQ.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-JMHDIJXT.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-URDMZCXL.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-LNJEMWBJ.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-QJG6BYAP.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-ETPC3LHV.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-CZTQCNOZ.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-4IZRRT7U.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-YEY7X54W.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-IQRKKT7D.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-JPOQORZF.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-CNUK76JL.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-OK6JHDWZ.js")).split},{name:"column",load:async()=>(await import("./chunks/column-AL4LR5PO.js")).column},{name:"join",load:async()=>(await import("./chunks/join-34DX7YK5.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-L4HKV5PD.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-QM4ZVJ2E.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-C4CRGDXP.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-TPUFCYF6.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-ZGP6NPGS.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-YNAJTGCR.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-2TSVF4W7.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-2TSVF4W7.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-3R4G6HQY.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-3R4G6HQY.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-3HAU45KT.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-4AMMXFXL.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-KFTJGQLQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-KFTJGQLQ.js")).falseCommand},{name:"yes",load:async()=>(await import("./chunks/yes-2EQTNSIB.js")).yesCommand},{name:"clear",load:async()=>(await import("./chunks/clear-OE52K3TM.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-CFCBBWVH.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-CFCBBWVH.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-5SOTL7D7.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-OLYCF2PC.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-YLVT27CZ.js")).diffCommand,handlesOwnVersion:!0},{name:"date",load:async()=>(await import("./chunks/date-6MQGVWDY.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-4O22Z4DI.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-XMTXHNFF.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-J2DAZUIN.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-KBVCQ4WT.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-GLGO2VEZ.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-Z6KAYGDK.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-CATBXX76.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-YGSNBVY3.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-7M5LLZJY.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-FDNPIEKZ.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-EXVKU23F.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-G7X54RZL.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-DG4BMYM5.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-2I76DUQL.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-B5HDVKW6.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-TD5LZDUM.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-W5CL2E2W.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-W5CL2E2W.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-W5CL2E2W.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Fn.push({name:"tar",load:async()=>(await import("./chunks/tar-RPVTXGFJ.js")).tarCommand}),Fn.push({name:"yq",load:async()=>(await import("./chunks/yq-T6S3IDKY.js")).yqCommand}),Fn.push({name:"xan",load:async()=>(await import("./chunks/xan-XZHKEPJ4.js")).xanCommand}),Fn.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-57ACN7ES.js")).sqlite3Command}));var li=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(li.push({name:"python3",load:async()=>(await import("./chunks/python3-P6MZ44HK.js")).python3Command,handlesOwnVersion:!0}),li.push({name:"python",load:async()=>(await import("./chunks/python3-P6MZ44HK.js")).pythonCommand,handlesOwnVersion:!0}));var ci=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ci.push({name:"js-exec",load:async()=>(await import("./chunks/js-exec-LISDW7YC.js")).jsExecCommand,handlesOwnVersion:!0}),ci.push({name:"node",load:async()=>(await import("./chunks/js-exec-LISDW7YC.js")).nodeStubCommand}));var fd=[{name:"curl",load:async()=>(await import("./chunks/curl-HZ5SBTVY.js")).curlCommand}],Oa=new Map;function Ur(e){return{name:e.name,handlesOwnVersion:e.handlesOwnVersion,async execute(t,n){let r=Oa.get(e.name);if(r||(r=await Te.runTrustedAsync(()=>sr(e.load(),n.signal,`bash: ${e.name} was cancelled before it started
|
|
4
|
+
`)),Oa.set(e.name,r)),n.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:s}=await sr(import("./chunks/flag-coverage-ERCJF44K.js"),n.signal,`bash: ${e.name} was cancelled before it started
|
|
5
5
|
`);s(n.coverage,e.name,t)}return r.execute(t,n)}}}function _a(e){return(e?Fn.filter(n=>e.includes(n.name)):Fn).map(Ur)}function La(){return fd.map(Ur)}function Ta(){return li.map(Ur)}function Fa(){return ci.map(Ur)}var Ma=new WeakMap,Ba=new WeakSet;function ui(e){let t=Ma.get(e);return t===void 0&&(t=Object.freeze(Object.create(null)),Ma.set(e,t),Ba.add(t)),t}function Wa(e){return Ba.has(e)}var Va={maxSourceBytes:67108864,maxExecDepth:64,maxCallDepth:100,maxCommandCount:1e5,maxLoopIterations:1e5,maxAwkIterations:1e5,maxSedIterations:1e5,maxJqIterations:1e7,maxQueryTokens:1e5,maxQueryDepth:1e3,maxQueryElements:1e6,maxAwkParserTokens:1e5,maxAwkParserDepth:256,maxAwkParserOperations:1e6,maxCsvRows:1e6,maxCsvCells:1e7,maxWorkUnits:1e8,maxTraversalEntries:1e6,maxTraversalDepth:1e3,maxTraversalWork:1e6,maxLiveBytes:536870912,maxInputBytes:536870912,maxFileSystemBytes:1073741824,maxDatabaseBytes:1073741824,maxDatabaseResultBytes:268435456,maxArchiveBytes:1073741824,maxArchiveCompressedBytes:536870912,maxArchiveEntryBytes:536870912,maxArchiveEntries:1e6,maxWorkerMessageBytes:67108864,maxExecutionTimeMs:36e5,maxExtensionCleanupTimeMs:100,maxSqliteTimeoutMs:3e4,maxPythonTimeoutMs:3e4,maxJsTimeoutMs:3e4,maxJsMemoryBytes:67108864,maxGlobOperations:1e6,maxStringLength:67108864,maxArrayElements:1e6,maxHeredocSize:67108864,maxSubstitutionDepth:50,maxBraceExpansionResults:1e5,maxOutputSize:268435456,maxFileDescriptors:4096,maxSourceDepth:100},dd={...Va,maxSourceBytes:8*1024*1024,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxExtensionCleanupTimeMs:25,maxGlobOperations:1e5,maxStringLength:10*1024*1024,maxArrayElements:1e5,maxHeredocSize:10*1024*1024,maxBraceExpansionResults:1e4,maxOutputSize:10*1024*1024,maxFileDescriptors:1024,maxQueryTokens:25e3,maxQueryDepth:256,maxQueryElements:1e5,maxAwkParserTokens:25e3,maxAwkParserDepth:128,maxAwkParserOperations:1e5,maxCsvRows:1e5,maxCsvCells:1e6,maxWorkUnits:1e5,maxTraversalEntries:1e5,maxTraversalDepth:256,maxTraversalWork:1e5,maxLiveBytes:64*1024*1024,maxInputBytes:32*1024*1024,maxFileSystemBytes:128*1024*1024,maxDatabaseBytes:64*1024*1024,maxDatabaseResultBytes:16*1024*1024,maxArchiveBytes:128*1024*1024,maxArchiveCompressedBytes:64*1024*1024,maxArchiveEntryBytes:64*1024*1024,maxArchiveEntries:1e5,maxWorkerMessageBytes:16*1024*1024,maxExecutionTimeMs:3e4};function pd(e){return Number.isFinite(e)?Math.min(Math.max(0,Math.floor(e)),4294967295):4294967295}function fi(e,t="normal"){if(t!=="normal"&&t!=="hardened")throw new RangeError('executionLimitProfile must be "normal" or "hardened"');let n=t==="hardened"?dd:Va;if(!e)return{...n};let r={maxSourceBytes:e.maxSourceBytes??n.maxSourceBytes,maxExecDepth:e.maxExecDepth??n.maxExecDepth,maxCallDepth:e.maxCallDepth??n.maxCallDepth,maxCommandCount:e.maxCommandCount??n.maxCommandCount,maxLoopIterations:e.maxLoopIterations??n.maxLoopIterations,maxAwkIterations:e.maxAwkIterations??n.maxAwkIterations,maxSedIterations:e.maxSedIterations??n.maxSedIterations,maxJqIterations:e.maxJqIterations??n.maxJqIterations,maxQueryTokens:e.maxQueryTokens??n.maxQueryTokens,maxQueryDepth:e.maxQueryDepth??n.maxQueryDepth,maxQueryElements:e.maxQueryElements??n.maxQueryElements,maxAwkParserTokens:e.maxAwkParserTokens??n.maxAwkParserTokens,maxAwkParserDepth:e.maxAwkParserDepth??n.maxAwkParserDepth,maxAwkParserOperations:e.maxAwkParserOperations??n.maxAwkParserOperations,maxCsvRows:e.maxCsvRows??n.maxCsvRows,maxCsvCells:e.maxCsvCells??n.maxCsvCells,maxWorkUnits:e.maxWorkUnits??n.maxWorkUnits,maxTraversalEntries:e.maxTraversalEntries??n.maxTraversalEntries,maxTraversalDepth:e.maxTraversalDepth??n.maxTraversalDepth,maxTraversalWork:e.maxTraversalWork??n.maxTraversalWork,maxLiveBytes:e.maxLiveBytes??n.maxLiveBytes,maxInputBytes:e.maxInputBytes??n.maxInputBytes,maxFileSystemBytes:e.maxFileSystemBytes??n.maxFileSystemBytes,maxDatabaseBytes:e.maxDatabaseBytes??n.maxDatabaseBytes,maxDatabaseResultBytes:e.maxDatabaseResultBytes??n.maxDatabaseResultBytes,maxArchiveBytes:e.maxArchiveBytes??n.maxArchiveBytes,maxArchiveCompressedBytes:e.maxArchiveCompressedBytes??n.maxArchiveCompressedBytes,maxArchiveEntryBytes:e.maxArchiveEntryBytes??n.maxArchiveEntryBytes,maxArchiveEntries:e.maxArchiveEntries??n.maxArchiveEntries,maxWorkerMessageBytes:e.maxWorkerMessageBytes??n.maxWorkerMessageBytes,maxExecutionTimeMs:e.maxExecutionTimeMs??n.maxExecutionTimeMs,maxExtensionCleanupTimeMs:e.maxExtensionCleanupTimeMs??n.maxExtensionCleanupTimeMs,maxSqliteTimeoutMs:e.maxSqliteTimeoutMs??n.maxSqliteTimeoutMs,maxPythonTimeoutMs:e.maxPythonTimeoutMs??n.maxPythonTimeoutMs,maxJsTimeoutMs:e.maxJsTimeoutMs??n.maxJsTimeoutMs,maxJsMemoryBytes:pd(e.maxJsMemoryBytes??n.maxJsMemoryBytes),maxGlobOperations:e.maxGlobOperations??n.maxGlobOperations,maxStringLength:e.maxStringLength??n.maxStringLength,maxArrayElements:e.maxArrayElements??n.maxArrayElements,maxHeredocSize:e.maxHeredocSize??n.maxHeredocSize,maxSubstitutionDepth:e.maxSubstitutionDepth??n.maxSubstitutionDepth,maxBraceExpansionResults:e.maxBraceExpansionResults??n.maxBraceExpansionResults,maxOutputSize:e.maxOutputSize??n.maxOutputSize,maxFileDescriptors:e.maxFileDescriptors??n.maxFileDescriptors,maxSourceDepth:e.maxSourceDepth??n.maxSourceDepth};for(let s of Object.keys(r)){let i=r[s];if(i!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(i)||i<0))throw new RangeError(`${s} must be a non-negative safe integer or positive Infinity`)}return r}function za(e){return"load"in e&&typeof e.load=="function"}function Ua(e){let t=null,n=!1,r=new Set,s=a=>{t=a;for(let l of r)l.resolve(a);r.clear()},i=a=>{n=!1;for(let l of r)l.reject(a);r.clear()},o=()=>{n=!0;let a;try{a=Promise.resolve(e.load())}catch(l){i(l);return}Na.call(a,s,i)};return{name:e.name,trusted:e.trusted!==!1,handlesOwnVersion:e.handlesOwnVersion,async execute(a,l){if(!t){let u,f=new Promise((d,p)=>{u={resolve:d,reject:p},r.add(u)});n||o();try{t=await sr(f,l.signal,`bash: ${e.name} was cancelled before it started
|
|
6
6
|
`)}finally{u&&r.delete(u)}}let c=t;if(!c)throw new Error(`Failed to load command: ${e.name}`);return c.execute(a,l)}}}var qa=Object.freeze(Object.create(null)),qr=class{limits;signal;abortOnUnresolvedCommands;commandCount=0;workUnits=0;liveBytes=0;inputBytes=0;outputBytes=0;countersByKind=new Map;bytesByKind=new Map;depthByKind=new Map;cleanupCallbacks=[];poisoned;closed=!1;startedAt=Date.now();unresolvedCommands=new Set;get remainingLiveBytes(){return Math.max(0,this.limits.maxLiveBytes-this.liveBytes)}get outputBytesUsed(){return this.outputBytes}constructor(t,n=void 0,r=!1){this.limits=t,this.signal=n,this.abortOnUnresolvedCommands=r}recordUnresolvedCommand(t){this.unresolvedCommands.add(t)}get unresolvedCommandNames(){return[...this.unresolvedCommands]}fail(t){throw this.poisoned??=t,this.poisoned}poisonAfterAbort(t){this.poisoned??=t}assertUsable(){if(this.poisoned)throw this.poisoned;if(this.closed)throw new Error("execution budget is already closed");this.throwIfAborted()}chargeCommand(){return this.consume("commands",1,"execution")}consumeWork(t=1,n="execution"){return this.consume("work",t,n)}consumeLimited(t,n,r,s=t){this.assertUsable();let i=this.countersByKind.get(t)??0;return(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(r)||r<0||n>r-i)&&this.fail(new P(`${s}: ${t} work limit exceeded (${r})`,"iterations")),n>this.limits.maxWorkUnits-this.workUnits&&this.fail(new P(`${s}: aggregate work limit exceeded (${this.limits.maxWorkUnits})`,"iterations")),this.countersByKind.set(t,i+n),this.workUnits+=n,i+n}consumeInput(t,n="execution"){return this.assertUsable(),(!Number.isSafeInteger(t)||t<0||t>this.limits.maxInputBytes-this.inputBytes)&&this.fail(new P(`${n}: aggregate input size limit exceeded (${this.limits.maxInputBytes} bytes)`,"string_length")),this.inputBytes+=t,this.inputBytes}consume(t,n=1,r=t){this.assertUsable();let s=this.countersByKind.get(t)??0,i=t==="commands"?this.commandCount:this.workUnits,o=t==="commands"?this.limits.maxCommandCount:this.limits.maxWorkUnits;(!Number.isSafeInteger(n)||n<0||n>o-i)&&this.fail(new P(t==="commands"?`too many commands executed (>${o}), increase executionLimits.maxCommandCount`:`${r}: ${t} work limit exceeded (${o})`,t==="commands"?"commands":"iterations"));let a=i+n;return t==="commands"?this.commandCount=a:this.workUnits=a,this.countersByKind.set(t,s+n),a}reserveBytes(t,n,r){this.assertUsable();let s=typeof t=="string"?t:"live",i=typeof t=="string"?n:t,o=typeof t=="string"?r??s:n??"execution";(!Number.isSafeInteger(i)||i<0||i>this.limits.maxLiveBytes-this.liveBytes)&&this.fail(new P(`${o}: live byte limit exceeded (${this.limits.maxLiveBytes} bytes)`,"string_length")),this.liveBytes+=i,this.bytesByKind.set(s,(this.bytesByKind.get(s)??0)+i);let a=!1;return{release:()=>{if(a)return;a=!0,this.liveBytes-=i;let l=(this.bytesByKind.get(s)??i)-i;l<=0?this.bytesByKind.delete(s):this.bytesByKind.set(s,l)}}}appendOutput(t,n,r="execution",s=0,i="text"){this.assertUsable();let o=i==="bytes"?n.length:M(n);(!Number.isSafeInteger(s)||s<0||s>o)&&this.fail(new P(`${r}: invalid ${t} accounting`,"output_size"));let a=o-s;return a>this.limits.maxOutputSize-this.outputBytes&&this.fail(new P(`${r}: total output size exceeded (>${this.limits.maxOutputSize} bytes), increase executionLimits.maxOutputSize`,"output_size")),this.outputBytes+=a,o}accountResult(t,n="execution",r=Number.POSITIVE_INFINITY){let s=t.internalOutputAccounting,i=Math.min(s?.stdout??0,r),o=Math.min(s?.stderr??0,Math.max(0,r-i)),a=this.appendOutput("stdout",t.stdout,n,i,t.stdoutKind==="bytes"||t.stdoutEncoding==="binary"?"bytes":"text"),l=this.appendOutput("stderr",t.stderr,n,o);return Object.isExtensible(t)?(t.internalOutputAccounting={stdout:a,stderr:l},t):a===0&&l===0?t:{...t,internalOutputAccounting:{stdout:a,stderr:l}}}relinquishOutput(t,n,r){this.assertUsable(),r!==qa&&this.fail(new P(`${n}: unauthorized output accounting release`,"output_size")),(!Number.isSafeInteger(t)||t<0||t>this.outputBytes)&&this.fail(new P(`${n}: invalid output accounting release`,"output_size")),this.outputBytes-=t}enterDepth(t,n=this.limits.maxCallDepth,r){this.assertUsable();let s=typeof n=="number"?n:this.limits.maxCallDepth,i=typeof n=="string"?n:r??t,o=this.depthByKind.get(t)??0;o>=s&&this.fail(new P(`${i}: maximum depth (${s}) exceeded`,"recursion")),this.depthByKind.set(t,o+1);let a=!1;return{release:()=>{if(a)return;a=!0;let l=(this.depthByKind.get(t)??1)-1;l<=0?this.depthByKind.delete(t):this.depthByKind.set(t,l)}}}throwIfAborted(t="execution"){this.signal?.aborted&&this.fail(new Ye("",`bash: ${t} aborted
|
|
7
7
|
`)),Date.now()-this.startedAt>this.limits.maxExecutionTimeMs&&this.fail(new Ye("",`bash: ${t} exceeded execution deadline (${this.limits.maxExecutionTimeMs}ms)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
+
import{a as Te}from"./chunk-BIJXTWZ4.js";import{a as Z}from"./chunk-BRB5PJ3E.js";import{a as ce}from"./chunk-3MRB66F4.js";import{a as Se}from"./chunk-K27FY3ES.js";import{a as oe}from"./chunk-623Q77WZ.js";import{b as he,c as me,d as ye}from"./chunk-YERKK5B3.js";import{d as be}from"./chunk-AIWBN36Z.js";import{l as ae,m as le}from"./chunk-FUT3X2GJ.js";import{a as ie}from"./chunk-CPKBPQ2C.js";import{a as ge,b as we}from"./chunk-MUFNRCMY.js";function R(e,t){switch(e.type){case"name":{let n=e.pattern,s=n.match(/^\*(\.[a-zA-Z0-9]+)$/);if(s){let a=s[1],l=t.name;if(e.ignoreCase){if(!l.toLowerCase().endsWith(a.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!l.endsWith(a))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Z(t.name,n,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let n=e.pattern,s=t.relativePath,a=n.split("/");for(let d=0;d<a.length-1;d++){let r=a[d];if(r&&r!=="."&&r!==".."&&!r.includes("*")&&!r.includes("?")&&!r.includes("[")){let i=`/${r}/`;if(e.ignoreCase){if(!s.toLowerCase().includes(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!s.includes(i))return{matches:!1,pruned:!1,printed:!1}}}let l=n.match(/\*(\.[a-zA-Z0-9]+)$/);if(l){let d=l[1];if(e.ignoreCase){if(!s.toLowerCase().endsWith(d.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!s.endsWith(d))return{matches:!1,pruned:!1,printed:!1}}return{matches:Z(s,n,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let n=e.ignoreCase?"i":"";return{matches:oe(e.pattern,n).test(t.relativePath),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:t.isFile,pruned:!1,printed:!1}:e.fileType==="d"?{matches:t.isDirectory,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"empty":return{matches:t.isEmpty,pruned:!1,printed:!1};case"mtime":{let s=(Date.now()-t.mtime)/(1e3*60*60*24),a;return e.comparison==="more"?a=s>e.days:e.comparison==="less"?a=s<e.days:a=Math.floor(s)===e.days,{matches:a,pruned:!1,printed:!1}}case"newer":{let n=t.newerRefTimes.get(e.refPath);return n===void 0?{matches:!1,pruned:!1,printed:!1}:{matches:t.mtime>n,pruned:!1,printed:!1}}case"size":{let n=e.value;switch(e.unit){case"c":n=e.value;break;case"k":n=e.value*1024;break;case"M":n=e.value*1024*1024;break;case"G":n=e.value*1024*1024*1024;break;case"b":n=e.value*512;break}let s;return e.comparison==="more"?s=t.size>n:e.comparison==="less"?s=t.size<n:e.unit==="b"?s=Math.ceil(t.size/512)===e.value:s=t.size===n,{matches:s,pruned:!1,printed:!1}}case"perm":{let n=t.mode&511,s=e.mode&511,a;return e.matchType==="exact"?a=n===s:e.matchType==="all"?a=(n&s)===s:a=(n&s)!==0,{matches:a,pruned:!1,printed:!1}}case"prune":return{matches:!0,pruned:!0,printed:!1};case"action":return{matches:!0,pruned:!1,printed:!1,actions:[e.action]};case"not":{let n=R(e.expr,t);return{matches:!n.matches,pruned:n.pruned,printed:!1,actions:n.actions}}case"and":{let n=R(e.left,t);if(!n.matches)return{matches:!1,pruned:n.pruned,printed:!1,actions:n.actions};let s=R(e.right,t);return{matches:s.matches,pruned:n.pruned||s.pruned,printed:n.printed||s.printed,actions:[...n.actions??[],...s.actions??[]]}}case"or":{let n=R(e.left,t);if(n.matches)return n;let s=R(e.right,t);return{matches:s.matches,pruned:n.pruned||s.pruned,printed:s.printed,actions:[...n.actions??[],...s.actions??[]]}}}}function _(e){if(!e)return!1;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!1;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!0;case"not":return _(e.expr);case"and":case"or":return _(e.left)||_(e.right)}}function j(e){if(!e)return!1;switch(e.type){case"empty":return!0;case"not":return j(e.expr);case"and":case"or":return j(e.left)||j(e.right);default:return!1}}function Ce(e){let t=[],n=s=>{s&&(s.type==="newer"?t.push(s.refPath):s.type==="not"?n(s.expr):(s.type==="and"||s.type==="or")&&(n(s.left),n(s.right)))};return n(e),t}function J(e){if(!e)return!0;switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!0;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return J(e.expr);case"and":case"or":return J(e.left)&&J(e.right)}}function B(e,t,n,s,a){switch(e.type){case"name":{let l=e.pattern,d=l.match(/^\*(\.[a-zA-Z0-9]+)$/);if(d){let r=d[1];if(e.ignoreCase){if(!t.toLowerCase().endsWith(r.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!t.endsWith(r))return{matches:!1,pruned:!1,printed:!1};return{matches:!0,pruned:!1,printed:!1}}return{matches:Z(t,l,e.ignoreCase),pruned:!1,printed:!1}}case"path":{let l=e.pattern,d=l.split("/");for(let i=0;i<d.length-1;i++){let o=d[i];if(o&&o!=="."&&o!==".."&&!o.includes("*")&&!o.includes("?")&&!o.includes("[")){let u=`/${o}/`;if(e.ignoreCase){if(!n.toLowerCase().includes(u.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.includes(u))return{matches:!1,pruned:!1,printed:!1}}}let r=l.match(/\*(\.[a-zA-Z0-9]+)$/);if(r){let i=r[1];if(e.ignoreCase){if(!n.toLowerCase().endsWith(i.toLowerCase()))return{matches:!1,pruned:!1,printed:!1}}else if(!n.endsWith(i))return{matches:!1,pruned:!1,printed:!1}}return{matches:Z(n,l,e.ignoreCase),pruned:!1,printed:!1}}case"regex":try{let l=e.ignoreCase?"i":"";return{matches:oe(e.pattern,l).test(n),pruned:!1,printed:!1}}catch{return{matches:!1,pruned:!1,printed:!1}}case"type":return e.fileType==="f"?{matches:s,pruned:!1,printed:!1}:e.fileType==="d"?{matches:a,pruned:!1,printed:!1}:{matches:!1,pruned:!1,printed:!1};case"prune":return{matches:!0,pruned:!0,printed:!1};case"action":return{matches:!0,pruned:!1,printed:!1,actions:[e.action]};case"not":{let l=B(e.expr,t,n,s,a);return{matches:!l.matches,pruned:l.pruned,printed:!1,actions:l.actions}}case"and":{let l=B(e.left,t,n,s,a);if(!l.matches)return{matches:!1,pruned:l.pruned,printed:!1,actions:l.actions};let d=B(e.right,t,n,s,a);return{matches:d.matches,pruned:l.pruned||d.pruned,printed:l.printed||d.printed,actions:[...l.actions??[],...d.actions??[]]}}case"or":{let l=B(e.left,t,n,s,a);if(l.matches)return l;let d=B(e.right,t,n,s,a);return{matches:d.matches,pruned:l.pruned||d.pruned,printed:d.printed,actions:[...l.actions??[],...d.actions??[]]}}default:return{matches:!1,pruned:!1,printed:!1}}}function U(e){if(!e)return!1;switch(e.type){case"prune":return!0;case"not":return U(e.expr);case"and":case"or":return U(e.left)||U(e.right);default:return!1}}function L(e){switch(e.type){case"name":case"path":case"regex":case"type":case"prune":return!0;case"action":return!1;case"empty":case"mtime":case"newer":case"size":case"perm":return!1;case"not":return L(e.expr);case"and":case"or":return L(e.left)&&L(e.right)}}function Ee(e,t){if(!e||!t.isDirectory)return{shouldPrune:!1};if(!L(e))return fe(e,t);let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:R(e,n).pruned}}function fe(e,t){switch(e.type){case"or":{if(L(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};if(R(e.left,n).pruned)return{shouldPrune:!0}}return fe(e.right,t)}case"and":{if(L(e.left)&&L(e.right)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return{shouldPrune:R(e,n).pruned}}if(L(e.left)){let n={name:t.name,relativePath:t.relativePath,isFile:t.isFile,isDirectory:t.isDirectory,isEmpty:!1,mtime:0,size:0,mode:0,newerRefTimes:new Map};return R(e.left,n).matches?fe(e.right,t):{shouldPrune:!1}}return{shouldPrune:!1}}case"not":return{shouldPrune:!1};default:return{shouldPrune:!1}}}function ve(e,t){let n=[],s=t,a=r=>({expr:null,pathIndex:s,error:`find: missing argument to \`${r}'
|
|
4
|
+
`}),l=(r,i)=>({expr:null,pathIndex:s,error:`find: invalid argument \`${i}' to \`${r}'
|
|
5
|
+
`});for(;s<e.length;){let r=e[s];if(r==="("||r==="\\("){n.push({type:"lparen"}),s++;continue}if(r===")"||r==="\\)"){n.push({type:"rparen"}),s++;continue}if(r==="-name"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"name",pattern:e[++s]}})}else if(r==="-iname"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"name",pattern:e[++s],ignoreCase:!0}})}else if(r==="-path"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"path",pattern:e[++s]}})}else if(r==="-ipath"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"path",pattern:e[++s],ignoreCase:!0}})}else if(r==="-regex"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"regex",pattern:e[++s]}})}else if(r==="-iregex"){if(s+1>=e.length)return a(r);n.push({type:"expr",expr:{type:"regex",pattern:e[++s],ignoreCase:!0}})}else if(r==="-type"){if(s+1>=e.length)return a(r);let i=e[++s];if(i==="f"||i==="d")n.push({type:"expr",expr:{type:"type",fileType:i}});else return{expr:null,pathIndex:s,error:`find: Unknown argument to -type: ${i}
|
|
6
|
+
`}}else if(r==="-empty")n.push({type:"expr",expr:{type:"empty"}});else if(r==="-mtime"){if(s+1>=e.length)return a(r);let i=e[++s],o="exact",u=i;if(i.startsWith("+")?(o="more",u=i.slice(1)):i.startsWith("-")&&(o="less",u=i.slice(1)),!/^\d+$/.test(u))return l(r,i);let N=Number(u);if(!Number.isSafeInteger(N))return l(r,i);n.push({type:"expr",expr:{type:"mtime",days:N,comparison:o}})}else if(r==="-newer"){if(s+1>=e.length)return a(r);let i=e[++s];n.push({type:"expr",expr:{type:"newer",refPath:i}})}else if(r==="-size"){if(s+1>=e.length)return a(r);let i=e[++s],o="exact",u=i;i.startsWith("+")?(o="more",u=i.slice(1)):i.startsWith("-")&&(o="less",u=i.slice(1));let N=u.match(/^(\d+)([ckMGb])?$/);if(!N)return l(r,i);let F=Number(N[1]);if(!Number.isSafeInteger(F))return l(r,i);let P=N[2]||"b",V=P==="G"?1024**3:P==="M"?1024**2:P==="k"?1024:P==="b"?512:1;if(!Number.isSafeInteger(F*V))return l(r,i);n.push({type:"expr",expr:{type:"size",value:F,unit:P,comparison:o}})}else if(r==="-perm"){if(s+1>=e.length)return a(r);let i=e[++s],o="exact",u=i;if(i.startsWith("-")?(o="all",u=i.slice(1)):i.startsWith("/")&&(o="any",u=i.slice(1)),!/^[0-7]{1,4}$/.test(u))return l(r,i);let N=Number.parseInt(u,8);n.push({type:"expr",expr:{type:"perm",mode:N,matchType:o}})}else if(r==="-prune")n.push({type:"expr",expr:{type:"prune"}});else if(r==="-not"||r==="!")n.push({type:"not"});else if(r==="-o"||r==="-or")n.push({type:"op",op:"or"});else if(r==="-a"||r==="-and")n.push({type:"op",op:"and"});else if(r==="-maxdepth"||r==="-mindepth"){if(s+1>=e.length)return a(r);s++}else if(r!=="-depth")if(r==="-exec"){let i=[];for(s++;s<e.length&&e[s]!==";"&&e[s]!=="+";)i.push(e[s]),s++;if(s>=e.length)return{expr:null,pathIndex:s,error:"find: missing argument to `-exec'\n"};if(i.length===0)return a("-exec");let o=e[s]==="+";if(o&&(i.at(-1)!=="{}"||i.filter(u=>u==="{}").length!==1))return l("-exec","+");n.push({type:"expr",expr:{type:"action",action:{type:"exec",command:i,batchMode:o}}})}else if(r==="-print")n.push({type:"expr",expr:{type:"action",action:{type:"print"}}});else if(r==="-print0")n.push({type:"expr",expr:{type:"action",action:{type:"print0"}}});else if(r==="-printf"){if(s+1>=e.length)return a(r);let i=e[++s];n.push({type:"expr",expr:{type:"action",action:{type:"printf",format:i}}})}else if(r==="-delete")n.push({type:"expr",expr:{type:"action",action:{type:"delete"}}});else return r.startsWith("-")?{expr:null,pathIndex:s,error:`find: unknown predicate '${r}'
|
|
7
|
+
`}:{expr:null,pathIndex:s,error:`find: paths must precede expression: \`${r}'
|
|
8
|
+
`};s++}if(n.length===0)return{expr:null,pathIndex:s};let d=Re(n);return d.error?{expr:null,pathIndex:s,error:d.error}:{expr:d.expr,pathIndex:s}}function Re(e){let t=0,n;function s(){let i=a();if(!i)return null;for(;t<e.length;){let o=e[t];if(o.type==="op"&&o.op==="or"){t++;let u=a();if(!u)return n="find: expected an expression after `-o'\n",null;i={type:"or",left:i,right:u}}else break}return i}function a(){let i=l();if(!i)return null;for(;t<e.length;){let o=e[t];if(o.type==="op"&&o.op==="and"){t++;let u=l();if(!u)return n="find: expected an expression after `-a'\n",null;i={type:"and",left:i,right:u}}else if(o.type==="expr"||o.type==="not"||o.type==="lparen"){let u=l();if(!u)return i;i={type:"and",left:i,right:u}}else break}return i}function l(){if(t<e.length&&e[t].type==="not"){t++;let i=l();return i?{type:"not",expr:i}:(n="find: expected an expression after `!'\n",null)}return d()}function d(){if(t>=e.length)return null;let i=e[t];if(i.type==="lparen"){t++;let o=s();return!o||t>=e.length||e[t].type!=="rparen"?(n="find: missing closing `)'\n",null):(t++,o)}return i.type==="expr"?(t++,i.expr):(i.type==="rparen",null)}let r=s();return!n&&t<e.length&&(n=e[t].type==="rparen"?"find: unexpected `)'\n":`find: invalid expression
|
|
9
|
+
`),!n&&r&&ee(r)&&(n="find: refusing to evaluate `-delete' under negation\n"),{expr:n?null:r,error:n}}function ee(e,t=!1){return e.type==="action"?t&&e.action.type==="delete":e.type==="not"?ee(e.expr,!t):e.type==="and"||e.type==="or"?ee(e.left,t)||ee(e.right,t):!1}var De=500;function Fe(){return{readdirCalls:0,readdirTime:0,statCalls:0,statTime:0,evalCalls:0,evalTime:0,nodeCount:0,batchCount:0,batchTime:0,earlyPrunes:0}}function ze(e,t,n){e({category:"find",name:"summary",durationMs:n,details:{readdirCalls:t.readdirCalls,readdirTimeMs:t.readdirTime,statCalls:t.statCalls,statTimeMs:t.statTime,evalCalls:t.evalCalls,evalTimeMs:t.evalTime,nodeCount:t.nodeCount,batchCount:t.batchCount,batchTimeMs:t.batchTime,earlyPrunes:t.earlyPrunes,otherTimeMs:n-t.readdirTime-t.statTime-t.evalTime-t.batchTime}})}var Ae={name:"find",summary:"search for files in a directory hierarchy",usage:"find [path...] [expression]",options:["-name PATTERN file name matches shell pattern PATTERN","-iname PATTERN like -name but case insensitive","-path PATTERN file path matches shell pattern PATTERN","-ipath PATTERN like -path but case insensitive","-regex PATTERN file path matches regular expression PATTERN","-iregex PATTERN like -regex but case insensitive","-type TYPE file is of type: f (regular file), d (directory)","-empty file is empty or directory is empty","-mtime N file's data was modified N*24 hours ago","-newer FILE file was modified more recently than FILE","-size N[ckMGb] file uses N units of space (c=bytes, k=KB, M=MB, G=GB, b=512B blocks)","-perm MODE file's permission bits are exactly MODE (octal)","-perm -MODE all permission bits MODE are set","-perm /MODE any permission bits MODE are set","-maxdepth LEVELS descend at most LEVELS directories","-mindepth LEVELS do not apply tests at levels less than LEVELS","-depth process directory contents before directory itself","-prune do not descend into this directory","-not, ! negate the following expression","-a, -and logical AND (default)","-o, -or logical OR","-exec CMD {} ; execute CMD on each file ({} is replaced by filename)","-exec CMD {} + execute CMD with multiple files at once","-print print the full file name (default action)","-print0 print the full file name followed by a null character","-printf FORMAT print FORMAT with directives: %f %h %p %P %s %d %m %M %t","-delete delete found files/directories"," --help display this help and exit"]},st={name:"find",async execute(e,t){if(we(e))return ge(Ae);let n=[],s=null,a=null,l=!1,d=e.length;for(let c=0;c<e.length;c++){let f=e[c];if(f.startsWith("-")||f==="("||f==="\\("||f===")"||f==="\\)"||f==="!"){d=c;break}n.push(f)}n.length===0&&n.push(".");for(let c=d;c<e.length;c++){let f=e[c];if(f==="-exec")for(c++;c<e.length&&e[c]!==";"&&e[c]!=="+";)c++;else if(f==="-maxdepth"||f==="-mindepth"){let p=e[c+1];if(p===void 0||!/^\d+$/.test(p))return{stdout:"",stderr:p===void 0?`find: missing argument to \`${f}'
|
|
10
|
+
`:`find: invalid argument \`${p}' to \`${f}'
|
|
11
|
+
`,exitCode:1};let D=Number(p);if(!Number.isSafeInteger(D))return{stdout:"",stderr:`find: invalid argument \`${p}' to \`${f}'
|
|
12
|
+
`,exitCode:1};f==="-maxdepth"?s=D:a=D,c++}else f==="-depth"&&(l=!0)}let{expr:r,error:i}=ve(e,d);if(i)return{stdout:"",stderr:i,exitCode:1};let o=te(r),u=o.length>0;o.some(c=>c.type==="delete")&&(l=!0);let N=[],F=0,P=t.executionScope?new Se(t.executionScope,"find"):void 0,V=[],ue=[],Q=0,O=new be({limits:t.limits,signal:t.signal,executionScope:t.executionScope,site:"find"}),G=c=>{if(P)P.append("stdout",c);else{let f=ie(c);if(f>t.limits.maxOutputSize-Q)throw new ae(`find: output size limit exceeded (${t.limits.maxOutputSize} bytes)`,"output_size");c&&V.push(c),Q+=f}},q=c=>{if(P)P.append("stderr",c);else{let f=ie(c);if(f>t.limits.maxOutputSize-Q)throw new ae(`find: output size limit exceeded (${t.limits.maxOutputSize} bytes)`,"output_size");c&&ue.push(c),Q+=f}},Me=Ce(r),ne=new Map;for(let c of Me){let f=t.fs.resolvePath(t.cwd,c);try{let p=await t.fs.stat(f);ne.set(c,p.mtime?.getTime()??Date.now())}catch{}}let Pe=o.some(c=>{if(c.type!=="printf")return!1;let f=c.format.replace(/%%/g,"");return/%[-+]?[0-9]*\.?[0-9]*(s|m|M|t|T)/.test(f)}),xe=_(r)||Pe,$e=j(r),pe=U(r),Ie=J(r),ke=typeof t.fs.readdirWithFileTypes=="function";for(let c of n){let z=function(h){let y={path:h.relativePath,name:h.name,size:h.stat?.size??0,mtime:h.stat?.mtime?.getTime()??Date.now(),mode:h.stat?.mode??420,isDirectory:h.isDirectory,depth:h.depth,startingPoint:c},C=h.unreadable===void 0?[]:[{action:{type:"diagnostic",message:`find: ${h.relativePath}: ${h.unreadable}
|
|
13
|
+
`},path:h.relativePath,printfData:y}],k=w=>l?[...C,...w]:[...w,...C];if(!(a===null||h.depth>=a))return C;let g=!0,m=[];if(r!==null){let w=Date.now(),S;if(Ie)S=B(r,h.name,h.relativePath,h.isFile,h.isDirectory);else{let b={name:h.name,relativePath:h.relativePath,isFile:h.isFile,isDirectory:h.isDirectory,isEmpty:h.isEmpty,mtime:h.stat?.mtime?.getTime()??Date.now(),size:h.stat?.size??0,mode:h.stat?.mode??420,newerRefTimes:ne};S=R(r,b)}g=S.matches,m=S.actions??[],p.evalCalls++,p.evalTime+=Date.now()-w}if(!u&&g&&(m=[{type:"print"}]),m.length===0)return C;O.checkpoint(m.length);let T=[];for(let w of m)T.push({action:w,path:h.relativePath,printfData:y});return k(T)};var Ge=z;c.length>1&&c.endsWith("/")&&(c=c.slice(0,-1));let f=t.fs.resolvePath(t.cwd,c);try{await t.fs.stat(f)}catch{q(`find: ${c}: No such file or directory
|
|
14
|
+
`),F=1;continue}let p=Fe(),D=Date.now();async function x(h){let{path:y,depth:C,typeInfo:k}=h;if(O.visit(C),p.nodeCount++,C>(s??t.limits.maxTraversalDepth))return null;let $,g,m;if(k&&!xe)$=k.isFile,g=k.isDirectory;else{try{let W=Date.now();m=await t.fs.lstat(y),p.statCalls++,p.statTime+=Date.now()-W}catch{return null}if(!m)return null;$=m.isFile,g=m.isDirectory}let T;y===f?T=c.split("/").pop()||c:T=y.split("/").pop()||"";let w=y===f?c:c==="."?`./${y.slice(f==="/"?f.length:f.length+1)}`:c+y.slice(f.length),S=[],b=null,E=null,I=!1;g&&pe&&!l&&(I=Ee(r,{name:T,relativePath:w,isFile:$,isDirectory:g}).shouldPrune,I&&p.earlyPrunes++);let H=!(C>=(s??t.limits.maxTraversalDepth))&&!I,K=(H||$e)&&!I,X;if(g&&K){let W=Date.now();try{ke&&t.fs.readdirWithFileTypes?b=await t.fs.readdirWithFileTypes(y):E=await t.fs.readdir(y)}catch(M){let A=Be(M);if(A===null)throw M;X=A,p.readdirCalls++,p.readdirTime+=Date.now()-W}if(b!==null){O.checkpoint(),O.discover(b.length),E=[];for(let M of b)E.push(M.name);if(p.readdirCalls++,p.readdirTime+=Date.now()-W,H)for(let M=0;M<b.length;M++){let A=b[M];S.push({path:y==="/"?`/${A.name}`:`${y}/${A.name}`,depth:C+1,typeInfo:{isFile:A.isFile,isDirectory:A.isDirectory},resultIndex:M})}}else if(E!==null&&(O.checkpoint(),O.discover(E.length),p.readdirCalls++,p.readdirTime+=Date.now()-W,H))for(let M=0;M<E.length;M++){let A=E[M];S.push({path:y==="/"?`/${A}`:`${y}/${A}`,depth:C+1,resultIndex:M})}}let Y=$?(m?.size??0)===0:E!==null&&E.length===0,re=I;if(!l&&r!==null&&!I&&pe){let W=Date.now(),M={name:T,relativePath:w,isFile:$,isDirectory:g,isEmpty:Y,mtime:m?.mtime?.getTime()??Date.now(),size:m?.size??0,mode:m?.mode??420,newerRefTimes:ne};re=R(r,M).pruned,p.evalCalls++,p.evalTime+=Date.now()-W}return{relativePath:w,name:T,isFile:$,isDirectory:g,isEmpty:Y,stat:m,depth:C,children:re?[]:S,pruned:re,unreadable:X}}async function Ne(){let h={effects:[]};if(l){let y=[],C=[{item:{path:f,depth:0,resultIndex:0},parentIndex:-1,childOrderInParent:0}],k=new Map,$=0;for(;$<C.length;){let g=Date.now(),m=Math.min(C.length,$+De),T=C.slice($,m);$=m;let w=await Promise.all(T.map(S=>x(S.item).catch(b=>{if(b instanceof le)return null;throw b})));p.batchCount++,p.batchTime+=Date.now()-g;for(let S=0;S<T.length;S++){let b=w[S],E=T[S];if(!b)continue;let I=y.length;if(E.parentIndex>=0){let v=k.get(E.parentIndex)||[];v.push(I),k.set(E.parentIndex,v)}y.push({node:b,parentIndex:E.parentIndex,childIndices:[]});for(let v=0;v<b.children.length;v++)C.push({item:b.children[v],parentIndex:I,childOrderInParent:v})}}for(let[g,m]of k)g>=0&&g<y.length&&(y[g].childIndices=m);if(y.length>0){let g=[{index:0,visited:!1}];for(;g.length>0;){O.checkpoint();let m=g.pop();if(!m)break;let T=y[m.index];if(T){if(m.visited){for(let w of z(T.node))h.effects.push(w);continue}g.push({index:m.index,visited:!0});for(let w=T.childIndices.length-1;w>=0;w--)g.push({index:T.childIndices[w],visited:!1})}}}}else{let y=new Map,C=0,k=[{item:{path:f,depth:0,resultIndex:0},orderIndex:C++}],$=new Map,g=0;for(;g<k.length;){let T=Date.now(),w=Math.min(k.length,g+De),S=k.slice(g,w);g=w;let b=await Promise.all(S.map(async({item:E,orderIndex:I})=>{try{let v=await x(E);return v?{node:v,orderIndex:I}:null}catch(v){if(v instanceof le)return null;throw v}}));p.batchCount++,p.batchTime+=Date.now()-T;for(let E of b){if(!E)continue;let{node:I,orderIndex:v}=E,H=z(I);if(H.length>0&&y.set(v,H),I.children.length>0){let K=[];for(let X of I.children){let Y=C++;K.push(Y),k.push({item:X,orderIndex:Y})}$.set(v,K)}}}let m=[0];for(;m.length>0;){O.checkpoint();let T=m.pop();if(T===void 0)break;let w=y.get(T);if(w)for(let b of w)h.effects.push(b);let S=$.get(T);if(S)for(let b=S.length-1;b>=0;b--)m.push(S[b])}}return h}let de=await Ne();for(let h of de.effects)N.push(h);if(t.trace){let h=Date.now()-D;ze(t.trace,p,h),t.trace({category:"find",name:"searchPath",durationMs:h,details:{path:c,resultsFound:de.effects.filter(y=>y.action.type!=="diagnostic").length}})}}let se=new Map;for(let c of N){let{action:f,path:p}=c;switch(f.type){case"diagnostic":q(f.message),F=1;break;case"print":G(`${p}
|
|
15
|
+
`);break;case"print0":G(`${p}\0`);break;case"printf":G(Oe(f.format,c.printfData));break;case"delete":{let D=t.fs.resolvePath(t.cwd,p);try{await t.fs.rm(D,{recursive:!1})}catch(x){let z=x instanceof Error?x.message:String(x);q(`find: cannot delete '${p}': ${z}
|
|
16
|
+
`),F=1}break}case"exec":{if(!t.exec)return{stdout:"",stderr:`find: -exec not supported in this context
|
|
17
|
+
`,exitCode:1};if(f.batchMode){let z=se.get(f)??[];z.push(p),se.set(f,z);break}let D=f.command.map(z=>z==="{}"?p:z),x=await t.exec(ce([D[0]]),{cwd:t.cwd,signal:t.signal,args:D.slice(1)});P?P.appendResult(x):(G(x.stdout),q(x.stderr)),x.exitCode!==0&&(F=x.exitCode);break}}}for(let[c,f]of se){if(c.type!=="exec"||!t.exec||f.length===0)continue;let p=[];for(let x of c.command)x==="{}"?p.push(...f):p.push(x);let D=await t.exec(ce([p[0]]),{cwd:t.cwd,signal:t.signal,args:p.slice(1)});P?P.appendResult(D):(G(D.stdout),q(D.stderr)),D.exitCode!==0&&(F=D.exitCode)}return P?.build(F)??{stdout:V.join(""),stderr:ue.join(""),exitCode:F}}};function te(e){return e?e.type==="action"?[e.action]:e.type==="not"?te(e.expr):e.type==="and"||e.type==="or"?[...te(e.left),...te(e.right)]:[]:[]}function Oe(e,t){let n=ye(e),s="",a=0;for(;a<n.length;)if(n[a]==="%"&&a+1<n.length){if(a++,n[a]==="%"){s+="%",a++;continue}let[l,d,r]=me(n,a);if(a+=r,a>=n.length){s+="%";break}let i=n[a],o;switch(i){case"f":o=t.name,a++;break;case"h":{let u=t.path.lastIndexOf("/");o=u>0?t.path.slice(0,u):".",a++;break}case"p":o=t.path,a++;break;case"P":{let u=t.startingPoint;t.path===u?o="":t.path.startsWith(`${u}/`)?o=t.path.slice(u.length+1):u==="."&&t.path.startsWith("./")?o=t.path.slice(2):o=t.path,a++;break}case"s":o=String(t.size),a++;break;case"d":o=String(t.depth),a++;break;case"m":o=(t.mode&511).toString(8),a++;break;case"M":o=Te(t.mode,t.isDirectory),a++;break;case"t":{let u=new Date(t.mtime);o=We(u),a++;break}case"T":{if(a+1<n.length){let u=n[a+1],N=new Date(t.mtime);o=He(N,u),a+=2}else o="%T",a++;break}default:s+=`%${l!==0||d!==-1?`${l}.${d}`:""}${i}`,a++;continue}s+=he(o,l,d)}else s+=n[a],a++;return s}function We(e){let t=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=t[e.getDay()],a=n[e.getMonth()],l=String(e.getDate()).padStart(2," "),d=String(e.getHours()).padStart(2,"0"),r=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0"),o=e.getFullYear();return`${s} ${a} ${l} ${d}:${r}:${i} ${o}`}var Le=new Map([["EACCES","Permission denied"],["EIO","Input/output error"],["ELOOP","Too many levels of symbolic links"],["ENAMETOOLONG","File name too long"],["ENOENT","No such file or directory"],["ENOTDIR","Not a directory"],["EPERM","Permission denied"]]);function Be(e){let t=typeof e=="object"&&e!==null&&"code"in e&&typeof e.code=="string"?e.code:e instanceof Error?/^(E[A-Z]+)\b/.exec(e.message)?.[1]:void 0;return t===void 0?null:Le.get(t)??null}function He(e,t){switch(t){case"@":return String(e.getTime()/1e3);case"Y":return String(e.getFullYear());case"m":return String(e.getMonth()+1).padStart(2,"0");case"d":return String(e.getDate()).padStart(2,"0");case"H":return String(e.getHours()).padStart(2,"0");case"M":return String(e.getMinutes()).padStart(2,"0");case"S":return String(e.getSeconds()).padStart(2,"0");case"T":return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:${String(e.getSeconds()).padStart(2,"0")}`;case"F":return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;default:return`%T${t}`}}var rt={name:"find",flags:[{flag:"-name",type:"value",valueHint:"pattern"},{flag:"-iname",type:"value",valueHint:"pattern"},{flag:"-type",type:"value",valueHint:"string"},{flag:"-maxdepth",type:"value",valueHint:"number"},{flag:"-mindepth",type:"value",valueHint:"number"},{flag:"-empty",type:"boolean"},{flag:"-print",type:"boolean"},{flag:"-print0",type:"boolean"}],needsFiles:!0};export{st as a,rt as b};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a,b}from"./chunk-
|
|
3
|
+
import{a,b}from"./chunk-JZR2C63H.js";import"./chunk-BIJXTWZ4.js";import"./chunk-BRB5PJ3E.js";import"./chunk-3MRB66F4.js";import"./chunk-K27FY3ES.js";import"./chunk-623Q77WZ.js";import"./chunk-YERKK5B3.js";import"./chunk-O3PNT72D.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-PBOVSFTJ.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";export{a as findCommand,b as flagsForFuzzing};
|
package/dist/bin/{chunks/flag-coverage-AGEO3F6X.js → shell/chunks/flag-coverage-ERCJF44K.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{b as yr}from"./chunk-2ETT4ELS.js";import{b as Ir}from"./chunk-JBYLHCKP.js";import{d as Mr,e as jr,f as Ar}from"./chunk-UU42WPB7.js";import{b as $r}from"./chunk-572NXISH.js";import"./chunk-QES5OSUC.js";import{b as Sr}from"./chunk-SCQRBEQW.js";import{b as Tr}from"./chunk-XBOBVLRL.js";import"./chunk-IOFXLMNJ.js";import"./chunk-KP2UH5CJ.js";import{c as Br}from"./chunk-KH6YLKPE.js";import"./chunk-SS2OPV62.js";import{b as wr}from"./chunk-KG2KXL4Y.js";import{b as xr}from"./chunk-RE7Z53A3.js";import{b as kr}from"./chunk-GB3KUAFV.js";import{b as vr}from"./chunk-LOU52GPJ.js";import{b as qr}from"./chunk-VMVXACZ5.js";import{b as Cr}from"./chunk-TYBXHT6W.js";import{b as br}from"./chunk-AJF3OBTR.js";import{b as tr}from"./chunk-LJQIAFWS.js";import{b as lr}from"./chunk-LVT5R45K.js";import{b as ur}from"./chunk-QELDDRV5.js";import"./chunk-B2DRBHGQ.js";import{b as pr}from"./chunk-U6JTVQU6.js";import{b as er}from"./chunk-OY25E3ZN.js";import{b as dr}from"./chunk-UW4E5XU5.js";import{b as cr}from"./chunk-LXFMIXGA.js";import{b as hr}from"./chunk-WFVCEB5T.js";import"./chunk-2YLY6FJA.js";import{b as or}from"./chunk-SDGPS6XI.js";import{c as ar,d as sr}from"./chunk-KI54R2QB.js";import{b as ir}from"./chunk-IX6QY5JW.js";import{b as gr}from"./chunk-KUMHQGUR.js";import{c as mr,d as Fr}from"./chunk-MYTNZ7MA.js";import{b as zr}from"./chunk-2TEF4USR.js";import"./chunk-5NWK7A4R.js";import{b as fr}from"./chunk-OXV2B2YS.js";import{b as nr}from"./chunk-3ASHUC7C.js";import{b as R}from"./chunk-
|
|
3
|
+
import{b as yr}from"./chunk-2ETT4ELS.js";import{b as Ir}from"./chunk-JBYLHCKP.js";import{d as Mr,e as jr,f as Ar}from"./chunk-UU42WPB7.js";import{b as $r}from"./chunk-572NXISH.js";import"./chunk-QES5OSUC.js";import{b as Sr}from"./chunk-SCQRBEQW.js";import{b as Tr}from"./chunk-XBOBVLRL.js";import"./chunk-IOFXLMNJ.js";import"./chunk-KP2UH5CJ.js";import{c as Br}from"./chunk-KH6YLKPE.js";import"./chunk-SS2OPV62.js";import{b as wr}from"./chunk-KG2KXL4Y.js";import{b as xr}from"./chunk-RE7Z53A3.js";import{b as kr}from"./chunk-GB3KUAFV.js";import{b as vr}from"./chunk-LOU52GPJ.js";import{b as qr}from"./chunk-VMVXACZ5.js";import{b as Cr}from"./chunk-TYBXHT6W.js";import{b as br}from"./chunk-AJF3OBTR.js";import{b as tr}from"./chunk-LJQIAFWS.js";import{b as lr}from"./chunk-LVT5R45K.js";import{b as ur}from"./chunk-QELDDRV5.js";import"./chunk-B2DRBHGQ.js";import{b as pr}from"./chunk-U6JTVQU6.js";import{b as er}from"./chunk-OY25E3ZN.js";import{b as dr}from"./chunk-UW4E5XU5.js";import{b as cr}from"./chunk-LXFMIXGA.js";import{b as hr}from"./chunk-WFVCEB5T.js";import"./chunk-2YLY6FJA.js";import{b as or}from"./chunk-SDGPS6XI.js";import{c as ar,d as sr}from"./chunk-KI54R2QB.js";import{b as ir}from"./chunk-IX6QY5JW.js";import{b as gr}from"./chunk-KUMHQGUR.js";import{c as mr,d as Fr}from"./chunk-MYTNZ7MA.js";import{b as zr}from"./chunk-2TEF4USR.js";import"./chunk-5NWK7A4R.js";import{b as fr}from"./chunk-OXV2B2YS.js";import{b as nr}from"./chunk-3ASHUC7C.js";import{b as R}from"./chunk-JZR2C63H.js";import{b as U}from"./chunk-YJ5OCPSK.js";import{b as V}from"./chunk-Q2GOPGDA.js";import{b as W}from"./chunk-PXP4YYZA.js";import{b as X}from"./chunk-7LGT4LHQ.js";import{c as Y,d as Z}from"./chunk-YUZRUF5F.js";import{c as _,d as N}from"./chunk-DJAX3ZRG.js";import{b as rr}from"./chunk-PZQVSQX6.js";import{b as G}from"./chunk-Q3LE3Y66.js";import{b as H}from"./chunk-SC5TEGMM.js";import{b as J}from"./chunk-5SKEZPTU.js";import{b as K}from"./chunk-OYXHOZZ4.js";import{b as L}from"./chunk-C45GTJTD.js";import{b as O}from"./chunk-3M5OMKFS.js";import{b as P}from"./chunk-4JF56A3P.js";import{b as Q}from"./chunk-AGKL4LDL.js";import{b as j}from"./chunk-FONAGXRJ.js";import{b as A}from"./chunk-FHMIEBRM.js";import{b as $}from"./chunk-7FGDUBSN.js";import{b as S}from"./chunk-CTS7QXCJ.js";import{b as T}from"./chunk-I6MS5ZWE.js";import{b as B}from"./chunk-WPJ5CECR.js";import{b as D}from"./chunk-YIANER7Y.js";import{b as E}from"./chunk-HDWHYM2T.js";import{b as w}from"./chunk-APEQNYAO.js";import{b as x}from"./chunk-RC4UXNHA.js";import"./chunk-PLLMJHMV.js";import{b as k}from"./chunk-45DUHCXR.js";import{b as v}from"./chunk-Z3MXFCN7.js";import"./chunk-BIJXTWZ4.js";import{d as q,e as C,f as b}from"./chunk-OSW4MDDH.js";import"./chunk-BRB5PJ3E.js";import{b as y}from"./chunk-UFAYH3WW.js";import"./chunk-47IFMQYS.js";import"./chunk-3MRB66F4.js";import"./chunk-726WDFMQ.js";import{b as I}from"./chunk-M345X45Z.js";import{b as M}from"./chunk-BVBYPYA5.js";import{b as t}from"./chunk-QL33F2W6.js";import{b as l}from"./chunk-WLQ2KWS3.js";import{b as u}from"./chunk-HSWCKN2X.js";import{b as p}from"./chunk-KXSDVBJA.js";import{b as e}from"./chunk-KNTDFP7X.js";import{b as d}from"./chunk-BZJ77YQD.js";import{b as c}from"./chunk-G4AUMZUY.js";import{b as h}from"./chunk-OXEDIWNZ.js";import"./chunk-OGOISDGZ.js";import"./chunk-IXTPVJ6W.js";import"./chunk-ENEHPI32.js";import"./chunk-K27FY3ES.js";import"./chunk-MROECM42.js";import"./chunk-DTNGYQCJ.js";import"./chunk-623Q77WZ.js";import{b as i}from"./chunk-CMTQFWZK.js";import{b as g}from"./chunk-JLRB7DV3.js";import"./chunk-2UV6ZFHK.js";import"./chunk-C2BLJ3AE.js";import"./chunk-BFLKIASG.js";import{b as m}from"./chunk-WAJVRK5B.js";import"./chunk-HW2VJKFH.js";import"./chunk-YERKK5B3.js";import{b as F}from"./chunk-NDS7PYKD.js";import"./chunk-O3PNT72D.js";import"./chunk-7JZKVC3F.js";import{b as z}from"./chunk-HFVQCXYX.js";import{b as f}from"./chunk-6NG4ULJM.js";import"./chunk-UPUFWGHR.js";import{b as n}from"./chunk-AJ3CSZ34.js";import"./chunk-AIWBN36Z.js";import"./chunk-UBA7DOWE.js";import"./chunk-FUT3X2GJ.js";import"./chunk-CPKBPQ2C.js";import"./chunk-OHFB3M3X.js";import"./chunk-I4IRHQDW.js";import"./chunk-PBOVSFTJ.js";import"./chunk-NE4R2FVV.js";import"./chunk-MUFNRCMY.js";import"./chunk-DN2YCFOR.js";var Hr=[i,g,m,F,z,f,n,t,l,u,p,e,d,c,h,w,x,k,v,q,C,b,y,I,M,j,A,$,S,T,B,D,E,G,H,J,K,L,O,P,Q,R,U,V,W,X,Y,Z,_,N,rr,or,ar,sr,ir,gr,mr,Fr,zr,fr,nr,tr,lr,ur,pr,er,dr,cr,hr,wr,xr,kr,vr,qr,Cr,br,yr,Ir,Mr,jr,Ar,$r,Sr,Tr,Br];function Dr(){return Hr}var Er=new Map;for(let r of Dr())Er.set(r.name,new Set(r.flags.map(o=>o.flag)));function ta(r,o,Gr){let a=Er.get(o);if(!(!a||a.size===0))for(let s of Gr)a.has(s)&&r.hit(`cmd:flag:${o}:${s}`)}export{ta as emitFlagCoverage};
|
package/dist/bin/shell/shell.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire} from"node:module";const require=createRequire(import.meta.url);
|
|
3
|
-
import{a as Tn,b as Fn,c as Kt}from"./chunks/chunk-PEJXCXSY.js";import{b as Pt,c as Ia,d as Oa,e as _a}from"./chunks/chunk-AQKIHX3Q.js";import{a as Br,b as sr}from"./chunks/chunk-OGOISDGZ.js";import{a as $a,b as ka,d as nr,e as rr}from"./chunks/chunk-IXTPVJ6W.js";import{c as li,e as Ra,f as Da}from"./chunks/chunk-ENEHPI32.js";import{a as Qt}from"./chunks/chunk-K27FY3ES.js";import{a as Zt,b as je,c as ai}from"./chunks/chunk-MROECM42.js";import{a as or,b as Na}from"./chunks/chunk-DTNGYQCJ.js";import{a as me}from"./chunks/chunk-623Q77WZ.js";import{a as Wr,b as Vr}from"./chunks/chunk-C2BLJ3AE.js";import{a as Tr,b as Fe}from"./chunks/chunk-BFLKIASG.js";import"./chunks/chunk-YERKK5B3.js";import{d as Ht,e as On}from"./chunks/chunk-O3PNT72D.js";import"./chunks/chunk-7JZKVC3F.js";import{a as Ca}from"./chunks/chunk-UPUFWGHR.js";import{a as ir,b as yt,c as Gt,d as zr,e as z,f as Bt,g as K,h as gt,i as _n,j as Pa,k as at,l as Ln}from"./chunks/chunk-UBA7DOWE.js";import{a as Ut,b as Qe,c as Ke,d as Le,e as Ue,f as qe,g as q,h as ae,i as Xe,j as qt,k as Fr,l as P,m as Ye,n as Ce,o as jt,p as Mr,q as st}from"./chunks/chunk-FUT3X2GJ.js";import{a as M,c as En,e as In,f as zt,g as oi}from"./chunks/chunk-CPKBPQ2C.js";import{a as N,c as ot}from"./chunks/chunk-OHFB3M3X.js";import{a as it}from"./chunks/chunk-I4IRHQDW.js";import{a as kt}from"./chunks/chunk-PBOVSFTJ.js";import"./chunks/chunk-DN2YCFOR.js";import*as ud from"node:fs";import*as fd from"node:path";import*as dd from"node:readline";var Mn=[{name:"echo",load:async()=>(await import("./chunks/echo-NYDCCFWB.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-UJLF2DU2.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-YXCSED2H.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-EEX3YIOF.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-KDEZTR53.js")).mkdirCommand},{name:"mktemp",load:async()=>(await import("./chunks/mktemp-OYQYUB5H.js")).mktempCommand,handlesOwnVersion:!0},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-WGVUYGPF.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TVQAUQOG.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-HCMKNRM2.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XJWV46T5.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-35V6IA5V.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-XVC53673.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-V5F4BXZ2.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-YKLNXWZI.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-BF435HNQ.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-ABLEKDMV.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-PAHZX3MA.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-3KLVOCI2.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-VNNI7JDZ.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-B2DVJQVY.js")).rgCommand,handlesOwnVersion:!0},{name:"sed",load:async()=>(await import("./chunks/sed-66XZQ75T.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-LCV2AUIX.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-HBOCBBJQ.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-JMHDIJXT.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-URDMZCXL.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-LNJEMWBJ.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-QJG6BYAP.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-ETPC3LHV.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-CZTQCNOZ.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-4IZRRT7U.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-YEY7X54W.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-IQRKKT7D.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-JPOQORZF.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-CNUK76JL.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-OK6JHDWZ.js")).split},{name:"column",load:async()=>(await import("./chunks/column-AL4LR5PO.js")).column},{name:"join",load:async()=>(await import("./chunks/join-34DX7YK5.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-L4HKV5PD.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-
|
|
4
|
-
`)),La.set(e.name,r)),n.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:s}=await sr(import("./chunks/flag-coverage-
|
|
3
|
+
import{a as Tn,b as Fn,c as Kt}from"./chunks/chunk-PEJXCXSY.js";import{b as Pt,c as Ia,d as Oa,e as _a}from"./chunks/chunk-AQKIHX3Q.js";import{a as Br,b as sr}from"./chunks/chunk-OGOISDGZ.js";import{a as $a,b as ka,d as nr,e as rr}from"./chunks/chunk-IXTPVJ6W.js";import{c as li,e as Ra,f as Da}from"./chunks/chunk-ENEHPI32.js";import{a as Qt}from"./chunks/chunk-K27FY3ES.js";import{a as Zt,b as je,c as ai}from"./chunks/chunk-MROECM42.js";import{a as or,b as Na}from"./chunks/chunk-DTNGYQCJ.js";import{a as me}from"./chunks/chunk-623Q77WZ.js";import{a as Wr,b as Vr}from"./chunks/chunk-C2BLJ3AE.js";import{a as Tr,b as Fe}from"./chunks/chunk-BFLKIASG.js";import"./chunks/chunk-YERKK5B3.js";import{d as Ht,e as On}from"./chunks/chunk-O3PNT72D.js";import"./chunks/chunk-7JZKVC3F.js";import{a as Ca}from"./chunks/chunk-UPUFWGHR.js";import{a as ir,b as yt,c as Gt,d as zr,e as z,f as Bt,g as K,h as gt,i as _n,j as Pa,k as at,l as Ln}from"./chunks/chunk-UBA7DOWE.js";import{a as Ut,b as Qe,c as Ke,d as Le,e as Ue,f as qe,g as q,h as ae,i as Xe,j as qt,k as Fr,l as P,m as Ye,n as Ce,o as jt,p as Mr,q as st}from"./chunks/chunk-FUT3X2GJ.js";import{a as M,c as En,e as In,f as zt,g as oi}from"./chunks/chunk-CPKBPQ2C.js";import{a as N,c as ot}from"./chunks/chunk-OHFB3M3X.js";import{a as it}from"./chunks/chunk-I4IRHQDW.js";import{a as kt}from"./chunks/chunk-PBOVSFTJ.js";import"./chunks/chunk-DN2YCFOR.js";import*as ud from"node:fs";import*as fd from"node:path";import*as dd from"node:readline";var Mn=[{name:"echo",load:async()=>(await import("./chunks/echo-NYDCCFWB.js")).echoCommand},{name:"cat",load:async()=>(await import("./chunks/cat-UJLF2DU2.js")).catCommand},{name:"printf",load:async()=>(await import("./chunks/printf-YXCSED2H.js")).printfCommand},{name:"ls",load:async()=>(await import("./chunks/ls-EEX3YIOF.js")).lsCommand},{name:"mkdir",load:async()=>(await import("./chunks/mkdir-KDEZTR53.js")).mkdirCommand},{name:"mktemp",load:async()=>(await import("./chunks/mktemp-OYQYUB5H.js")).mktempCommand,handlesOwnVersion:!0},{name:"rmdir",load:async()=>(await import("./chunks/rmdir-WGVUYGPF.js")).rmdirCommand},{name:"touch",load:async()=>(await import("./chunks/touch-TVQAUQOG.js")).touchCommand},{name:"rm",load:async()=>(await import("./chunks/rm-HCMKNRM2.js")).rmCommand},{name:"cp",load:async()=>(await import("./chunks/cp-XJWV46T5.js")).cpCommand},{name:"mv",load:async()=>(await import("./chunks/mv-35V6IA5V.js")).mvCommand},{name:"ln",load:async()=>(await import("./chunks/ln-XVC53673.js")).lnCommand},{name:"chmod",load:async()=>(await import("./chunks/chmod-V5F4BXZ2.js")).chmodCommand},{name:"pwd",load:async()=>(await import("./chunks/pwd-YKLNXWZI.js")).pwdCommand},{name:"readlink",load:async()=>(await import("./chunks/readlink-BF435HNQ.js")).readlinkCommand},{name:"head",load:async()=>(await import("./chunks/head-ABLEKDMV.js")).headCommand},{name:"tail",load:async()=>(await import("./chunks/tail-PAHZX3MA.js")).tailCommand},{name:"wc",load:async()=>(await import("./chunks/wc-3KLVOCI2.js")).wcCommand},{name:"stat",load:async()=>(await import("./chunks/stat-VNNI7JDZ.js")).statCommand},{name:"grep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).grepCommand},{name:"fgrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).fgrepCommand},{name:"egrep",load:async()=>(await import("./chunks/grep-AZJ2CMYE.js")).egrepCommand},{name:"rg",load:async()=>(await import("./chunks/rg-B2DVJQVY.js")).rgCommand,handlesOwnVersion:!0},{name:"sed",load:async()=>(await import("./chunks/sed-66XZQ75T.js")).sedCommand},{name:"awk",load:async()=>(await import("./chunks/awk2-LCV2AUIX.js")).awkCommand2},{name:"sort",load:async()=>(await import("./chunks/sort-HBOCBBJQ.js")).sortCommand},{name:"uniq",load:async()=>(await import("./chunks/uniq-JMHDIJXT.js")).uniqCommand},{name:"comm",load:async()=>(await import("./chunks/comm-URDMZCXL.js")).commCommand},{name:"cut",load:async()=>(await import("./chunks/cut-LNJEMWBJ.js")).cutCommand},{name:"paste",load:async()=>(await import("./chunks/paste-QJG6BYAP.js")).pasteCommand},{name:"tr",load:async()=>(await import("./chunks/tr-ETPC3LHV.js")).trCommand},{name:"rev",load:async()=>(await import("./chunks/rev-CZTQCNOZ.js")).rev},{name:"nl",load:async()=>(await import("./chunks/nl-4IZRRT7U.js")).nl},{name:"fold",load:async()=>(await import("./chunks/fold-YEY7X54W.js")).fold},{name:"expand",load:async()=>(await import("./chunks/expand-IQRKKT7D.js")).expand},{name:"unexpand",load:async()=>(await import("./chunks/unexpand-JPOQORZF.js")).unexpand},{name:"strings",load:async()=>(await import("./chunks/strings-CNUK76JL.js")).strings},{name:"split",load:async()=>(await import("./chunks/split-OK6JHDWZ.js")).split},{name:"column",load:async()=>(await import("./chunks/column-AL4LR5PO.js")).column},{name:"join",load:async()=>(await import("./chunks/join-34DX7YK5.js")).join},{name:"tee",load:async()=>(await import("./chunks/tee-L4HKV5PD.js")).teeCommand},{name:"find",load:async()=>(await import("./chunks/find-QM4ZVJ2E.js")).findCommand},{name:"basename",load:async()=>(await import("./chunks/basename-C4CRGDXP.js")).basenameCommand},{name:"dirname",load:async()=>(await import("./chunks/dirname-TPUFCYF6.js")).dirnameCommand},{name:"tree",load:async()=>(await import("./chunks/tree-ZGP6NPGS.js")).treeCommand},{name:"du",load:async()=>(await import("./chunks/du-YNAJTGCR.js")).duCommand},{name:"env",load:async()=>(await import("./chunks/env-2TSVF4W7.js")).envCommand},{name:"printenv",load:async()=>(await import("./chunks/env-2TSVF4W7.js")).printenvCommand},{name:"alias",load:async()=>(await import("./chunks/alias-3R4G6HQY.js")).aliasCommand},{name:"unalias",load:async()=>(await import("./chunks/alias-3R4G6HQY.js")).unaliasCommand},{name:"history",load:async()=>(await import("./chunks/history-3HAU45KT.js")).historyCommand},{name:"xargs",load:async()=>(await import("./chunks/xargs-4AMMXFXL.js")).xargsCommand},{name:"true",load:async()=>(await import("./chunks/true-KFTJGQLQ.js")).trueCommand},{name:"false",load:async()=>(await import("./chunks/true-KFTJGQLQ.js")).falseCommand},{name:"yes",load:async()=>(await import("./chunks/yes-2EQTNSIB.js")).yesCommand},{name:"clear",load:async()=>(await import("./chunks/clear-OE52K3TM.js")).clearCommand},{name:"bash",load:async()=>(await import("./chunks/bash-CFCBBWVH.js")).bashCommand},{name:"sh",load:async()=>(await import("./chunks/bash-CFCBBWVH.js")).shCommand},{name:"jq",load:async()=>(await import("./chunks/jq-5SOTL7D7.js")).jqCommand},{name:"base64",load:async()=>(await import("./chunks/base64-OLYCF2PC.js")).base64Command},{name:"diff",load:async()=>(await import("./chunks/diff-YLVT27CZ.js")).diffCommand,handlesOwnVersion:!0},{name:"date",load:async()=>(await import("./chunks/date-6MQGVWDY.js")).dateCommand},{name:"sleep",load:async()=>(await import("./chunks/sleep-4O22Z4DI.js")).sleepCommand},{name:"timeout",load:async()=>(await import("./chunks/timeout-XMTXHNFF.js")).timeoutCommand},{name:"time",load:async()=>(await import("./chunks/time-J2DAZUIN.js")).timeCommand},{name:"seq",load:async()=>(await import("./chunks/seq-KBVCQ4WT.js")).seqCommand},{name:"expr",load:async()=>(await import("./chunks/expr-GLGO2VEZ.js")).exprCommand},{name:"md5sum",load:async()=>(await import("./chunks/md5sum-Z6KAYGDK.js")).md5sumCommand},{name:"sha1sum",load:async()=>(await import("./chunks/sha1sum-CATBXX76.js")).sha1sumCommand},{name:"sha256sum",load:async()=>(await import("./chunks/sha256sum-YGSNBVY3.js")).sha256sumCommand},{name:"file",load:async()=>(await import("./chunks/file-7M5LLZJY.js")).fileCommand},{name:"html-to-markdown",load:async()=>(await import("./chunks/html-to-markdown-FDNPIEKZ.js")).htmlToMarkdownCommand},{name:"help",load:async()=>(await import("./chunks/help-EXVKU23F.js")).helpCommand},{name:"which",load:async()=>(await import("./chunks/which-G7X54RZL.js")).whichCommand},{name:"tac",load:async()=>(await import("./chunks/tac-DG4BMYM5.js")).tac},{name:"hostname",load:async()=>(await import("./chunks/hostname-2I76DUQL.js")).hostname},{name:"whoami",load:async()=>(await import("./chunks/whoami-B5HDVKW6.js")).whoami},{name:"od",load:async()=>(await import("./chunks/od-TD5LZDUM.js")).od},{name:"gzip",load:async()=>(await import("./chunks/gzip-W5CL2E2W.js")).gzipCommand},{name:"gunzip",load:async()=>(await import("./chunks/gzip-W5CL2E2W.js")).gunzipCommand},{name:"zcat",load:async()=>(await import("./chunks/gzip-W5CL2E2W.js")).zcatCommand}];(typeof __BROWSER__>"u"||!__BROWSER__)&&(Mn.push({name:"tar",load:async()=>(await import("./chunks/tar-RPVTXGFJ.js")).tarCommand}),Mn.push({name:"yq",load:async()=>(await import("./chunks/yq-T6S3IDKY.js")).yqCommand}),Mn.push({name:"xan",load:async()=>(await import("./chunks/xan-XZHKEPJ4.js")).xanCommand}),Mn.push({name:"sqlite3",load:async()=>(await import("./chunks/sqlite3-57ACN7ES.js")).sqlite3Command}));var ci=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ci.push({name:"python3",load:async()=>(await import("./chunks/python3-P6MZ44HK.js")).python3Command,handlesOwnVersion:!0}),ci.push({name:"python",load:async()=>(await import("./chunks/python3-P6MZ44HK.js")).pythonCommand,handlesOwnVersion:!0}));var ui=[];(typeof __BROWSER__>"u"||!__BROWSER__)&&(ui.push({name:"js-exec",load:async()=>(await import("./chunks/js-exec-LISDW7YC.js")).jsExecCommand,handlesOwnVersion:!0}),ui.push({name:"node",load:async()=>(await import("./chunks/js-exec-LISDW7YC.js")).nodeStubCommand}));var hd=[{name:"curl",load:async()=>(await import("./chunks/curl-HZ5SBTVY.js")).curlCommand}],La=new Map;function Ur(e){return{name:e.name,handlesOwnVersion:e.handlesOwnVersion,async execute(t,n){let r=La.get(e.name);if(r||(r=await Fe.runTrustedAsync(()=>sr(e.load(),n.signal,`bash: ${e.name} was cancelled before it started
|
|
4
|
+
`)),La.set(e.name,r)),n.coverage&&(typeof __BROWSER__>"u"||!__BROWSER__)){let{emitFlagCoverage:s}=await sr(import("./chunks/flag-coverage-ERCJF44K.js"),n.signal,`bash: ${e.name} was cancelled before it started
|
|
5
5
|
`);s(n.coverage,e.name,t)}return r.execute(t,n)}}}function Ta(e){return(e?Mn.filter(n=>e.includes(n.name)):Mn).map(Ur)}function Fa(){return hd.map(Ur)}function Ma(){return ci.map(Ur)}function Ba(){return ui.map(Ur)}var Wa=new WeakMap,Va=new WeakSet;function fi(e){let t=Wa.get(e);return t===void 0&&(t=Object.freeze(Object.create(null)),Wa.set(e,t),Va.add(t)),t}function za(e){return Va.has(e)}var Ua={maxSourceBytes:67108864,maxExecDepth:64,maxCallDepth:100,maxCommandCount:1e5,maxLoopIterations:1e5,maxAwkIterations:1e5,maxSedIterations:1e5,maxJqIterations:1e7,maxQueryTokens:1e5,maxQueryDepth:1e3,maxQueryElements:1e6,maxAwkParserTokens:1e5,maxAwkParserDepth:256,maxAwkParserOperations:1e6,maxCsvRows:1e6,maxCsvCells:1e7,maxWorkUnits:1e8,maxTraversalEntries:1e6,maxTraversalDepth:1e3,maxTraversalWork:1e6,maxLiveBytes:536870912,maxInputBytes:536870912,maxFileSystemBytes:1073741824,maxDatabaseBytes:1073741824,maxDatabaseResultBytes:268435456,maxArchiveBytes:1073741824,maxArchiveCompressedBytes:536870912,maxArchiveEntryBytes:536870912,maxArchiveEntries:1e6,maxWorkerMessageBytes:67108864,maxExecutionTimeMs:36e5,maxExtensionCleanupTimeMs:100,maxSqliteTimeoutMs:3e4,maxPythonTimeoutMs:3e4,maxJsTimeoutMs:3e4,maxJsMemoryBytes:67108864,maxGlobOperations:1e6,maxStringLength:67108864,maxArrayElements:1e6,maxHeredocSize:67108864,maxSubstitutionDepth:50,maxBraceExpansionResults:1e5,maxOutputSize:268435456,maxFileDescriptors:4096,maxSourceDepth:100},md={...Ua,maxSourceBytes:8*1024*1024,maxCommandCount:1e4,maxLoopIterations:1e4,maxAwkIterations:1e4,maxSedIterations:1e4,maxJqIterations:1e4,maxSqliteTimeoutMs:5e3,maxPythonTimeoutMs:1e4,maxJsTimeoutMs:1e4,maxExtensionCleanupTimeMs:25,maxGlobOperations:1e5,maxStringLength:10*1024*1024,maxArrayElements:1e5,maxHeredocSize:10*1024*1024,maxBraceExpansionResults:1e4,maxOutputSize:10*1024*1024,maxFileDescriptors:1024,maxQueryTokens:25e3,maxQueryDepth:256,maxQueryElements:1e5,maxAwkParserTokens:25e3,maxAwkParserDepth:128,maxAwkParserOperations:1e5,maxCsvRows:1e5,maxCsvCells:1e6,maxWorkUnits:1e5,maxTraversalEntries:1e5,maxTraversalDepth:256,maxTraversalWork:1e5,maxLiveBytes:64*1024*1024,maxInputBytes:32*1024*1024,maxFileSystemBytes:128*1024*1024,maxDatabaseBytes:64*1024*1024,maxDatabaseResultBytes:16*1024*1024,maxArchiveBytes:128*1024*1024,maxArchiveCompressedBytes:64*1024*1024,maxArchiveEntryBytes:64*1024*1024,maxArchiveEntries:1e5,maxWorkerMessageBytes:16*1024*1024,maxExecutionTimeMs:3e4};function yd(e){return Number.isFinite(e)?Math.min(Math.max(0,Math.floor(e)),4294967295):4294967295}function di(e,t="normal"){if(t!=="normal"&&t!=="hardened")throw new RangeError('executionLimitProfile must be "normal" or "hardened"');let n=t==="hardened"?md:Ua;if(!e)return{...n};let r={maxSourceBytes:e.maxSourceBytes??n.maxSourceBytes,maxExecDepth:e.maxExecDepth??n.maxExecDepth,maxCallDepth:e.maxCallDepth??n.maxCallDepth,maxCommandCount:e.maxCommandCount??n.maxCommandCount,maxLoopIterations:e.maxLoopIterations??n.maxLoopIterations,maxAwkIterations:e.maxAwkIterations??n.maxAwkIterations,maxSedIterations:e.maxSedIterations??n.maxSedIterations,maxJqIterations:e.maxJqIterations??n.maxJqIterations,maxQueryTokens:e.maxQueryTokens??n.maxQueryTokens,maxQueryDepth:e.maxQueryDepth??n.maxQueryDepth,maxQueryElements:e.maxQueryElements??n.maxQueryElements,maxAwkParserTokens:e.maxAwkParserTokens??n.maxAwkParserTokens,maxAwkParserDepth:e.maxAwkParserDepth??n.maxAwkParserDepth,maxAwkParserOperations:e.maxAwkParserOperations??n.maxAwkParserOperations,maxCsvRows:e.maxCsvRows??n.maxCsvRows,maxCsvCells:e.maxCsvCells??n.maxCsvCells,maxWorkUnits:e.maxWorkUnits??n.maxWorkUnits,maxTraversalEntries:e.maxTraversalEntries??n.maxTraversalEntries,maxTraversalDepth:e.maxTraversalDepth??n.maxTraversalDepth,maxTraversalWork:e.maxTraversalWork??n.maxTraversalWork,maxLiveBytes:e.maxLiveBytes??n.maxLiveBytes,maxInputBytes:e.maxInputBytes??n.maxInputBytes,maxFileSystemBytes:e.maxFileSystemBytes??n.maxFileSystemBytes,maxDatabaseBytes:e.maxDatabaseBytes??n.maxDatabaseBytes,maxDatabaseResultBytes:e.maxDatabaseResultBytes??n.maxDatabaseResultBytes,maxArchiveBytes:e.maxArchiveBytes??n.maxArchiveBytes,maxArchiveCompressedBytes:e.maxArchiveCompressedBytes??n.maxArchiveCompressedBytes,maxArchiveEntryBytes:e.maxArchiveEntryBytes??n.maxArchiveEntryBytes,maxArchiveEntries:e.maxArchiveEntries??n.maxArchiveEntries,maxWorkerMessageBytes:e.maxWorkerMessageBytes??n.maxWorkerMessageBytes,maxExecutionTimeMs:e.maxExecutionTimeMs??n.maxExecutionTimeMs,maxExtensionCleanupTimeMs:e.maxExtensionCleanupTimeMs??n.maxExtensionCleanupTimeMs,maxSqliteTimeoutMs:e.maxSqliteTimeoutMs??n.maxSqliteTimeoutMs,maxPythonTimeoutMs:e.maxPythonTimeoutMs??n.maxPythonTimeoutMs,maxJsTimeoutMs:e.maxJsTimeoutMs??n.maxJsTimeoutMs,maxJsMemoryBytes:yd(e.maxJsMemoryBytes??n.maxJsMemoryBytes),maxGlobOperations:e.maxGlobOperations??n.maxGlobOperations,maxStringLength:e.maxStringLength??n.maxStringLength,maxArrayElements:e.maxArrayElements??n.maxArrayElements,maxHeredocSize:e.maxHeredocSize??n.maxHeredocSize,maxSubstitutionDepth:e.maxSubstitutionDepth??n.maxSubstitutionDepth,maxBraceExpansionResults:e.maxBraceExpansionResults??n.maxBraceExpansionResults,maxOutputSize:e.maxOutputSize??n.maxOutputSize,maxFileDescriptors:e.maxFileDescriptors??n.maxFileDescriptors,maxSourceDepth:e.maxSourceDepth??n.maxSourceDepth};for(let s of Object.keys(r)){let i=r[s];if(i!==Number.POSITIVE_INFINITY&&(!Number.isSafeInteger(i)||i<0))throw new RangeError(`${s} must be a non-negative safe integer or positive Infinity`)}return r}function qa(e){return"load"in e&&typeof e.load=="function"}function ja(e){let t=null,n=!1,r=new Set,s=a=>{t=a;for(let l of r)l.resolve(a);r.clear()},i=a=>{n=!1;for(let l of r)l.reject(a);r.clear()},o=()=>{n=!0;let a;try{a=Promise.resolve(e.load())}catch(l){i(l);return}Da.call(a,s,i)};return{name:e.name,trusted:e.trusted!==!1,handlesOwnVersion:e.handlesOwnVersion,async execute(a,l){if(!t){let u,f=new Promise((d,p)=>{u={resolve:d,reject:p},r.add(u)});n||o();try{t=await sr(f,l.signal,`bash: ${e.name} was cancelled before it started
|
|
6
6
|
`)}finally{u&&r.delete(u)}}let c=t;if(!c)throw new Error(`Failed to load command: ${e.name}`);return c.execute(a,l)}}}var Ha=Object.freeze(Object.create(null)),qr=class{limits;signal;abortOnUnresolvedCommands;commandCount=0;workUnits=0;liveBytes=0;inputBytes=0;outputBytes=0;countersByKind=new Map;bytesByKind=new Map;depthByKind=new Map;cleanupCallbacks=[];poisoned;closed=!1;startedAt=Date.now();unresolvedCommands=new Set;get remainingLiveBytes(){return Math.max(0,this.limits.maxLiveBytes-this.liveBytes)}get outputBytesUsed(){return this.outputBytes}constructor(t,n=void 0,r=!1){this.limits=t,this.signal=n,this.abortOnUnresolvedCommands=r}recordUnresolvedCommand(t){this.unresolvedCommands.add(t)}get unresolvedCommandNames(){return[...this.unresolvedCommands]}fail(t){throw this.poisoned??=t,this.poisoned}poisonAfterAbort(t){this.poisoned??=t}assertUsable(){if(this.poisoned)throw this.poisoned;if(this.closed)throw new Error("execution budget is already closed");this.throwIfAborted()}chargeCommand(){return this.consume("commands",1,"execution")}consumeWork(t=1,n="execution"){return this.consume("work",t,n)}consumeLimited(t,n,r,s=t){this.assertUsable();let i=this.countersByKind.get(t)??0;return(!Number.isSafeInteger(n)||n<0||!Number.isSafeInteger(r)||r<0||n>r-i)&&this.fail(new P(`${s}: ${t} work limit exceeded (${r})`,"iterations")),n>this.limits.maxWorkUnits-this.workUnits&&this.fail(new P(`${s}: aggregate work limit exceeded (${this.limits.maxWorkUnits})`,"iterations")),this.countersByKind.set(t,i+n),this.workUnits+=n,i+n}consumeInput(t,n="execution"){return this.assertUsable(),(!Number.isSafeInteger(t)||t<0||t>this.limits.maxInputBytes-this.inputBytes)&&this.fail(new P(`${n}: aggregate input size limit exceeded (${this.limits.maxInputBytes} bytes)`,"string_length")),this.inputBytes+=t,this.inputBytes}consume(t,n=1,r=t){this.assertUsable();let s=this.countersByKind.get(t)??0,i=t==="commands"?this.commandCount:this.workUnits,o=t==="commands"?this.limits.maxCommandCount:this.limits.maxWorkUnits;(!Number.isSafeInteger(n)||n<0||n>o-i)&&this.fail(new P(t==="commands"?`too many commands executed (>${o}), increase executionLimits.maxCommandCount`:`${r}: ${t} work limit exceeded (${o})`,t==="commands"?"commands":"iterations"));let a=i+n;return t==="commands"?this.commandCount=a:this.workUnits=a,this.countersByKind.set(t,s+n),a}reserveBytes(t,n,r){this.assertUsable();let s=typeof t=="string"?t:"live",i=typeof t=="string"?n:t,o=typeof t=="string"?r??s:n??"execution";(!Number.isSafeInteger(i)||i<0||i>this.limits.maxLiveBytes-this.liveBytes)&&this.fail(new P(`${o}: live byte limit exceeded (${this.limits.maxLiveBytes} bytes)`,"string_length")),this.liveBytes+=i,this.bytesByKind.set(s,(this.bytesByKind.get(s)??0)+i);let a=!1;return{release:()=>{if(a)return;a=!0,this.liveBytes-=i;let l=(this.bytesByKind.get(s)??i)-i;l<=0?this.bytesByKind.delete(s):this.bytesByKind.set(s,l)}}}appendOutput(t,n,r="execution",s=0,i="text"){this.assertUsable();let o=i==="bytes"?n.length:M(n);(!Number.isSafeInteger(s)||s<0||s>o)&&this.fail(new P(`${r}: invalid ${t} accounting`,"output_size"));let a=o-s;return a>this.limits.maxOutputSize-this.outputBytes&&this.fail(new P(`${r}: total output size exceeded (>${this.limits.maxOutputSize} bytes), increase executionLimits.maxOutputSize`,"output_size")),this.outputBytes+=a,o}accountResult(t,n="execution",r=Number.POSITIVE_INFINITY){let s=t.internalOutputAccounting,i=Math.min(s?.stdout??0,r),o=Math.min(s?.stderr??0,Math.max(0,r-i)),a=this.appendOutput("stdout",t.stdout,n,i,t.stdoutKind==="bytes"||t.stdoutEncoding==="binary"?"bytes":"text"),l=this.appendOutput("stderr",t.stderr,n,o);return Object.isExtensible(t)?(t.internalOutputAccounting={stdout:a,stderr:l},t):a===0&&l===0?t:{...t,internalOutputAccounting:{stdout:a,stderr:l}}}relinquishOutput(t,n,r){this.assertUsable(),r!==Ha&&this.fail(new P(`${n}: unauthorized output accounting release`,"output_size")),(!Number.isSafeInteger(t)||t<0||t>this.outputBytes)&&this.fail(new P(`${n}: invalid output accounting release`,"output_size")),this.outputBytes-=t}enterDepth(t,n=this.limits.maxCallDepth,r){this.assertUsable();let s=typeof n=="number"?n:this.limits.maxCallDepth,i=typeof n=="string"?n:r??t,o=this.depthByKind.get(t)??0;o>=s&&this.fail(new P(`${i}: maximum depth (${s}) exceeded`,"recursion")),this.depthByKind.set(t,o+1);let a=!1;return{release:()=>{if(a)return;a=!0;let l=(this.depthByKind.get(t)??1)-1;l<=0?this.depthByKind.delete(t):this.depthByKind.set(t,l)}}}throwIfAborted(t="execution"){this.signal?.aborted&&this.fail(new Ye("",`bash: ${t} aborted
|
|
7
7
|
`)),Date.now()-this.startedAt>this.limits.maxExecutionTimeMs&&this.fail(new Ye("",`bash: ${t} exceeded execution deadline (${this.limits.maxExecutionTimeMs}ms)
|