dsh-edge 0.6.0-alpha.9 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/worker/direct/index.js
CHANGED
|
@@ -766,7 +766,7 @@ ${n}`:""}`}});function hD(e){if(e.url.trim().length===0)throw new Error("url mus
|
|
|
766
766
|
button, .button { display: inline-block; box-sizing: border-box; margin-top: 1rem; padding: .75rem 1rem; border: 0; border-radius: .6rem; background: #5a87ff; color: #071022; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
|
|
767
767
|
.secondary { background: #29314b; color: #edf2ff; }
|
|
768
768
|
.error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
|
|
769
|
-
`}l(fL,"pageStyles");var Khe="https://api.deepseek.com";var Yhe="deepseek-v4-flash",Xhe="high";var Jhe=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function y4(e){let t=e??Khe,r;try{r=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(r.protocol!=="http:"&&r.protocol!=="https:"||r.username.length>0||r.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(y4,"resolveEdgeBaseURL");function $f(e){if(e===void 0)return Yhe;if(!Jhe.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l($f,"resolveEdgeModel");function v4(e){if(e===void 0)return Xhe;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(v4,"resolveEdgeReasoningEffort");function w4(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(w4,"resolveEdgeStreamIdleTimeoutMs");function b4(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(b4,"resolveEdgeMaxOutputTokens");var x4={name:"dsh-edge",version:"0.6.0-alpha.9",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.2","@deepseek-ai/dsh-attachment":"0.1.1-rc.2","@deepseek-ai/dsh-brand":"0.1.1-rc.2","@deepseek-ai/dsh-compaction":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.1-rc.2","@deepseek-ai/dsh-credentials":"0.1.1-rc.2","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.2","@deepseek-ai/dsh-llm":"0.1.1-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-session":"0.1.1-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.2","@deepseek-ai/dsh-session-projection":"0.1.1-rc.2","@deepseek-ai/dsh-session-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.1-rc.2","@deepseek-ai/dsh-output-retention":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"0.1.1-rc.2","@deepseek-ai/dsh-spill":"0.1.1-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.1-rc.2","@deepseek-ai/dsh-storage":"0.1.1-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.1-rc.2","@deepseek-ai/dsh-timeout":"0.1.1-rc.2","@deepseek-ai/dsh-token-meter":"0.1.1-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.2","@deepseek-ai/dsh-tool-web":"0.1.1-rc.2","@deepseek-ai/dsh-tools":"0.1.1-rc.2","@deepseek-ai/dsh-web":"0.1.1-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-workspace":"0.1.1-rc.2","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var v1=x4.version,pL=x4.dshEdge.upstreamVersion;function eme(){return"dsh-edge@0.6.0-alpha.9/direct"}l(eme,"resolveEdgeDeploymentId");function w1(e){return{baseURL:y4(e.DEEPSEEK_BASE_URL),maxTokens:b4(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:$f(e.DEEPSEEK_MODEL),reasoningEffort:v4(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:t1(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:w4(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:kf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(w1,"resolveEdgeDeploymentConfig");function tme(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(tme,"edgeDeploymentApiKeyConfigured");function rme(e){let t=y4(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(rme,"projectedEdgeBaseURL");function E4(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:eme(),apiKeyConfigured:tme(e),baseURL:rme(e.DEEPSEEK_BASE_URL),maxTokens:b4(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:$f(e.DEEPSEEK_MODEL),reasoningEffort:v4(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:t1(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:w4(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:kf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(E4,"resolveEdgeDeploymentProfile");function hL(e){w1(e);let t=E4(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:v1,upstreamVersion:pL,status:"ready"}}l(hL,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as XBe}from"cloudflare:workers";var Ol=zy(mL(),1);var S4=l((e,t,r)=>{let n=e instanceof RegExp?gL(e,r):e,i=t instanceof RegExp?gL(t,r):t,s=n!==null&&i!=null&&nme(n,i,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+i.length)}},"balanced"),gL=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),nme=l((e,t,r)=>{let n,i,s,o,a,c=r.indexOf(e),u=r.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(n=[],s=r.length;d>=0&&!a;){if(d===c)n.push(d),c=r.indexOf(e,d+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=r.indexOf(t,d+1);d=c<u&&c>=0?c:u}n.length&&o!==void 0&&(a=[s,o])}return a},"range");var yL="\0SLASH"+Math.random()+"\0",vL="\0OPEN"+Math.random()+"\0",I4="\0CLOSE"+Math.random()+"\0",wL="\0COMMA"+Math.random()+"\0",bL="\0PERIOD"+Math.random()+"\0",ime=new RegExp(yL,"g"),sme=new RegExp(vL,"g"),ome=new RegExp(I4,"g"),ame=new RegExp(wL,"g"),lme=new RegExp(bL,"g"),cme=/\\\\/g,ume=/\\{/g,dme=/\\}/g,fme=/\\,/g,pme=/\\\./g,hme=1e5,mme=4e6;function k4(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(k4,"numeric");function gme(e){return e.replace(cme,yL).replace(ume,vL).replace(dme,I4).replace(fme,wL).replace(pme,bL)}l(gme,"escapeBraces");function yme(e){return e.replace(ime,"\\").replace(sme,"{").replace(ome,"}").replace(ame,",").replace(lme,".")}l(yme,"unescapeBraces");function xL(e){if(!e)return[""];let t=[],r=S4("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=xL(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(xL,"parseCommaParts");function EL(e,t={}){if(!e)return[];let{max:r=hme,maxLength:n=mme}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),A4(gme(e),r,n,!0).map(yme)}l(EL,"expand");function vme(e){return"{"+e+"}"}l(vme,"embrace");function wme(e){return/^-?0\d/.test(e)}l(wme,"isPadded");function bme(e,t){return e<=t}l(bme,"lte");function xme(e,t){return e>=t}l(xme,"gte");function Tf(e,t,r,n,i,s){let o=[],a=0;for(let c=0;c<e.length;c++)for(let u=0;u<r.length;u++){if(o.length>=n)return o;let d=e[c]+t+r[u];if(!(s&&!d)){if(a+d.length>i)return o;o.push(d),a+=d.length}}return o}l(Tf,"combine");function Eme(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=k4(i[0]),a=k4(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(k4(i[2])),1):1,d=bme;a<o&&(u*=-1,d=xme);let p=i.some(wme),h=0;for(let m=o;d(m,a)&&s.length<r;m+=u){let g;if(t)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),p){let y=c-g.length;if(y>0){let b=new Array(y+1).join("0");m<0?g="-"+b+g.slice(1):g=b+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(Eme,"expandSequence");function A4(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=S4("{","}",e);if(!a)return Tf(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=Tf(i,c+"{"+a.body+"}",[""],t,r,s&&!a.post.length),o=!1,!a.post.length)break;e=a.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),f=u||d,p=a.body.indexOf(",")>=0;if(!f&&!p){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+I4+a.post,n=!0;continue}return Tf(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!f,o=!1);let h;if(f)h=Eme(a.body,d,t,r);else{let m=xL(a.body);if(m.length===1&&m[0]!==void 0&&(m=A4(m[0],t,r,!1).map(vme),m.length===1)){if(i=Tf(i,c+m[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let g=s&&!a.post.length&&!c;for(let b=0;g&&b<i.length;b++)i[b]&&(g=!1);h=[];let y=0;e:for(let b=0;b<m.length;b++){let w=A4(m[b],t,r,!1);for(let x=0;x<w.length;x++){let k=w[x];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=Tf(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(A4,"expand_");var Cf=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Sme={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Of=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),kme=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),SL=l(e=>e.join(""),"rangesToString"),kL=l((e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,u=!1,d=r,f="";e:for(;s<e.length;){let g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){u=!0,s++;continue}if(g==="]"&&o&&!c){d=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(let[y,[b,w,x]]of Object.entries(Sme))if(e.startsWith(y,s)){if(f)return["$.",!1,e.length-r,!0];s+=y.length,x?i.push(b):n.push(b),a=a||w;continue e}}if(c=!1,f){g>f?n.push(Of(f)+"-"+Of(g)):g===f&&n.push(Of(g)),f="",s++;continue}if(e.startsWith("-]",s+1)){n.push(Of(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=g,s+=2;continue}n.push(Of(g)),s++}if(d<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let g=n[0].length===2?n[0].slice(-1):n[0];return[kme(g),!1,d-r,!1]}let p="["+(u?"^":"")+SL(n)+"]",h="["+(u?"":"^")+SL(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,a,d-r,!0]},"parseClass");var Jo=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var Gn,Ame=new Set(["!","?","+","*","@"]),_4=l(e=>Ame.has(e),"isExtglobType"),AL=l(e=>_4(e.type),"isExtglobAST"),Ime=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),_me=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),$me=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),IL=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Tme="(?!(?:^|/)\\.\\.?(?:$|/))",x1="(?!\\.)",Cme=new Set(["[","."]),Ome=new Set(["..","."]),Rme=new Set("().*{}+?[]^$\\!"),Nme=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),$4="[^/]",_L=$4+"*?",$L=$4+"+?",Pme=0,el=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++Pme;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#u&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Gn&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Gn&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new Gn(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#h(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let g=n,y="";for(;g<t.length;){let b=t.charAt(g++);if(a||b==="\\"){a=!a,y+=b;continue}if(c){g===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(g===u+2&&d)&&(c=!1),y+=b;continue}else if(b==="["){c=!0,u=g,d=!1,y+=b;continue}if(!i.noext&&_4(b)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let x=new Gn(b,r);g=Gn.#h(t,x,g,i,s+1),r.push(x);continue}y+=b}return r.push(y),g}let f=n+1,p=new Gn(null,r),h=[],m="";for(;f<t.length;){let g=t.charAt(f++);if(a||g==="\\"){a=!a,m+=g;continue}if(c){f===u+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(f===u+2&&d)&&(c=!1),m+=g;continue}else if(g==="["){c=!0,u=f,d=!1,m+=g;continue}if(!i.noext&&_4(g)&&t.charAt(f)==="("&&(s<=o||r&&r.#g(g))){let b=r&&r.#g(g)?0:1;p.push(m),m="";let w=new Gn(g,p);p.push(w),f=Gn.#h(t,w,f,i,s+b);continue}if(g==="|"){p.push(m),m="",h.push(p),p=new Gn(null,r);continue}if(g===")")return m===""&&r.#t.length===0&&(r.#c=!0),p.push(m),m="",r.push(...h,p),f;m+=g}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],f}#C(t){return this.#m(t,_me)}#m(t,r=Ime){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#g(n.type,r)}#g(t,r=$me){return!!r.get(this.type)?.includes(t)}#f(t,r){let n=t.#t[0],i=new Gn(null,n,this.options);i.#t.push(""),n.push(i),this.#E(t,r)}#E(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#S(t){return!!IL.get(this.type)?.has(t)}#O(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#S(r.type)}#y(t){let r=IL.get(this.type),n=t.#t[0],i=r?.get(n.type);if(!i)return!1;this.#t=n.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#o=void 0,this.#c=!1}static fromGlob(t,r={}){let n=new Gn(null,void 0,r);return Gn.#h(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!AL(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,b]=typeof h=="string"?Gn.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||b,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Ome.has(this.#t[0]))){let m=Cme,g=r&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),y=!r&&!t&&m.has(u.charAt(0));d=g?Tme:y?x1:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Jo(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#r=void 0,[c,Jo(this.toString()),!1,!1]}let o=!n||t||r||!x1?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?x1:"")+$L;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?x1:"")+_L+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Jo(s),this.#r=!!this.#r,this.#n]}#p(){if(AL(this)){let t=0,r=!1;do{r=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#p(),this.#m(i)?(r=!1,this.#E(i,n)):this.#C(i)?(r=!1,this.#f(i,n)):this.#O(i)&&(r=!1,this.#y(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#v(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(t,r,n=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(Rme.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?$L:_L,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,f,p,h]=kL(t,c);if(p){s+=d,o=o||f,c+=p-1,r=r||h;continue}}if(u==="?"){s+=$4,r=!0;continue}s+=Nme(u)}return[s,Jo(t),!!r,o]}};Gn=el;var T4=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Qr=l((e,t,r={})=>(Cf(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Wc(t,r).match(e)),"minimatch"),Dme=/^\*+([^+@!?*[(]*)$/,Lme=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),Mme=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),Fme=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Ume=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),jme=/^\*+\.\*+$/,zme=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Bme=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Wme=/^\.\*+$/,qme=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Hme=/^\*+$/,Gme=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Vme=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Zme=/^\?+([^+@!?*[(]*)?$/,Kme=l(([e,t=""])=>{let r=OL([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Yme=l(([e,t=""])=>{let r=RL([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),Xme=l(([e,t=""])=>{let r=RL([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),Jme=l(([e,t=""])=>{let r=OL([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),OL=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),RL=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),NL=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",TL={win32:{sep:"\\"},posix:{sep:"/"}},Qme=NL==="win32"?TL.win32.sep:TL.posix.sep;Qr.sep=Qme;var bn=Symbol("globstar **");Qr.GLOBSTAR=bn;var ege="[^/]",tge=ege+"*?",rge="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",nge="(?:(?!(?:\\/|^)\\.).)*?",ige=l((e,t={})=>r=>Qr(r,e,t),"filter");Qr.filter=ige;var xi=l((e,t={})=>Object.assign({},e,t),"ext"),sge=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Qr;let t=Qr;return Object.assign(l((n,i,s={})=>t(n,i,xi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,xi(e,s))}static defaults(i){return t.defaults(xi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,xi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,xi(e,s))}},unescape:l((n,i={})=>t.unescape(n,xi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,xi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,xi(e,i)),"filter"),defaults:l(n=>t.defaults(xi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,xi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,xi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,xi(e,s)),"match"),sep:t.sep,GLOBSTAR:bn})},"defaults");Qr.defaults=sge;var PL=l((e,t={})=>(Cf(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:EL(e,{max:t.braceExpandMax})),"braceExpand");Qr.braceExpand=PL;var oge=l((e,t={})=>new Wc(e,t).makeRe(),"makeRe");Qr.makeRe=oge;var age=l((e,t,r={})=>{let n=new Wc(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Qr.match=age;var CL=/[?*]|[+@!]\(.*?\)|\[|\]/,lge=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Wc=class{static{l(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,r={}){Cf(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||NL,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!CL.test(s[2]))&&!CL.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n of t)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],u=n[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let d=n.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,s=0,o=[],a="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(a==="b"?r[s]:t[i]),i++,s++;else if(n&&t[i]==="**"&&r[s]===t[i+1])o.push(t[i]),i++;else if(n&&r[s]==="**"&&t[i]===r[s+1])o.push(r[s]),s++;else if(t[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=0,s=0;if(this.isWindows){let a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),f=c?3:a?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,m]=[t[f],r[p]];h.toLowerCase()===m.toLowerCase()&&(r[p]=h,s=p,i=f)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(bn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(bn,s),a=r.lastIndexOf(bn),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,a),r.slice(a+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#n(w,c,n,0,0))return!1;i+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#n(t,d,n,w,0))f=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#n(t,d,n,w,0)))return!1;f=d.length+1}}if(!u.length){let w=!!f;for(let x=i;x<t.length-f;x++){let k=String(t[x]);if(w=!0,k==="."||k===".."||!this.options.dot&&k.startsWith("."))return!1}return n||w}let p=[[[],0]],h=p[0],m=0,g=[0];for(let w of u)w===bn?(g.push(m),h=[[],0],p.push(h)):(h[0].push(w),m++);let y=p.length-1,b=t.length-f;for(let w of p)w[1]=b-(g[y--]+w[0].length);return!!this.#r(t,p,i,0,n,0,!!f)}#r(t,r,n,i,s,o,a){let c=r[i];if(!c){for(let f=n;f<t.length;f++){a=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return a}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(h!==!1)return h}let p=t[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(t,r,n,i,s){let o,a,c,u;for(o=i,a=s,u=t.length,c=r.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");let d=r[a],f=t[o];if(this.debug(r,d,f),d===!1||d===bn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return PL(this.pattern,this.options)}parse(t){Cf(t);let r=this.options;if(t==="**")return bn;if(t==="")return"";let n,i=null;(n=t.match(Hme))?i=r.dot?Vme:Gme:(n=t.match(Dme))?i=(r.nocase?r.dot?Ume:Fme:r.dot?Mme:Lme)(n[1]):(n=t.match(Zme))?i=(r.nocase?r.dot?Yme:Kme:r.dot?Xme:Jme)(n):(n=t.match(jme))?i=r.dot?Bme:zme:(n=t.match(Wme))&&(i=qme);let s=el.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?tge:r.dot?rge:nge,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))i.add(p);return typeof f=="string"?lge(f):f===bn?bn:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==bn||m===bn||(m===void 0?h!==void 0&&h!==bn?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=m+"(?:\\/|\\/"+n+")?":h!==bn&&(u[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=bn))});let d=u.filter(f=>f!==bn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a of s){let c=i;if(n.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return Qr.defaults(t).Minimatch}};Qr.AST=el;Qr.Minimatch=Wc;Qr.escape=T4;Qr.unescape=Jo;import{gunzipSync as l0e}from"node:zlib";var Rf=class{static{l(this,"Diff")}diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=l(w=>{if(w=this.postProcess(w,n),i){setTimeout(function(){i(w)},0);return}else return w},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&m+1>=a)return o(this.buildValues(h[0].lastComponent,r,t));let g=-1/0,y=1/0,b=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let x,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let C=S.oldPos-w;A=S&&0<=C&&C<a}let I=k&&k.oldPos+1<c;if(!A&&!I){h[w]=void 0;continue}if(!I||A&&k.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,n):x=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(x,r,t,w,n),x.oldPos+1>=c&&m+1>=a)return o(this.buildValues(x.lastComponent,r,t))||!0;h[w]=x,x.oldPos+1>=c&&(y=Math.min(y,w-1)),m+1>=a&&(g=Math.max(g,w+1))}u++},"execEditLength");if(i)l(function w(){setTimeout(function(){if(u>d||Date.now()>p)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let w=b();if(w)return w}}addToPath(t,r,n,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){let o=r.length,a=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,a=0,c=0,u=0;for(;a<o;a++){let d=i[a];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=r.slice(c,c+d.count);f=f.map(function(p,h){let m=n[u+h];return m.length>p.length?m:p}),d.value=this.join(f)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var C4=class extends Rf{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=uge}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
769
|
+
`}l(fL,"pageStyles");var Khe="https://api.deepseek.com";var Yhe="deepseek-v4-flash",Xhe="high";var Jhe=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function y4(e){let t=e??Khe,r;try{r=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(r.protocol!=="http:"&&r.protocol!=="https:"||r.username.length>0||r.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(y4,"resolveEdgeBaseURL");function $f(e){if(e===void 0)return Yhe;if(!Jhe.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l($f,"resolveEdgeModel");function v4(e){if(e===void 0)return Xhe;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(v4,"resolveEdgeReasoningEffort");function w4(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(w4,"resolveEdgeStreamIdleTimeoutMs");function b4(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(b4,"resolveEdgeMaxOutputTokens");var x4={name:"dsh-edge",version:"0.6.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.2","@deepseek-ai/dsh-attachment":"0.1.1-rc.2","@deepseek-ai/dsh-brand":"0.1.1-rc.2","@deepseek-ai/dsh-compaction":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.1-rc.2","@deepseek-ai/dsh-credentials":"0.1.1-rc.2","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.2","@deepseek-ai/dsh-llm":"0.1.1-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-session":"0.1.1-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.2","@deepseek-ai/dsh-session-projection":"0.1.1-rc.2","@deepseek-ai/dsh-session-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.1-rc.2","@deepseek-ai/dsh-output-retention":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"0.1.1-rc.2","@deepseek-ai/dsh-spill":"0.1.1-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.1-rc.2","@deepseek-ai/dsh-storage":"0.1.1-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.1-rc.2","@deepseek-ai/dsh-timeout":"0.1.1-rc.2","@deepseek-ai/dsh-token-meter":"0.1.1-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.2","@deepseek-ai/dsh-tool-web":"0.1.1-rc.2","@deepseek-ai/dsh-tools":"0.1.1-rc.2","@deepseek-ai/dsh-web":"0.1.1-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-workspace":"0.1.1-rc.2","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var v1=x4.version,pL=x4.dshEdge.upstreamVersion;function eme(){return"dsh-edge@0.6.0/direct"}l(eme,"resolveEdgeDeploymentId");function w1(e){return{baseURL:y4(e.DEEPSEEK_BASE_URL),maxTokens:b4(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:$f(e.DEEPSEEK_MODEL),reasoningEffort:v4(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:t1(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:w4(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:kf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(w1,"resolveEdgeDeploymentConfig");function tme(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(tme,"edgeDeploymentApiKeyConfigured");function rme(e){let t=y4(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(rme,"projectedEdgeBaseURL");function E4(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:eme(),apiKeyConfigured:tme(e),baseURL:rme(e.DEEPSEEK_BASE_URL),maxTokens:b4(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:$f(e.DEEPSEEK_MODEL),reasoningEffort:v4(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:t1(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:w4(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:kf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(E4,"resolveEdgeDeploymentProfile");function hL(e){w1(e);let t=E4(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:v1,upstreamVersion:pL,status:"ready"}}l(hL,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as XBe}from"cloudflare:workers";var Ol=zy(mL());var S4=l((e,t,r)=>{let n=e instanceof RegExp?gL(e,r):e,i=t instanceof RegExp?gL(t,r):t,s=n!==null&&i!=null&&nme(n,i,r);return s&&{start:s[0],end:s[1],pre:r.slice(0,s[0]),body:r.slice(s[0]+n.length,s[1]),post:r.slice(s[1]+i.length)}},"balanced"),gL=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),nme=l((e,t,r)=>{let n,i,s,o,a,c=r.indexOf(e),u=r.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(n=[],s=r.length;d>=0&&!a;){if(d===c)n.push(d),c=r.indexOf(e,d+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=r.indexOf(t,d+1);d=c<u&&c>=0?c:u}n.length&&o!==void 0&&(a=[s,o])}return a},"range");var yL="\0SLASH"+Math.random()+"\0",vL="\0OPEN"+Math.random()+"\0",I4="\0CLOSE"+Math.random()+"\0",wL="\0COMMA"+Math.random()+"\0",bL="\0PERIOD"+Math.random()+"\0",ime=new RegExp(yL,"g"),sme=new RegExp(vL,"g"),ome=new RegExp(I4,"g"),ame=new RegExp(wL,"g"),lme=new RegExp(bL,"g"),cme=/\\\\/g,ume=/\\{/g,dme=/\\}/g,fme=/\\,/g,pme=/\\\./g,hme=1e5,mme=4e6;function k4(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(k4,"numeric");function gme(e){return e.replace(cme,yL).replace(ume,vL).replace(dme,I4).replace(fme,wL).replace(pme,bL)}l(gme,"escapeBraces");function yme(e){return e.replace(ime,"\\").replace(sme,"{").replace(ome,"}").replace(ame,",").replace(lme,".")}l(yme,"unescapeBraces");function xL(e){if(!e)return[""];let t=[],r=S4("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=xL(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(xL,"parseCommaParts");function EL(e,t={}){if(!e)return[];let{max:r=hme,maxLength:n=mme}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),A4(gme(e),r,n,!0).map(yme)}l(EL,"expand");function vme(e){return"{"+e+"}"}l(vme,"embrace");function wme(e){return/^-?0\d/.test(e)}l(wme,"isPadded");function bme(e,t){return e<=t}l(bme,"lte");function xme(e,t){return e>=t}l(xme,"gte");function Tf(e,t,r,n,i,s){let o=[],a=0;for(let c=0;c<e.length;c++)for(let u=0;u<r.length;u++){if(o.length>=n)return o;let d=e[c]+t+r[u];if(!(s&&!d)){if(a+d.length>i)return o;o.push(d),a+=d.length}}return o}l(Tf,"combine");function Eme(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=k4(i[0]),a=k4(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(k4(i[2])),1):1,d=bme;a<o&&(u*=-1,d=xme);let p=i.some(wme),h=0;for(let m=o;d(m,a)&&s.length<r;m+=u){let g;if(t)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),p){let y=c-g.length;if(y>0){let b=new Array(y+1).join("0");m<0?g="-"+b+g.slice(1):g=b+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(Eme,"expandSequence");function A4(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=S4("{","}",e);if(!a)return Tf(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=Tf(i,c+"{"+a.body+"}",[""],t,r,s&&!a.post.length),o=!1,!a.post.length)break;e=a.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),f=u||d,p=a.body.indexOf(",")>=0;if(!f&&!p){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+I4+a.post,n=!0;continue}return Tf(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!f,o=!1);let h;if(f)h=Eme(a.body,d,t,r);else{let m=xL(a.body);if(m.length===1&&m[0]!==void 0&&(m=A4(m[0],t,r,!1).map(vme),m.length===1)){if(i=Tf(i,c+m[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let g=s&&!a.post.length&&!c;for(let b=0;g&&b<i.length;b++)i[b]&&(g=!1);h=[];let y=0;e:for(let b=0;b<m.length;b++){let w=A4(m[b],t,r,!1);for(let x=0;x<w.length;x++){let k=w[x];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=Tf(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(A4,"expand_");var Cf=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Sme={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Of=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),kme=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),SL=l(e=>e.join(""),"rangesToString"),kL=l((e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,u=!1,d=r,f="";e:for(;s<e.length;){let g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){u=!0,s++;continue}if(g==="]"&&o&&!c){d=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(let[y,[b,w,x]]of Object.entries(Sme))if(e.startsWith(y,s)){if(f)return["$.",!1,e.length-r,!0];s+=y.length,x?i.push(b):n.push(b),a=a||w;continue e}}if(c=!1,f){g>f?n.push(Of(f)+"-"+Of(g)):g===f&&n.push(Of(g)),f="",s++;continue}if(e.startsWith("-]",s+1)){n.push(Of(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=g,s+=2;continue}n.push(Of(g)),s++}if(d<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let g=n[0].length===2?n[0].slice(-1):n[0];return[kme(g),!1,d-r,!1]}let p="["+(u?"^":"")+SL(n)+"]",h="["+(u?"":"^")+SL(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,a,d-r,!0]},"parseClass");var Jo=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var Gn,Ame=new Set(["!","?","+","*","@"]),_4=l(e=>Ame.has(e),"isExtglobType"),AL=l(e=>_4(e.type),"isExtglobAST"),Ime=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),_me=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),$me=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),IL=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Tme="(?!(?:^|/)\\.\\.?(?:$|/))",x1="(?!\\.)",Cme=new Set(["[","."]),Ome=new Set(["..","."]),Rme=new Set("().*{}+?[]^$\\!"),Nme=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),$4="[^/]",_L=$4+"*?",$L=$4+"+?",Pme=0,el=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++Pme;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#u&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Gn&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Gn&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new Gn(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#h(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let g=n,y="";for(;g<t.length;){let b=t.charAt(g++);if(a||b==="\\"){a=!a,y+=b;continue}if(c){g===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(g===u+2&&d)&&(c=!1),y+=b;continue}else if(b==="["){c=!0,u=g,d=!1,y+=b;continue}if(!i.noext&&_4(b)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let x=new Gn(b,r);g=Gn.#h(t,x,g,i,s+1),r.push(x);continue}y+=b}return r.push(y),g}let f=n+1,p=new Gn(null,r),h=[],m="";for(;f<t.length;){let g=t.charAt(f++);if(a||g==="\\"){a=!a,m+=g;continue}if(c){f===u+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(f===u+2&&d)&&(c=!1),m+=g;continue}else if(g==="["){c=!0,u=f,d=!1,m+=g;continue}if(!i.noext&&_4(g)&&t.charAt(f)==="("&&(s<=o||r&&r.#g(g))){let b=r&&r.#g(g)?0:1;p.push(m),m="";let w=new Gn(g,p);p.push(w),f=Gn.#h(t,w,f,i,s+b);continue}if(g==="|"){p.push(m),m="",h.push(p),p=new Gn(null,r);continue}if(g===")")return m===""&&r.#t.length===0&&(r.#c=!0),p.push(m),m="",r.push(...h,p),f;m+=g}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],f}#C(t){return this.#m(t,_me)}#m(t,r=Ime){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#g(n.type,r)}#g(t,r=$me){return!!r.get(this.type)?.includes(t)}#f(t,r){let n=t.#t[0],i=new Gn(null,n,this.options);i.#t.push(""),n.push(i),this.#E(t,r)}#E(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#S(t){return!!IL.get(this.type)?.has(t)}#O(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#S(r.type)}#y(t){let r=IL.get(this.type),n=t.#t[0],i=r?.get(n.type);if(!i)return!1;this.#t=n.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#o=void 0,this.#c=!1}static fromGlob(t,r={}){let n=new Gn(null,void 0,r);return Gn.#h(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!AL(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,b]=typeof h=="string"?Gn.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||b,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Ome.has(this.#t[0]))){let m=Cme,g=r&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),y=!r&&!t&&m.has(u.charAt(0));d=g?Tme:y?x1:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Jo(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#r=void 0,[c,Jo(this.toString()),!1,!1]}let o=!n||t||r||!x1?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?x1:"")+$L;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?x1:"")+_L+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Jo(s),this.#r=!!this.#r,this.#n]}#p(){if(AL(this)){let t=0,r=!1;do{r=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#p(),this.#m(i)?(r=!1,this.#E(i,n)):this.#C(i)?(r=!1,this.#f(i,n)):this.#O(i)&&(r=!1,this.#y(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#v(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(t,r,n=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(Rme.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?$L:_L,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,f,p,h]=kL(t,c);if(p){s+=d,o=o||f,c+=p-1,r=r||h;continue}}if(u==="?"){s+=$4,r=!0;continue}s+=Nme(u)}return[s,Jo(t),!!r,o]}};Gn=el;var T4=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Qr=l((e,t,r={})=>(Cf(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Wc(t,r).match(e)),"minimatch"),Dme=/^\*+([^+@!?*[(]*)$/,Lme=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),Mme=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),Fme=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Ume=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),jme=/^\*+\.\*+$/,zme=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Bme=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Wme=/^\.\*+$/,qme=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Hme=/^\*+$/,Gme=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Vme=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Zme=/^\?+([^+@!?*[(]*)?$/,Kme=l(([e,t=""])=>{let r=OL([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Yme=l(([e,t=""])=>{let r=RL([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),Xme=l(([e,t=""])=>{let r=RL([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),Jme=l(([e,t=""])=>{let r=OL([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),OL=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),RL=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),NL=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",TL={win32:{sep:"\\"},posix:{sep:"/"}},Qme=NL==="win32"?TL.win32.sep:TL.posix.sep;Qr.sep=Qme;var bn=Symbol("globstar **");Qr.GLOBSTAR=bn;var ege="[^/]",tge=ege+"*?",rge="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",nge="(?:(?!(?:\\/|^)\\.).)*?",ige=l((e,t={})=>r=>Qr(r,e,t),"filter");Qr.filter=ige;var xi=l((e,t={})=>Object.assign({},e,t),"ext"),sge=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Qr;let t=Qr;return Object.assign(l((n,i,s={})=>t(n,i,xi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,xi(e,s))}static defaults(i){return t.defaults(xi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,xi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,xi(e,s))}},unescape:l((n,i={})=>t.unescape(n,xi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,xi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,xi(e,i)),"filter"),defaults:l(n=>t.defaults(xi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,xi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,xi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,xi(e,s)),"match"),sep:t.sep,GLOBSTAR:bn})},"defaults");Qr.defaults=sge;var PL=l((e,t={})=>(Cf(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:EL(e,{max:t.braceExpandMax})),"braceExpand");Qr.braceExpand=PL;var oge=l((e,t={})=>new Wc(e,t).makeRe(),"makeRe");Qr.makeRe=oge;var age=l((e,t,r={})=>{let n=new Wc(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Qr.match=age;var CL=/[?*]|[+@!]\(.*?\)|\[|\]/,lge=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Wc=class{static{l(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,r={}){Cf(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||NL,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!r.windowsPathsNoEscape||r[n]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!r.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!r.nonegate,this.comment=!1,this.empty=!1,this.partial=!!r.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=r.windowsNoMagicRoot!==void 0?r.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let r of t)if(typeof r!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,r=this.options;if(!r.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],r.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!CL.test(s[2]))&&!CL.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n of t)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],u=n[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let d=n.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,s=0,o=[],a="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(a==="b"?r[s]:t[i]),i++,s++;else if(n&&t[i]==="**"&&r[s]===t[i+1])o.push(t[i]),i++;else if(n&&r[s]==="**"&&t[i]===r[s+1])o.push(r[s]),s++;else if(t[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=0,s=0;if(this.isWindows){let a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),f=c?3:a?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,m]=[t[f],r[p]];h.toLowerCase()===m.toLowerCase()&&(r[p]=h,s=p,i=f)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(bn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(bn,s),a=r.lastIndexOf(bn),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,a),r.slice(a+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#n(w,c,n,0,0))return!1;i+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#n(t,d,n,w,0))f=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#n(t,d,n,w,0)))return!1;f=d.length+1}}if(!u.length){let w=!!f;for(let x=i;x<t.length-f;x++){let k=String(t[x]);if(w=!0,k==="."||k===".."||!this.options.dot&&k.startsWith("."))return!1}return n||w}let p=[[[],0]],h=p[0],m=0,g=[0];for(let w of u)w===bn?(g.push(m),h=[[],0],p.push(h)):(h[0].push(w),m++);let y=p.length-1,b=t.length-f;for(let w of p)w[1]=b-(g[y--]+w[0].length);return!!this.#r(t,p,i,0,n,0,!!f)}#r(t,r,n,i,s,o,a){let c=r[i];if(!c){for(let f=n;f<t.length;f++){a=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return a}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(h!==!1)return h}let p=t[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(t,r,n,i,s){let o,a,c,u;for(o=i,a=s,u=t.length,c=r.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");let d=r[a],f=t[o];if(this.debug(r,d,f),d===!1||d===bn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return PL(this.pattern,this.options)}parse(t){Cf(t);let r=this.options;if(t==="**")return bn;if(t==="")return"";let n,i=null;(n=t.match(Hme))?i=r.dot?Vme:Gme:(n=t.match(Dme))?i=(r.nocase?r.dot?Ume:Fme:r.dot?Mme:Lme)(n[1]):(n=t.match(Zme))?i=(r.nocase?r.dot?Yme:Kme:r.dot?Xme:Jme)(n):(n=t.match(jme))?i=r.dot?Bme:zme:(n=t.match(Wme))&&(i=qme);let s=el.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let r=this.options,n=r.noglobstar?tge:r.dot?rge:nge,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))i.add(p);return typeof f=="string"?lge(f):f===bn?bn:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==bn||m===bn||(m===void 0?h!==void 0&&h!==bn?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=m+"(?:\\/|\\/"+n+")?":h!==bn&&(u[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=bn))});let d=u.filter(f=>f!==bn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a of s){let c=i;if(n.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return Qr.defaults(t).Minimatch}};Qr.AST=el;Qr.Minimatch=Wc;Qr.escape=T4;Qr.unescape=Jo;import{gunzipSync as l0e}from"node:zlib";var Rf=class{static{l(this,"Diff")}diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=l(w=>{if(w=this.postProcess(w,n),i){setTimeout(function(){i(w)},0);return}else return w},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&m+1>=a)return o(this.buildValues(h[0].lastComponent,r,t));let g=-1/0,y=1/0,b=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let x,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let C=S.oldPos-w;A=S&&0<=C&&C<a}let I=k&&k.oldPos+1<c;if(!A&&!I){h[w]=void 0;continue}if(!I||A&&k.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,n):x=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(x,r,t,w,n),x.oldPos+1>=c&&m+1>=a)return o(this.buildValues(x.lastComponent,r,t))||!0;h[w]=x,x.oldPos+1>=c&&(y=Math.min(y,w-1)),m+1>=a&&(g=Math.max(g,w+1))}u++},"execEditLength");if(i)l(function w(){setTimeout(function(){if(u>d||Date.now()>p)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let w=b();if(w)return w}}addToPath(t,r,n,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){let o=r.length,a=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,a=0,c=0,u=0;for(;a<o;a++){let d=i[a];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=r.slice(c,c+d.count);f=f.map(function(p,h){let m=n[u+h];return m.length>p.length?m:p}),d.value=this.join(f)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var C4=class extends Rf{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=uge}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
770
770
|
`))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
|
|
771
771
|
`))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
|
|
772
772
|
`)&&(t=t.slice(0,-1)),r.endsWith(`
|
package/worker/isolated/index.js
CHANGED
|
@@ -766,7 +766,7 @@ ${i}`:""}`}});function fT(e){if(e.url.trim().length===0)throw new Error("url mus
|
|
|
766
766
|
button, .button { display: inline-block; box-sizing: border-box; margin-top: 1rem; padding: .75rem 1rem; border: 0; border-radius: .6rem; background: #5a87ff; color: #071022; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
|
|
767
767
|
.secondary { background: #29314b; color: #edf2ff; }
|
|
768
768
|
.error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
|
|
769
|
-
`}l(uN,"pageStyles");var kse="https://api.deepseek.com";var Ase="deepseek-v4-flash",_se="high";var Ise=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function Yx(e){let t=e??kse,n;try{n=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username.length>0||n.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(Yx,"resolveEdgeBaseURL");function vu(e){if(e===void 0)return Ase;if(!Ise.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(vu,"resolveEdgeModel");function e6(e){if(e===void 0)return _se;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(e6,"resolveEdgeReasoningEffort");function t6(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(t6,"resolveEdgeStreamIdleTimeoutMs");function n6(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(n6,"resolveEdgeMaxOutputTokens");var r6={name:"dsh-edge",version:"0.6.0-alpha.9",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.2","@deepseek-ai/dsh-attachment":"0.1.1-rc.2","@deepseek-ai/dsh-brand":"0.1.1-rc.2","@deepseek-ai/dsh-compaction":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.1-rc.2","@deepseek-ai/dsh-credentials":"0.1.1-rc.2","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.2","@deepseek-ai/dsh-llm":"0.1.1-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-session":"0.1.1-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.2","@deepseek-ai/dsh-session-projection":"0.1.1-rc.2","@deepseek-ai/dsh-session-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.1-rc.2","@deepseek-ai/dsh-output-retention":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"0.1.1-rc.2","@deepseek-ai/dsh-spill":"0.1.1-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.1-rc.2","@deepseek-ai/dsh-storage":"0.1.1-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.1-rc.2","@deepseek-ai/dsh-timeout":"0.1.1-rc.2","@deepseek-ai/dsh-token-meter":"0.1.1-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.2","@deepseek-ai/dsh-tool-web":"0.1.1-rc.2","@deepseek-ai/dsh-tools":"0.1.1-rc.2","@deepseek-ai/dsh-web":"0.1.1-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-workspace":"0.1.1-rc.2","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Wh=r6.version,dN=r6.dshEdge.upstreamVersion;function $se(){return"dsh-edge@0.6.0-alpha.9/isolated"}l($se,"resolveEdgeDeploymentId");function qh(e){return{baseURL:Yx(e.DEEPSEEK_BASE_URL),maxTokens:n6(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:vu(e.DEEPSEEK_MODEL),reasoningEffort:e6(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_h(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:t6(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:hu(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(qh,"resolveEdgeDeploymentConfig");function Tse(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Tse,"edgeDeploymentApiKeyConfigured");function Nse(e){let t=Yx(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(Nse,"projectedEdgeBaseURL");function i6(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:$se(),apiKeyConfigured:Tse(e),baseURL:Nse(e.DEEPSEEK_BASE_URL),maxTokens:n6(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:vu(e.DEEPSEEK_MODEL),reasoningEffort:e6(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_h(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:t6(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:hu(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(i6,"resolveEdgeDeploymentProfile");function fN(e){qh(e);let t=i6(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:Wh,upstreamVersion:dN,status:"ready"}}l(fN,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as JIe}from"cloudflare:workers";var Ha=E1(pN(),1);var s6=l((e,t,n)=>{let i=e instanceof RegExp?hN(e,n):e,r=t instanceof RegExp?hN(t,n):t,s=i!==null&&r!=null&&Rse(i,r,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+i.length,s[1]),post:n.slice(s[1]+r.length)}},"balanced"),hN=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Rse=l((e,t,n)=>{let i,r,s,a,o,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(i=[],s=n.length;d>=0&&!o;){if(d===c)i.push(d),c=n.indexOf(e,d+1);else if(i.length===1){let f=i.pop();f!==void 0&&(o=[f,u])}else r=i.pop(),r!==void 0&&r<s&&(s=r,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}i.length&&a!==void 0&&(o=[s,a])}return o},"range");var mN="\0SLASH"+Math.random()+"\0",gN="\0OPEN"+Math.random()+"\0",l6="\0CLOSE"+Math.random()+"\0",yN="\0COMMA"+Math.random()+"\0",vN="\0PERIOD"+Math.random()+"\0",Ose=new RegExp(mN,"g"),Pse=new RegExp(gN,"g"),Dse=new RegExp(l6,"g"),Lse=new RegExp(yN,"g"),Mse=new RegExp(vN,"g"),jse=/\\\\/g,Fse=/\\{/g,Use=/\\}/g,zse=/\\,/g,Bse=/\\\./g,Wse=1e5,qse=4e6;function a6(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(a6,"numeric");function Hse(e){return e.replace(jse,mN).replace(Fse,gN).replace(Use,l6).replace(zse,yN).replace(Bse,vN)}l(Hse,"escapeBraces");function Gse(e){return e.replace(Ose,"\\").replace(Pse,"{").replace(Dse,"}").replace(Lse,",").replace(Mse,".")}l(Gse,"unescapeBraces");function wN(e){if(!e)return[""];let t=[],n=s6("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=wN(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(wN,"parseCommaParts");function bN(e,t={}){if(!e)return[];let{max:n=Wse,maxLength:i=qse}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),o6(Hse(e),n,i,!0).map(Gse)}l(bN,"expand");function Vse(e){return"{"+e+"}"}l(Vse,"embrace");function Zse(e){return/^-?0\d/.test(e)}l(Zse,"isPadded");function Kse(e,t){return e<=t}l(Kse,"lte");function Xse(e,t){return e>=t}l(Xse,"gte");function wu(e,t,n,i,r,s){let a=[],o=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=i)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(o+d.length>r)return a;a.push(d),o+=d.length}}return a}l(wu,"combine");function Qse(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=a6(r[0]),o=a6(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(a6(r[2])),1):1,d=Kse;o<a&&(u*=-1,d=Xse);let p=r.some(Zse),h=0;for(let g=a;d(g,o)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),p){let w=c-y.length;if(w>0){let x=new Array(w+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(Qse,"expandSequence");function o6(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=s6("{","}",e);if(!o)return wu(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=wu(r,c+"{"+o.body+"}",[""],t,n,s&&!o.post.length),a=!1,!o.post.length)break;e=o.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||d,p=o.body.indexOf(",")>=0;if(!f&&!p){if(o.post.match(/,(?!,).*\}/)){e=o.pre+"{"+o.body+l6+o.post,i=!0;continue}return wu(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=Qse(o.body,d,t,n);else{let g=wN(o.body);if(g.length===1&&g[0]!==void 0&&(g=o6(g[0],t,n,!1).map(Vse),g.length===1)){if(r=wu(r,c+g[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let x=0;y&&x<r.length;x++)r[x]&&(y=!1);h=[];let w=0;e:for(let x=0;x<g.length;x++){let k=o6(g[x],t,n,!1);for(let E=0;E<k.length;E++){let A=k[E];if(!(y&&!A)){if(h.length>=t||w+A.length>n)break e;h.push(A),w+=A.length}}}}if(r=wu(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(o6,"expand_");var bu=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Jse={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},xu=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Yse=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),xN=l(e=>e.join(""),"rangesToString"),EN=l((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=n+1,a=!1,o=!1,c=!1,u=!1,d=n,f="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[w,[x,k,E]]of Object.entries(Jse))if(e.startsWith(w,s)){if(f)return["$.",!1,e.length-n,!0];s+=w.length,E?r.push(x):i.push(x),o=o||k;continue e}}if(c=!1,f){y>f?i.push(xu(f)+"-"+xu(y)):y===f&&i.push(xu(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(xu(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(xu(y)),s++}if(d<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,e.length-n,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let y=i[0].length===2?i[0].slice(-1):i[0];return[Yse(y),!1,d-n,!1]}let p="["+(u?"^":"")+xN(i)+"]",h="["+(u?"":"^")+xN(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var Rs=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var dr,eae=new Set(["!","?","+","*","@"]),c6=l(e=>eae.has(e),"isExtglobType"),SN=l(e=>c6(e.type),"isExtglobAST"),tae=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),nae=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rae=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),kN=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),iae="(?!(?:^|/)\\.\\.?(?:$|/))",Gh="(?!\\.)",sae=new Set(["[","."]),aae=new Set(["..","."]),oae=new Set("().*{}+?[]^$\\!"),lae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),u6="[^/]",AN=u6+"*?",_N=u6+"+?",cae=0,Ca=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++cae;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,i={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?i:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#u&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,i=n.#i;for(;i;){for(let r=n.#s+1;!i.type&&r<i.#t.length;r++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#t[r])}n=i,i=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof dr&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let i=t.#t[n];if(!(i instanceof dr&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new dr(this.type,t);for(let i of this.#t)n.copyIn(i);return n}static#h(t,n,i,r,s){let a=r.maxExtglobRecursion??2,o=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=i,w="";for(;y<t.length;){let x=t.charAt(y++);if(o||x==="\\"){o=!o,w+=x;continue}if(c){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(c=!1),w+=x;continue}else if(x==="["){c=!0,u=y,d=!1,w+=x;continue}if(!r.noext&&c6(x)&&t.charAt(y)==="("&&s<=a){n.push(w),w="";let E=new dr(x,n);y=dr.#h(t,E,y,r,s+1),n.push(E);continue}w+=x}return n.push(w),y}let f=i+1,p=new dr(null,n),h=[],g="";for(;f<t.length;){let y=t.charAt(f++);if(o||y==="\\"){o=!o,g+=y;continue}if(c){f===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(f===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=f,d=!1,g+=y;continue}if(!r.noext&&c6(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let x=n&&n.#g(y)?0:1;p.push(g),g="";let k=new dr(y,p);p.push(k),f=dr.#h(t,k,f,r,s+x);continue}if(y==="|"){p.push(g),g="",h.push(p),p=new dr(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),p.push(g),g="",n.push(...h,p),f;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#T(t){return this.#m(t,nae)}#m(t,n=tae){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let i=t.#t[0];return!i||typeof i!="object"||i.type===null?!1:this.#g(i.type,n)}#g(t,n=rae){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new dr(null,i,this.options);r.#t.push(""),i.push(r),this.#E(t,n)}#E(t,n){let i=t.#t[0];this.#t.splice(n,1,...i.#t);for(let r of i.#t)typeof r=="object"&&(r.#i=this);this.#a=void 0}#S(t){return!!kN.get(this.type)?.has(t)}#N(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=kN.get(this.type),i=t.#t[0],r=n?.get(i.type);if(!r)return!1;this.#t=i.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=r,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let i=new dr(null,void 0,n);return dr.#h(t,i,0,n,0),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,i,r,s]=this.toRegExpSource();if(!(r||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let o=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!SN(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,w,x]=typeof h=="string"?dr.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||w,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&aae.has(this.#t[0]))){let g=sae,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),w=!n&&!t&&g.has(u.charAt(0));d=y?iae:w?Gh:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Rs(u),this.#n=!!this.#n,this.#r]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,Rs(this.toString()),!1,!1]}let a=!i||t||n||!Gh?"":this.#v(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?Gh:"")+_N;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?Gh:"")+AN+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,Rs(s),this.#n=!!this.#n,this.#r]}#p(){if(SN(this)){let t=0,n=!1;do{n=!0;for(let i=0;i<this.#t.length;i++){let r=this.#t[i];typeof r=="object"&&(r.#p(),this.#m(r)?(n=!1,this.#E(r,i)):this.#T(r)?(n=!1,this.#f(r,i)):this.#N(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#a=void 0}#v(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[i,r,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,i}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#k(t,n,i=!1){let r=!1,s="",a=!1,o=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,s+=(oae.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?_N:AN,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=EN(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=u6,n=!0;continue}s+=lae(u)}return[s,Rs(t),!!n,a]}};dr=Ca;var d6=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var kn=l((e,t,n={})=>(bu(t),!n.nocomment&&t.charAt(0)==="#"?!1:new sl(t,n).match(e)),"minimatch"),uae=/^\*+([^+@!?*[(]*)$/,dae=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),fae=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),pae=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),hae=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),mae=/^\*+\.\*+$/,gae=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),yae=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),vae=/^\.\*+$/,wae=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),bae=/^\*+$/,xae=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Eae=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Sae=/^\?+([^+@!?*[(]*)?$/,kae=l(([e,t=""])=>{let n=$N([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),Aae=l(([e,t=""])=>{let n=TN([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),_ae=l(([e,t=""])=>{let n=TN([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),Iae=l(([e,t=""])=>{let n=$N([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),$N=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),TN=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),NN=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",IN={win32:{sep:"\\"},posix:{sep:"/"}},Cae=NN==="win32"?IN.win32.sep:IN.posix.sep;kn.sep=Cae;var zn=Symbol("globstar **");kn.GLOBSTAR=zn;var $ae="[^/]",Tae=$ae+"*?",Nae="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Rae="(?:(?!(?:\\/|^)\\.).)*?",Oae=l((e,t={})=>n=>kn(n,e,t),"filter");kn.filter=Oae;var Nr=l((e,t={})=>Object.assign({},e,t),"ext"),Pae=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return kn;let t=kn;return Object.assign(l((i,r,s={})=>t(i,r,Nr(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Nr(e,s))}static defaults(r){return t.defaults(Nr(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Nr(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Nr(e,s))}},unescape:l((i,r={})=>t.unescape(i,Nr(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Nr(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Nr(e,r)),"filter"),defaults:l(i=>t.defaults(Nr(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Nr(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Nr(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Nr(e,s)),"match"),sep:t.sep,GLOBSTAR:zn})},"defaults");kn.defaults=Pae;var RN=l((e,t={})=>(bu(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:bN(e,{max:t.braceExpandMax})),"braceExpand");kn.braceExpand=RN;var Dae=l((e,t={})=>new sl(e,t).makeRe(),"makeRe");kn.makeRe=Dae;var Lae=l((e,t,n={})=>{let i=new sl(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");kn.match=Lae;var CN=/[?*]|[+@!]\(.*?\)|\[|\]/,Mae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),sl=class{static{l(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){bu(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||NN,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!CN.test(s[2]))&&!CN.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i of t)for(let r=0;r<i.length;r++)i[r]==="**"&&(i[r]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let r=i;for(;n[r+1]==="**";)r++;r!==i&&n.splice(i,r-i)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let s=t[r];r===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let r=t[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(n=!0,t.splice(i-1,2),i-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let i of t){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let a=r;for(;i[a+1]==="**";)a++;a>r&&i.splice(r+1,a-r);let o=i[r+1],c=i[r+2],u=i[r+3];if(o!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,i.splice(r,1);let d=i.slice(0);d[r]="**",t.push(d),r--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(n=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(n=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let a=i[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let i=n+1;i<t.length;i++){let r=this.partsMatch(t[n],t[i],!this.preserveMultipleSlashes);if(r){t[n]=[],t[i]=r;break}}return t.filter(n=>n.length)}partsMatch(t,n,i=!1){let r=0,s=0,a=[],o="";for(;r<t.length&&s<n.length;)if(t[r]===n[s])a.push(o==="b"?n[s]:t[r]),r++,s++;else if(i&&t[r]==="**"&&n[s]===t[r+1])a.push(t[r]),r++;else if(i&&n[s]==="**"&&t[r]===n[s+1])a.push(n[s]),s++;else if(t[r]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(o==="b")return!1;o="a",a.push(t[r]),r++,s++}else if(n[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(o==="a")return!1;o="b",a.push(n[s]),r++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,i=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)n=!n,i++;i&&(this.pattern=t.slice(i)),this.negate=n}matchOne(t,n,i=!1){let r=0,s=0;if(this.isWindows){let o=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!o&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),f=c?3:o?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,g]=[t[f],n[p]];h.toLowerCase()===g.toLowerCase()&&(n[p]=h,s=p,r=f)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(zn)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(zn,s),o=n.lastIndexOf(zn),[c,u,d]=i?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,o),n.slice(o+1)];if(c.length){let k=t.slice(r,r+c.length);if(!this.#r(k,c,i,0,0))return!1;r+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+r>t.length)return!1;let k=t.length-d.length;if(this.#r(t,d,i,k,0))f=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(k--,!this.#r(t,d,i,k,0)))return!1;f=d.length+1}}if(!u.length){let k=!!f;for(let E=r;E<t.length-f;E++){let A=String(t[E]);if(k=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return i||k}let p=[[[],0]],h=p[0],g=0,y=[0];for(let k of u)k===zn?(y.push(g),h=[[],0],p.push(h)):(h[0].push(k),g++);let w=p.length-1,x=t.length-f;for(let k of p)k[1]=x-(y[w--]+k[0].length);return!!this.#n(t,p,r,0,i,0,!!f)}#n(t,n,i,r,s,a,o){let c=n[r];if(!c){for(let f=i;f<t.length;f++){o=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[u,d]=c;for(;i<=d;){if(this.#r(t.slice(0,i+u.length),u,s,i,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,i+u.length,r+1,s,a+1,o);if(h!==!1)return h}let p=t[i];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;i++}return s||null}#r(t,n,i,r,s){let a,o,c,u;for(a=r,o=s,u=t.length,c=n.length;a<u&&o<c;a++,o++){this.debug("matchOne loop");let d=n[o],f=t[a];if(this.debug(n,d,f),d===!1||d===zn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(a===u&&o===c)return!0;if(a===u)return i;if(o===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return RN(this.pattern,this.options)}parse(t){bu(t);let n=this.options;if(t==="**")return zn;if(t==="")return"";let i,r=null;(i=t.match(bae))?r=n.dot?Eae:xae:(i=t.match(uae))?r=(n.nocase?n.dot?hae:pae:n.dot?fae:dae)(i[1]):(i=t.match(Sae))?r=(n.nocase?n.dot?Aae:kae:n.dot?_ae:Iae)(i):(i=t.match(mae))?r=n.dot?yae:gae:(i=t.match(vae))&&(r=wae);let s=Ca.fromGlob(t,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?Tae:n.dot?Nae:Rae,r=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))r.add(p);return typeof f=="string"?Mae(f):f===zn?zn:f._src});u.forEach((f,p)=>{let h=u[p+1],g=u[p-1];f!==zn||g===zn||(g===void 0?h!==void 0&&h!==zn?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=g+"(?:\\/|\\/"+i+")?":h!==zn&&(u[p-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=zn))});let d=u.filter(f=>f!==zn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o of s){let c=r;if(i.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return kn.defaults(t).Minimatch}};kn.AST=Ca;kn.Minimatch=sl;kn.escape=d6;kn.unescape=Rs;import{gunzipSync as nce}from"node:zlib";var Eu=class{static{l(this,"Diff")}diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);let s=this.castInput(t,i),a=this.castInput(n,i),o=this.removeEmpty(this.tokenize(s,i)),c=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,c,i,r)}diffWithOptionsObj(t,n,i,r){var s;let a=l(k=>{if(k=this.postProcess(k,i),r){setTimeout(function(){r(k)},0);return}else return k},"done"),o=n.length,c=t.length,u=1,d=o+c;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&g+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,w=1/0,x=l(()=>{for(let k=Math.max(y,-u);k<=Math.min(w,u);k+=2){let E,A=h[k-1],S=h[k+1];A&&(h[k-1]=void 0);let _=!1;if(S){let M=S.oldPos-k;_=S&&0<=M&&M<o}let T=A&&A.oldPos+1<c;if(!_&&!T){h[k]=void 0;continue}if(!T||_&&A.oldPos<S.oldPos?E=this.addToPath(S,!0,!1,0,i):E=this.addToPath(A,!1,!0,1,i),g=this.extractCommon(E,n,t,k,i),E.oldPos+1>=c&&g+1>=o)return a(this.buildValues(E.lastComponent,n,t))||!0;h[k]=E,E.oldPos+1>=c&&(w=Math.min(w,k-1)),g+1>=o&&(y=Math.max(y,k+1))}u++},"execEditLength");if(r)l(function k(){setTimeout(function(){if(u>d||Date.now()>p)return r(void 0);x()||k()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let k=x();if(k)return k}}addToPath(t,n,i,r,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:a.count+1,added:n,removed:i,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:a}}}extractCommon(t,n,i,r,s){let a=n.length,o=i.length,c=t.oldPos,u=c-r,d=0;for(;u+1<a&&c+1<o&&this.equals(i[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){let r=[],s;for(;t;)r.push(t),s=t.previousComponent,delete t.previousComponent,t=s;r.reverse();let a=r.length,o=0,c=0,u=0;for(;o<a;o++){let d=r[o];if(d.removed)d.value=this.join(i.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){let g=i[u+h];return g.length>p.length?g:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return r}};var f6=class extends Eu{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Fae}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
769
|
+
`}l(uN,"pageStyles");var kse="https://api.deepseek.com";var Ase="deepseek-v4-flash",_se="high";var Ise=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function Yx(e){let t=e??kse,n;try{n=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username.length>0||n.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(Yx,"resolveEdgeBaseURL");function vu(e){if(e===void 0)return Ase;if(!Ise.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(vu,"resolveEdgeModel");function e6(e){if(e===void 0)return _se;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(e6,"resolveEdgeReasoningEffort");function t6(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(t6,"resolveEdgeStreamIdleTimeoutMs");function n6(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(n6,"resolveEdgeMaxOutputTokens");var r6={name:"dsh-edge",version:"0.6.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.2"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.2","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.2","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.2","@deepseek-ai/dsh-attachment":"0.1.1-rc.2","@deepseek-ai/dsh-brand":"0.1.1-rc.2","@deepseek-ai/dsh-compaction":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-basic":"0.1.1-rc.2","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.1-rc.2","@deepseek-ai/dsh-credentials":"0.1.1-rc.2","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.2","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.2","@deepseek-ai/dsh-llm":"0.1.1-rc.2","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-session":"0.1.1-rc.2","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.2","@deepseek-ai/dsh-session-projection":"0.1.1-rc.2","@deepseek-ai/dsh-session-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.1-rc.2","@deepseek-ai/dsh-session-title-llm":"0.1.1-rc.2","@deepseek-ai/dsh-output-retention":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"0.1.1-rc.2","@deepseek-ai/dsh-spill":"0.1.1-rc.2","@deepseek-ai/dsh-spill-policy":"0.1.1-rc.2","@deepseek-ai/dsh-storage":"0.1.1-rc.2","@deepseek-ai/dsh-storage-domain":"0.1.1-rc.2","@deepseek-ai/dsh-timeout":"0.1.1-rc.2","@deepseek-ai/dsh-token-meter":"0.1.1-rc.2","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.2","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.2","@deepseek-ai/dsh-tool-web":"0.1.1-rc.2","@deepseek-ai/dsh-tools":"0.1.1-rc.2","@deepseek-ai/dsh-web":"0.1.1-rc.2","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.2","@deepseek-ai/dsh-workspace":"0.1.1-rc.2","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Wh=r6.version,dN=r6.dshEdge.upstreamVersion;function $se(){return"dsh-edge@0.6.0/isolated"}l($se,"resolveEdgeDeploymentId");function qh(e){return{baseURL:Yx(e.DEEPSEEK_BASE_URL),maxTokens:n6(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:vu(e.DEEPSEEK_MODEL),reasoningEffort:e6(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_h(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:t6(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:hu(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(qh,"resolveEdgeDeploymentConfig");function Tse(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Tse,"edgeDeploymentApiKeyConfigured");function Nse(e){let t=Yx(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(Nse,"projectedEdgeBaseURL");function i6(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:$se(),apiKeyConfigured:Tse(e),baseURL:Nse(e.DEEPSEEK_BASE_URL),maxTokens:n6(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:vu(e.DEEPSEEK_MODEL),reasoningEffort:e6(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_h(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:t6(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:hu(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(i6,"resolveEdgeDeploymentProfile");function fN(e){qh(e);let t=i6(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:Wh,upstreamVersion:dN,status:"ready"}}l(fN,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as JIe}from"cloudflare:workers";var Ha=E1(pN(),1);var s6=l((e,t,n)=>{let i=e instanceof RegExp?hN(e,n):e,r=t instanceof RegExp?hN(t,n):t,s=i!==null&&r!=null&&Rse(i,r,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+i.length,s[1]),post:n.slice(s[1]+r.length)}},"balanced"),hN=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Rse=l((e,t,n)=>{let i,r,s,a,o,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(i=[],s=n.length;d>=0&&!o;){if(d===c)i.push(d),c=n.indexOf(e,d+1);else if(i.length===1){let f=i.pop();f!==void 0&&(o=[f,u])}else r=i.pop(),r!==void 0&&r<s&&(s=r,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}i.length&&a!==void 0&&(o=[s,a])}return o},"range");var mN="\0SLASH"+Math.random()+"\0",gN="\0OPEN"+Math.random()+"\0",l6="\0CLOSE"+Math.random()+"\0",yN="\0COMMA"+Math.random()+"\0",vN="\0PERIOD"+Math.random()+"\0",Ose=new RegExp(mN,"g"),Pse=new RegExp(gN,"g"),Dse=new RegExp(l6,"g"),Lse=new RegExp(yN,"g"),Mse=new RegExp(vN,"g"),jse=/\\\\/g,Fse=/\\{/g,Use=/\\}/g,zse=/\\,/g,Bse=/\\\./g,Wse=1e5,qse=4e6;function a6(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(a6,"numeric");function Hse(e){return e.replace(jse,mN).replace(Fse,gN).replace(Use,l6).replace(zse,yN).replace(Bse,vN)}l(Hse,"escapeBraces");function Gse(e){return e.replace(Ose,"\\").replace(Pse,"{").replace(Dse,"}").replace(Lse,",").replace(Mse,".")}l(Gse,"unescapeBraces");function wN(e){if(!e)return[""];let t=[],n=s6("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=wN(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(wN,"parseCommaParts");function bN(e,t={}){if(!e)return[];let{max:n=Wse,maxLength:i=qse}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),o6(Hse(e),n,i,!0).map(Gse)}l(bN,"expand");function Vse(e){return"{"+e+"}"}l(Vse,"embrace");function Zse(e){return/^-?0\d/.test(e)}l(Zse,"isPadded");function Kse(e,t){return e<=t}l(Kse,"lte");function Xse(e,t){return e>=t}l(Xse,"gte");function wu(e,t,n,i,r,s){let a=[],o=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=i)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(o+d.length>r)return a;a.push(d),o+=d.length}}return a}l(wu,"combine");function Qse(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=a6(r[0]),o=a6(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(a6(r[2])),1):1,d=Kse;o<a&&(u*=-1,d=Xse);let p=r.some(Zse),h=0;for(let g=a;d(g,o)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),p){let w=c-y.length;if(w>0){let x=new Array(w+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(Qse,"expandSequence");function o6(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=s6("{","}",e);if(!o)return wu(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=wu(r,c+"{"+o.body+"}",[""],t,n,s&&!o.post.length),a=!1,!o.post.length)break;e=o.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||d,p=o.body.indexOf(",")>=0;if(!f&&!p){if(o.post.match(/,(?!,).*\}/)){e=o.pre+"{"+o.body+l6+o.post,i=!0;continue}return wu(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=Qse(o.body,d,t,n);else{let g=wN(o.body);if(g.length===1&&g[0]!==void 0&&(g=o6(g[0],t,n,!1).map(Vse),g.length===1)){if(r=wu(r,c+g[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let x=0;y&&x<r.length;x++)r[x]&&(y=!1);h=[];let w=0;e:for(let x=0;x<g.length;x++){let k=o6(g[x],t,n,!1);for(let E=0;E<k.length;E++){let A=k[E];if(!(y&&!A)){if(h.length>=t||w+A.length>n)break e;h.push(A),w+=A.length}}}}if(r=wu(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(o6,"expand_");var bu=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Jse={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},xu=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Yse=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),xN=l(e=>e.join(""),"rangesToString"),EN=l((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=n+1,a=!1,o=!1,c=!1,u=!1,d=n,f="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[w,[x,k,E]]of Object.entries(Jse))if(e.startsWith(w,s)){if(f)return["$.",!1,e.length-n,!0];s+=w.length,E?r.push(x):i.push(x),o=o||k;continue e}}if(c=!1,f){y>f?i.push(xu(f)+"-"+xu(y)):y===f&&i.push(xu(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(xu(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(xu(y)),s++}if(d<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,e.length-n,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let y=i[0].length===2?i[0].slice(-1):i[0];return[Yse(y),!1,d-n,!1]}let p="["+(u?"^":"")+xN(i)+"]",h="["+(u?"":"^")+xN(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var Rs=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var dr,eae=new Set(["!","?","+","*","@"]),c6=l(e=>eae.has(e),"isExtglobType"),SN=l(e=>c6(e.type),"isExtglobAST"),tae=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),nae=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rae=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),kN=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),iae="(?!(?:^|/)\\.\\.?(?:$|/))",Gh="(?!\\.)",sae=new Set(["[","."]),aae=new Set(["..","."]),oae=new Set("().*{}+?[]^$\\!"),lae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),u6="[^/]",AN=u6+"*?",_N=u6+"+?",cae=0,Ca=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++cae;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,i={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?i:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#u&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,i=n.#i;for(;i;){for(let r=n.#s+1;!i.type&&r<i.#t.length;r++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#t[r])}n=i,i=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof dr&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let i=t.#t[n];if(!(i instanceof dr&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new dr(this.type,t);for(let i of this.#t)n.copyIn(i);return n}static#h(t,n,i,r,s){let a=r.maxExtglobRecursion??2,o=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=i,w="";for(;y<t.length;){let x=t.charAt(y++);if(o||x==="\\"){o=!o,w+=x;continue}if(c){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(c=!1),w+=x;continue}else if(x==="["){c=!0,u=y,d=!1,w+=x;continue}if(!r.noext&&c6(x)&&t.charAt(y)==="("&&s<=a){n.push(w),w="";let E=new dr(x,n);y=dr.#h(t,E,y,r,s+1),n.push(E);continue}w+=x}return n.push(w),y}let f=i+1,p=new dr(null,n),h=[],g="";for(;f<t.length;){let y=t.charAt(f++);if(o||y==="\\"){o=!o,g+=y;continue}if(c){f===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(f===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=f,d=!1,g+=y;continue}if(!r.noext&&c6(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let x=n&&n.#g(y)?0:1;p.push(g),g="";let k=new dr(y,p);p.push(k),f=dr.#h(t,k,f,r,s+x);continue}if(y==="|"){p.push(g),g="",h.push(p),p=new dr(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),p.push(g),g="",n.push(...h,p),f;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#T(t){return this.#m(t,nae)}#m(t,n=tae){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let i=t.#t[0];return!i||typeof i!="object"||i.type===null?!1:this.#g(i.type,n)}#g(t,n=rae){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new dr(null,i,this.options);r.#t.push(""),i.push(r),this.#E(t,n)}#E(t,n){let i=t.#t[0];this.#t.splice(n,1,...i.#t);for(let r of i.#t)typeof r=="object"&&(r.#i=this);this.#a=void 0}#S(t){return!!kN.get(this.type)?.has(t)}#N(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=kN.get(this.type),i=t.#t[0],r=n?.get(i.type);if(!r)return!1;this.#t=i.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=r,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let i=new dr(null,void 0,n);return dr.#h(t,i,0,n,0),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,i,r,s]=this.toRegExpSource();if(!(r||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let o=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!SN(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,w,x]=typeof h=="string"?dr.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||w,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&aae.has(this.#t[0]))){let g=sae,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),w=!n&&!t&&g.has(u.charAt(0));d=y?iae:w?Gh:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Rs(u),this.#n=!!this.#n,this.#r]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,Rs(this.toString()),!1,!1]}let a=!i||t||n||!Gh?"":this.#v(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?Gh:"")+_N;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?Gh:"")+AN+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,Rs(s),this.#n=!!this.#n,this.#r]}#p(){if(SN(this)){let t=0,n=!1;do{n=!0;for(let i=0;i<this.#t.length;i++){let r=this.#t[i];typeof r=="object"&&(r.#p(),this.#m(r)?(n=!1,this.#E(r,i)):this.#T(r)?(n=!1,this.#f(r,i)):this.#N(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#a=void 0}#v(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[i,r,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,i}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#k(t,n,i=!1){let r=!1,s="",a=!1,o=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,s+=(oae.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?_N:AN,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=EN(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=u6,n=!0;continue}s+=lae(u)}return[s,Rs(t),!!n,a]}};dr=Ca;var d6=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var kn=l((e,t,n={})=>(bu(t),!n.nocomment&&t.charAt(0)==="#"?!1:new sl(t,n).match(e)),"minimatch"),uae=/^\*+([^+@!?*[(]*)$/,dae=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),fae=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),pae=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),hae=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),mae=/^\*+\.\*+$/,gae=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),yae=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),vae=/^\.\*+$/,wae=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),bae=/^\*+$/,xae=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Eae=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Sae=/^\?+([^+@!?*[(]*)?$/,kae=l(([e,t=""])=>{let n=$N([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),Aae=l(([e,t=""])=>{let n=TN([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),_ae=l(([e,t=""])=>{let n=TN([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),Iae=l(([e,t=""])=>{let n=$N([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),$N=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),TN=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),NN=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",IN={win32:{sep:"\\"},posix:{sep:"/"}},Cae=NN==="win32"?IN.win32.sep:IN.posix.sep;kn.sep=Cae;var zn=Symbol("globstar **");kn.GLOBSTAR=zn;var $ae="[^/]",Tae=$ae+"*?",Nae="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Rae="(?:(?!(?:\\/|^)\\.).)*?",Oae=l((e,t={})=>n=>kn(n,e,t),"filter");kn.filter=Oae;var Nr=l((e,t={})=>Object.assign({},e,t),"ext"),Pae=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return kn;let t=kn;return Object.assign(l((i,r,s={})=>t(i,r,Nr(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Nr(e,s))}static defaults(r){return t.defaults(Nr(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Nr(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Nr(e,s))}},unescape:l((i,r={})=>t.unescape(i,Nr(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Nr(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Nr(e,r)),"filter"),defaults:l(i=>t.defaults(Nr(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Nr(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Nr(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Nr(e,s)),"match"),sep:t.sep,GLOBSTAR:zn})},"defaults");kn.defaults=Pae;var RN=l((e,t={})=>(bu(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:bN(e,{max:t.braceExpandMax})),"braceExpand");kn.braceExpand=RN;var Dae=l((e,t={})=>new sl(e,t).makeRe(),"makeRe");kn.makeRe=Dae;var Lae=l((e,t,n={})=>{let i=new sl(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");kn.match=Lae;var CN=/[?*]|[+@!]\(.*?\)|\[|\]/,Mae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),sl=class{static{l(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){bu(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||NN,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!CN.test(s[2]))&&!CN.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i of t)for(let r=0;r<i.length;r++)i[r]==="**"&&(i[r]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let r=i;for(;n[r+1]==="**";)r++;r!==i&&n.splice(i,r-i)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let s=t[r];r===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let r=t[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(n=!0,t.splice(i-1,2),i-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let i of t){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let a=r;for(;i[a+1]==="**";)a++;a>r&&i.splice(r+1,a-r);let o=i[r+1],c=i[r+2],u=i[r+3];if(o!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,i.splice(r,1);let d=i.slice(0);d[r]="**",t.push(d),r--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(n=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(n=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let a=i[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let i=n+1;i<t.length;i++){let r=this.partsMatch(t[n],t[i],!this.preserveMultipleSlashes);if(r){t[n]=[],t[i]=r;break}}return t.filter(n=>n.length)}partsMatch(t,n,i=!1){let r=0,s=0,a=[],o="";for(;r<t.length&&s<n.length;)if(t[r]===n[s])a.push(o==="b"?n[s]:t[r]),r++,s++;else if(i&&t[r]==="**"&&n[s]===t[r+1])a.push(t[r]),r++;else if(i&&n[s]==="**"&&t[r]===n[s+1])a.push(n[s]),s++;else if(t[r]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(o==="b")return!1;o="a",a.push(t[r]),r++,s++}else if(n[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(o==="a")return!1;o="b",a.push(n[s]),r++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,i=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)n=!n,i++;i&&(this.pattern=t.slice(i)),this.negate=n}matchOne(t,n,i=!1){let r=0,s=0;if(this.isWindows){let o=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!o&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),f=c?3:o?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,g]=[t[f],n[p]];h.toLowerCase()===g.toLowerCase()&&(n[p]=h,s=p,r=f)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(zn)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(zn,s),o=n.lastIndexOf(zn),[c,u,d]=i?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,o),n.slice(o+1)];if(c.length){let k=t.slice(r,r+c.length);if(!this.#r(k,c,i,0,0))return!1;r+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+r>t.length)return!1;let k=t.length-d.length;if(this.#r(t,d,i,k,0))f=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(k--,!this.#r(t,d,i,k,0)))return!1;f=d.length+1}}if(!u.length){let k=!!f;for(let E=r;E<t.length-f;E++){let A=String(t[E]);if(k=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return i||k}let p=[[[],0]],h=p[0],g=0,y=[0];for(let k of u)k===zn?(y.push(g),h=[[],0],p.push(h)):(h[0].push(k),g++);let w=p.length-1,x=t.length-f;for(let k of p)k[1]=x-(y[w--]+k[0].length);return!!this.#n(t,p,r,0,i,0,!!f)}#n(t,n,i,r,s,a,o){let c=n[r];if(!c){for(let f=i;f<t.length;f++){o=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[u,d]=c;for(;i<=d;){if(this.#r(t.slice(0,i+u.length),u,s,i,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,i+u.length,r+1,s,a+1,o);if(h!==!1)return h}let p=t[i];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;i++}return s||null}#r(t,n,i,r,s){let a,o,c,u;for(a=r,o=s,u=t.length,c=n.length;a<u&&o<c;a++,o++){this.debug("matchOne loop");let d=n[o],f=t[a];if(this.debug(n,d,f),d===!1||d===zn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(a===u&&o===c)return!0;if(a===u)return i;if(o===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return RN(this.pattern,this.options)}parse(t){bu(t);let n=this.options;if(t==="**")return zn;if(t==="")return"";let i,r=null;(i=t.match(bae))?r=n.dot?Eae:xae:(i=t.match(uae))?r=(n.nocase?n.dot?hae:pae:n.dot?fae:dae)(i[1]):(i=t.match(Sae))?r=(n.nocase?n.dot?Aae:kae:n.dot?_ae:Iae)(i):(i=t.match(mae))?r=n.dot?yae:gae:(i=t.match(vae))&&(r=wae);let s=Ca.fromGlob(t,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?Tae:n.dot?Nae:Rae,r=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))r.add(p);return typeof f=="string"?Mae(f):f===zn?zn:f._src});u.forEach((f,p)=>{let h=u[p+1],g=u[p-1];f!==zn||g===zn||(g===void 0?h!==void 0&&h!==zn?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=g+"(?:\\/|\\/"+i+")?":h!==zn&&(u[p-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=zn))});let d=u.filter(f=>f!==zn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o of s){let c=r;if(i.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return kn.defaults(t).Minimatch}};kn.AST=Ca;kn.Minimatch=sl;kn.escape=d6;kn.unescape=Rs;import{gunzipSync as nce}from"node:zlib";var Eu=class{static{l(this,"Diff")}diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);let s=this.castInput(t,i),a=this.castInput(n,i),o=this.removeEmpty(this.tokenize(s,i)),c=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,c,i,r)}diffWithOptionsObj(t,n,i,r){var s;let a=l(k=>{if(k=this.postProcess(k,i),r){setTimeout(function(){r(k)},0);return}else return k},"done"),o=n.length,c=t.length,u=1,d=o+c;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&g+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,w=1/0,x=l(()=>{for(let k=Math.max(y,-u);k<=Math.min(w,u);k+=2){let E,A=h[k-1],S=h[k+1];A&&(h[k-1]=void 0);let _=!1;if(S){let M=S.oldPos-k;_=S&&0<=M&&M<o}let T=A&&A.oldPos+1<c;if(!_&&!T){h[k]=void 0;continue}if(!T||_&&A.oldPos<S.oldPos?E=this.addToPath(S,!0,!1,0,i):E=this.addToPath(A,!1,!0,1,i),g=this.extractCommon(E,n,t,k,i),E.oldPos+1>=c&&g+1>=o)return a(this.buildValues(E.lastComponent,n,t))||!0;h[k]=E,E.oldPos+1>=c&&(w=Math.min(w,k-1)),g+1>=o&&(y=Math.max(y,k+1))}u++},"execEditLength");if(r)l(function k(){setTimeout(function(){if(u>d||Date.now()>p)return r(void 0);x()||k()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let k=x();if(k)return k}}addToPath(t,n,i,r,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:a.count+1,added:n,removed:i,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:a}}}extractCommon(t,n,i,r,s){let a=n.length,o=i.length,c=t.oldPos,u=c-r,d=0;for(;u+1<a&&c+1<o&&this.equals(i[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){let r=[],s;for(;t;)r.push(t),s=t.previousComponent,delete t.previousComponent,t=s;r.reverse();let a=r.length,o=0,c=0,u=0;for(;o<a;o++){let d=r[o];if(d.removed)d.value=this.join(i.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){let g=i[u+h];return g.length>p.length?g:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return r}};var f6=class extends Eu{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Fae}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
770
770
|
`))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
|
|
771
771
|
`))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
|
|
772
772
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|