dsh-edge 0.5.0 → 0.5.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-edge",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-alpha.1",
4
4
  "description": "Your DeepSeek Harness, anywhere — deploy a persistent personal coding agent to Cloudflare Workers in one command",
5
5
  "author": "pawaca",
6
6
  "license": "MIT",
@@ -46,24 +46,6 @@
46
46
  "dshEdge": {
47
47
  "upstreamVersion": "0.1.1-rc.2"
48
48
  },
49
- "scripts": {
50
- "bundle:direct": "pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct",
51
- "bundle:isolated": "pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated",
52
- "bundle:workers": "pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",
53
- "dev": "pnpm run bundle:direct && node scripts/dev.mjs direct",
54
- "dev:isolated": "pnpm run bundle:isolated && node scripts/dev.mjs isolated",
55
- "dsh-edge": "node scripts/cli.mjs",
56
- "example:install": "node examples/install-keyless.mjs",
57
- "install:cloudflare": "pnpm run bundle:workers && node scripts/cli.mjs install",
58
- "legal:write": "node scripts/legal-files.mjs write",
59
- "pack:verify": "node scripts/verify-packed.mjs",
60
- "prepack": "node scripts/legal-files.mjs verify && pnpm run bundle:workers",
61
- "web:build": "pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",
62
- "test": "vitest run --root ../.. --project edge-runtime",
63
- "test:integration": "pnpm run bundle:workers && node tests/run-session-integration.mjs",
64
- "test:snapshot": "vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",
65
- "typecheck": "tsc --noEmit"
66
- },
67
49
  "dependencies": {
68
50
  "@clack/prompts": "1.7.0",
69
51
  "compare-versions": "6.1.1",
@@ -103,5 +85,22 @@
103
85
  "typescript": "^6.0.3",
104
86
  "vitest": "^4.1.8",
105
87
  "ws": "^8.21.0"
88
+ },
89
+ "scripts": {
90
+ "bundle:direct": "pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct",
91
+ "bundle:isolated": "pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated",
92
+ "bundle:workers": "pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",
93
+ "dev": "pnpm run bundle:direct && node scripts/dev.mjs direct",
94
+ "dev:isolated": "pnpm run bundle:isolated && node scripts/dev.mjs isolated",
95
+ "dsh-edge": "node scripts/cli.mjs",
96
+ "example:install": "node examples/install-keyless.mjs",
97
+ "install:cloudflare": "pnpm run bundle:workers && node scripts/cli.mjs install",
98
+ "legal:write": "node scripts/legal-files.mjs write",
99
+ "pack:verify": "node scripts/verify-packed.mjs",
100
+ "web:build": "pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",
101
+ "test": "vitest run --root ../.. --project edge-runtime",
102
+ "test:integration": "pnpm run bundle:workers && node tests/run-session-integration.mjs",
103
+ "test:snapshot": "vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",
104
+ "typecheck": "tsc --noEmit"
106
105
  }
107
- }
106
+ }
@@ -712,7 +712,7 @@ ${n}`:""}`}});function wR(e){if(e.url.trim().length===0)throw new Error("url mus
712
712
  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; }
713
713
  .secondary { background: #29314b; color: #edf2ff; }
714
714
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
715
- `}l(vP,"pageStyles");var kde="https://api.deepseek.com";var Ade="deepseek-v4-flash",Ide="high";var _de=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function Ik(e){let t=e??kde,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(Ik,"resolveEdgeBaseURL");function uf(e){if(e===void 0)return Ade;if(!_de.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(uf,"resolveEdgeModel");function _k(e){if(e===void 0)return Ide;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(_k,"resolveEdgeReasoningEffort");function $k(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($k,"resolveEdgeStreamIdleTimeoutMs");function Tk(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(Tk,"resolveEdgeMaxOutputTokens");var Ok={name:"dsh-edge",version:"0.5.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-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-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"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","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 Bg=Ok.version,wP=Ok.dshEdge.upstreamVersion;function Tde(){return"dsh-edge@0.5.0/direct"}l(Tde,"resolveEdgeDeploymentId");function Wg(e){return{baseURL:Ik(e.DEEPSEEK_BASE_URL),maxTokens:Tk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:uf(e.DEEPSEEK_MODEL),reasoningEffort:_k(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_g(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:$k(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:of(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Wg,"resolveEdgeDeploymentConfig");function Ode(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Ode,"edgeDeploymentApiKeyConfigured");function Cde(e){let t=Ik(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(Cde,"projectedEdgeBaseURL");function Ck(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:Tde(),apiKeyConfigured:Ode(e),baseURL:Cde(e.DEEPSEEK_BASE_URL),maxTokens:Tk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:uf(e.DEEPSEEK_MODEL),reasoningEffort:_k(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_g(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:$k(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:of(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Ck,"resolveEdgeDeploymentProfile");function bP(e){Wg(e);let t=Ck(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:Bg,upstreamVersion:wP,status:"ready"}}l(bP,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as VMe}from"cloudflare:workers";var Al=yy(xP());var Nk=l((e,t,r)=>{let n=e instanceof RegExp?EP(e,r):e,i=t instanceof RegExp?EP(t,r):t,s=n!==null&&i!=null&&Nde(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"),EP=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),Nde=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 SP="\0SLASH"+Math.random()+"\0",kP="\0OPEN"+Math.random()+"\0",Dk="\0CLOSE"+Math.random()+"\0",AP="\0COMMA"+Math.random()+"\0",IP="\0PERIOD"+Math.random()+"\0",Rde=new RegExp(SP,"g"),Pde=new RegExp(kP,"g"),Dde=new RegExp(Dk,"g"),Lde=new RegExp(AP,"g"),Mde=new RegExp(IP,"g"),Fde=/\\\\/g,Ude=/\\{/g,jde=/\\}/g,zde=/\\,/g,Bde=/\\\./g,Wde=1e5,qde=4e6;function Rk(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(Rk,"numeric");function Hde(e){return e.replace(Fde,SP).replace(Ude,kP).replace(jde,Dk).replace(zde,AP).replace(Bde,IP)}l(Hde,"escapeBraces");function Gde(e){return e.replace(Rde,"\\").replace(Pde,"{").replace(Dde,"}").replace(Lde,",").replace(Mde,".")}l(Gde,"unescapeBraces");function _P(e){if(!e)return[""];let t=[],r=Nk("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=_P(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(_P,"parseCommaParts");function $P(e,t={}){if(!e)return[];let{max:r=Wde,maxLength:n=qde}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Pk(Hde(e),r,n,!0).map(Gde)}l($P,"expand");function Vde(e){return"{"+e+"}"}l(Vde,"embrace");function Zde(e){return/^-?0\d/.test(e)}l(Zde,"isPadded");function Kde(e,t){return e<=t}l(Kde,"lte");function Yde(e,t){return e>=t}l(Yde,"gte");function df(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(df,"combine");function Xde(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=Rk(i[0]),a=Rk(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Rk(i[2])),1):1,d=Kde;a<o&&(u*=-1,d=Yde);let p=i.some(Zde),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 x=new Array(y+1).join("0");m<0?g="-"+x+g.slice(1):g=x+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(Xde,"expandSequence");function Pk(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=Nk("{","}",e);if(!a)return df(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=df(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+Dk+a.post,n=!0;continue}return df(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!f,o=!1);let h;if(f)h=Xde(a.body,d,t,r);else{let m=_P(a.body);if(m.length===1&&m[0]!==void 0&&(m=Pk(m[0],t,r,!1).map(Vde),m.length===1)){if(i=df(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 x=0;g&&x<i.length;x++)i[x]&&(g=!1);h=[];let y=0;e:for(let x=0;x<m.length;x++){let w=Pk(m[x],t,r,!1);for(let b=0;b<w.length;b++){let k=w[b];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=df(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(Pk,"expand_");var ff=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Jde={"[: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]},pf=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Qde=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),TP=l(e=>e.join(""),"rangesToString"),OP=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,[x,w,b]]of Object.entries(Jde))if(e.startsWith(y,s)){if(f)return["$.",!1,e.length-r,!0];s+=y.length,b?i.push(x):n.push(x),a=a||w;continue e}}if(c=!1,f){g>f?n.push(pf(f)+"-"+pf(g)):g===f&&n.push(pf(g)),f="",s++;continue}if(e.startsWith("-]",s+1)){n.push(pf(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=g,s+=2;continue}n.push(pf(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[Qde(g),!1,d-r,!1]}let p="["+(u?"^":"")+TP(n)+"]",h="["+(u?"":"^")+TP(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,a,d-r,!0]},"parseClass");var Zo=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 Hn,efe=new Set(["!","?","+","*","@"]),Lk=l(e=>efe.has(e),"isExtglobType"),CP=l(e=>Lk(e.type),"isExtglobAST"),tfe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),rfe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),nfe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),NP=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ife="(?!(?:^|/)\\.\\.?(?:$|/))",Hg="(?!\\.)",sfe=new Set(["[","."]),ofe=new Set(["..","."]),afe=new Set("().*{}+?[]^$\\!"),lfe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Mk="[^/]",RP=Mk+"*?",PP=Mk+"+?",cfe=0,Za=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++cfe;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 Hn&&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 Hn&&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 Hn(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 x=t.charAt(g++);if(a||x==="\\"){a=!a,y+=x;continue}if(c){g===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(g===u+2&&d)&&(c=!1),y+=x;continue}else if(x==="["){c=!0,u=g,d=!1,y+=x;continue}if(!i.noext&&Lk(x)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let b=new Hn(x,r);g=Hn.#h(t,b,g,i,s+1),r.push(b);continue}y+=x}return r.push(y),g}let f=n+1,p=new Hn(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&&Lk(g)&&t.charAt(f)==="("&&(s<=o||r&&r.#g(g))){let x=r&&r.#g(g)?0:1;p.push(m),m="";let w=new Hn(g,p);p.push(w),f=Hn.#h(t,w,f,i,s+x);continue}if(g==="|"){p.push(m),m="",h.push(p),p=new Hn(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}#O(t){return this.#m(t,rfe)}#m(t,r=tfe){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=nfe){return!!r.get(this.type)?.includes(t)}#f(t,r){let n=t.#t[0],i=new Hn(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!!NP.get(this.type)?.has(t)}#C(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=NP.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 Hn(null,void 0,r);return Hn.#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()),!CP(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,x]=typeof h=="string"?Hn.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||x,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ofe.has(this.#t[0]))){let m=sfe,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?ife:y?Hg:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Zo(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,Zo(this.toString()),!1,!1]}let o=!n||t||r||!Hg?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Hg:"")+PP;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Hg:"")+RP+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Zo(s),this.#r=!!this.#r,this.#n]}#p(){if(CP(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.#O(i)?(r=!1,this.#f(i,n)):this.#C(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+=(afe.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?PP:RP,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,f,p,h]=OP(t,c);if(p){s+=d,o=o||f,c+=p-1,r=r||h;continue}}if(u==="?"){s+=Mk,r=!0;continue}s+=lfe(u)}return[s,Zo(t),!!r,o]}};Hn=Za;var Fk=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 Xr=l((e,t,r={})=>(ff(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Tc(t,r).match(e)),"minimatch"),ufe=/^\*+([^+@!?*[(]*)$/,dfe=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),ffe=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),pfe=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),hfe=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),mfe=/^\*+\.\*+$/,gfe=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),yfe=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),vfe=/^\.\*+$/,wfe=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),bfe=/^\*+$/,xfe=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Efe=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Sfe=/^\?+([^+@!?*[(]*)?$/,kfe=l(([e,t=""])=>{let r=MP([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Afe=l(([e,t=""])=>{let r=FP([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),Ife=l(([e,t=""])=>{let r=FP([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),_fe=l(([e,t=""])=>{let r=MP([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),MP=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),FP=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),UP=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",DP={win32:{sep:"\\"},posix:{sep:"/"}},$fe=UP==="win32"?DP.win32.sep:DP.posix.sep;Xr.sep=$fe;var wn=Symbol("globstar **");Xr.GLOBSTAR=wn;var Tfe="[^/]",Ofe=Tfe+"*?",Cfe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Nfe="(?:(?!(?:\\/|^)\\.).)*?",Rfe=l((e,t={})=>r=>Xr(r,e,t),"filter");Xr.filter=Rfe;var bi=l((e,t={})=>Object.assign({},e,t),"ext"),Pfe=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Xr;let t=Xr;return Object.assign(l((n,i,s={})=>t(n,i,bi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,bi(e,s))}static defaults(i){return t.defaults(bi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,bi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,bi(e,s))}},unescape:l((n,i={})=>t.unescape(n,bi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,bi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,bi(e,i)),"filter"),defaults:l(n=>t.defaults(bi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,bi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,bi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,bi(e,s)),"match"),sep:t.sep,GLOBSTAR:wn})},"defaults");Xr.defaults=Pfe;var jP=l((e,t={})=>(ff(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:$P(e,{max:t.braceExpandMax})),"braceExpand");Xr.braceExpand=jP;var Dfe=l((e,t={})=>new Tc(e,t).makeRe(),"makeRe");Xr.makeRe=Dfe;var Lfe=l((e,t,r={})=>{let n=new Tc(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Xr.match=Lfe;var LP=/[?*]|[+@!]\(.*?\)|\[|\]/,Mfe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Tc=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={}){ff(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||UP,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]==="?"||!LP.test(s[2]))&&!LP.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(wn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(wn,s),a=r.lastIndexOf(wn),[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 b=i;b<t.length-f;b++){let k=String(t[b]);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===wn?(g.push(m),h=[[],0],p.push(h)):(h[0].push(w),m++);let y=p.length-1,x=t.length-f;for(let w of p)w[1]=x-(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===wn)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 jP(this.pattern,this.options)}parse(t){ff(t);let r=this.options;if(t==="**")return wn;if(t==="")return"";let n,i=null;(n=t.match(bfe))?i=r.dot?Efe:xfe:(n=t.match(ufe))?i=(r.nocase?r.dot?hfe:pfe:r.dot?ffe:dfe)(n[1]):(n=t.match(Sfe))?i=(r.nocase?r.dot?Afe:kfe:r.dot?Ife:_fe)(n):(n=t.match(mfe))?i=r.dot?yfe:gfe:(n=t.match(vfe))&&(i=wfe);let s=Za.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?Ofe:r.dot?Cfe:Nfe,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"?Mfe(f):f===wn?wn:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==wn||m===wn||(m===void 0?h!==void 0&&h!==wn?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=m+"(?:\\/|\\/"+n+")?":h!==wn&&(u[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=wn))});let d=u.filter(f=>f!==wn);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 Xr.defaults(t).Minimatch}};Xr.AST=Za;Xr.Minimatch=Tc;Xr.escape=Fk;Xr.unescape=Zo;import{gunzipSync as Mhe}from"node:zlib";var hf=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,x=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let b,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let O=S.oldPos-w;A=S&&0<=O&&O<a}let I=k&&k.oldPos+1<c;if(!A&&!I){h[w]=void 0;continue}if(!I||A&&k.oldPos<S.oldPos?b=this.addToPath(S,!0,!1,0,n):b=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(b,r,t,w,n),b.oldPos+1>=c&&m+1>=a)return o(this.buildValues(b.lastComponent,r,t))||!0;h[w]=b,b.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);x()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let w=x();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 Uk=class extends hf{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Ufe}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
715
+ `}l(vP,"pageStyles");var kde="https://api.deepseek.com";var Ade="deepseek-v4-flash",Ide="high";var _de=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function Ik(e){let t=e??kde,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(Ik,"resolveEdgeBaseURL");function uf(e){if(e===void 0)return Ade;if(!_de.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(uf,"resolveEdgeModel");function _k(e){if(e===void 0)return Ide;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(_k,"resolveEdgeReasoningEffort");function $k(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($k,"resolveEdgeStreamIdleTimeoutMs");function Tk(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(Tk,"resolveEdgeMaxOutputTokens");var Ok={name:"dsh-edge",version:"0.5.1-alpha.1",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-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-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"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","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 Bg=Ok.version,wP=Ok.dshEdge.upstreamVersion;function Tde(){return"dsh-edge@0.5.1-alpha.1/direct"}l(Tde,"resolveEdgeDeploymentId");function Wg(e){return{baseURL:Ik(e.DEEPSEEK_BASE_URL),maxTokens:Tk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:uf(e.DEEPSEEK_MODEL),reasoningEffort:_k(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_g(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:$k(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:of(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Wg,"resolveEdgeDeploymentConfig");function Ode(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Ode,"edgeDeploymentApiKeyConfigured");function Cde(e){let t=Ik(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(Cde,"projectedEdgeBaseURL");function Ck(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:Tde(),apiKeyConfigured:Ode(e),baseURL:Cde(e.DEEPSEEK_BASE_URL),maxTokens:Tk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:uf(e.DEEPSEEK_MODEL),reasoningEffort:_k(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_g(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:$k(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:of(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Ck,"resolveEdgeDeploymentProfile");function bP(e){Wg(e);let t=Ck(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:Bg,upstreamVersion:wP,status:"ready"}}l(bP,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as VMe}from"cloudflare:workers";var Al=yy(xP(),1);var Nk=l((e,t,r)=>{let n=e instanceof RegExp?EP(e,r):e,i=t instanceof RegExp?EP(t,r):t,s=n!==null&&i!=null&&Nde(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"),EP=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),Nde=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 SP="\0SLASH"+Math.random()+"\0",kP="\0OPEN"+Math.random()+"\0",Dk="\0CLOSE"+Math.random()+"\0",AP="\0COMMA"+Math.random()+"\0",IP="\0PERIOD"+Math.random()+"\0",Rde=new RegExp(SP,"g"),Pde=new RegExp(kP,"g"),Dde=new RegExp(Dk,"g"),Lde=new RegExp(AP,"g"),Mde=new RegExp(IP,"g"),Fde=/\\\\/g,Ude=/\\{/g,jde=/\\}/g,zde=/\\,/g,Bde=/\\\./g,Wde=1e5,qde=4e6;function Rk(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(Rk,"numeric");function Hde(e){return e.replace(Fde,SP).replace(Ude,kP).replace(jde,Dk).replace(zde,AP).replace(Bde,IP)}l(Hde,"escapeBraces");function Gde(e){return e.replace(Rde,"\\").replace(Pde,"{").replace(Dde,"}").replace(Lde,",").replace(Mde,".")}l(Gde,"unescapeBraces");function _P(e){if(!e)return[""];let t=[],r=Nk("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=_P(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(_P,"parseCommaParts");function $P(e,t={}){if(!e)return[];let{max:r=Wde,maxLength:n=qde}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Pk(Hde(e),r,n,!0).map(Gde)}l($P,"expand");function Vde(e){return"{"+e+"}"}l(Vde,"embrace");function Zde(e){return/^-?0\d/.test(e)}l(Zde,"isPadded");function Kde(e,t){return e<=t}l(Kde,"lte");function Yde(e,t){return e>=t}l(Yde,"gte");function df(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(df,"combine");function Xde(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=Rk(i[0]),a=Rk(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(Rk(i[2])),1):1,d=Kde;a<o&&(u*=-1,d=Yde);let p=i.some(Zde),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 x=new Array(y+1).join("0");m<0?g="-"+x+g.slice(1):g=x+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(Xde,"expandSequence");function Pk(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=Nk("{","}",e);if(!a)return df(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=df(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+Dk+a.post,n=!0;continue}return df(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!f,o=!1);let h;if(f)h=Xde(a.body,d,t,r);else{let m=_P(a.body);if(m.length===1&&m[0]!==void 0&&(m=Pk(m[0],t,r,!1).map(Vde),m.length===1)){if(i=df(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 x=0;g&&x<i.length;x++)i[x]&&(g=!1);h=[];let y=0;e:for(let x=0;x<m.length;x++){let w=Pk(m[x],t,r,!1);for(let b=0;b<w.length;b++){let k=w[b];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=df(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(Pk,"expand_");var ff=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Jde={"[: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]},pf=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Qde=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),TP=l(e=>e.join(""),"rangesToString"),OP=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,[x,w,b]]of Object.entries(Jde))if(e.startsWith(y,s)){if(f)return["$.",!1,e.length-r,!0];s+=y.length,b?i.push(x):n.push(x),a=a||w;continue e}}if(c=!1,f){g>f?n.push(pf(f)+"-"+pf(g)):g===f&&n.push(pf(g)),f="",s++;continue}if(e.startsWith("-]",s+1)){n.push(pf(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=g,s+=2;continue}n.push(pf(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[Qde(g),!1,d-r,!1]}let p="["+(u?"^":"")+TP(n)+"]",h="["+(u?"":"^")+TP(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,a,d-r,!0]},"parseClass");var Zo=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 Hn,efe=new Set(["!","?","+","*","@"]),Lk=l(e=>efe.has(e),"isExtglobType"),CP=l(e=>Lk(e.type),"isExtglobAST"),tfe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),rfe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),nfe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),NP=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ife="(?!(?:^|/)\\.\\.?(?:$|/))",Hg="(?!\\.)",sfe=new Set(["[","."]),ofe=new Set(["..","."]),afe=new Set("().*{}+?[]^$\\!"),lfe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Mk="[^/]",RP=Mk+"*?",PP=Mk+"+?",cfe=0,Za=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++cfe;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 Hn&&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 Hn&&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 Hn(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 x=t.charAt(g++);if(a||x==="\\"){a=!a,y+=x;continue}if(c){g===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(g===u+2&&d)&&(c=!1),y+=x;continue}else if(x==="["){c=!0,u=g,d=!1,y+=x;continue}if(!i.noext&&Lk(x)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let b=new Hn(x,r);g=Hn.#h(t,b,g,i,s+1),r.push(b);continue}y+=x}return r.push(y),g}let f=n+1,p=new Hn(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&&Lk(g)&&t.charAt(f)==="("&&(s<=o||r&&r.#g(g))){let x=r&&r.#g(g)?0:1;p.push(m),m="";let w=new Hn(g,p);p.push(w),f=Hn.#h(t,w,f,i,s+x);continue}if(g==="|"){p.push(m),m="",h.push(p),p=new Hn(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}#O(t){return this.#m(t,rfe)}#m(t,r=tfe){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=nfe){return!!r.get(this.type)?.includes(t)}#f(t,r){let n=t.#t[0],i=new Hn(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!!NP.get(this.type)?.has(t)}#C(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=NP.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 Hn(null,void 0,r);return Hn.#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()),!CP(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,x]=typeof h=="string"?Hn.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||x,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&ofe.has(this.#t[0]))){let m=sfe,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?ife:y?Hg:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Zo(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,Zo(this.toString()),!1,!1]}let o=!n||t||r||!Hg?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Hg:"")+PP;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Hg:"")+RP+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Zo(s),this.#r=!!this.#r,this.#n]}#p(){if(CP(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.#O(i)?(r=!1,this.#f(i,n)):this.#C(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+=(afe.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?PP:RP,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,f,p,h]=OP(t,c);if(p){s+=d,o=o||f,c+=p-1,r=r||h;continue}}if(u==="?"){s+=Mk,r=!0;continue}s+=lfe(u)}return[s,Zo(t),!!r,o]}};Hn=Za;var Fk=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 Xr=l((e,t,r={})=>(ff(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Tc(t,r).match(e)),"minimatch"),ufe=/^\*+([^+@!?*[(]*)$/,dfe=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),ffe=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),pfe=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),hfe=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),mfe=/^\*+\.\*+$/,gfe=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),yfe=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),vfe=/^\.\*+$/,wfe=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),bfe=/^\*+$/,xfe=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Efe=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Sfe=/^\?+([^+@!?*[(]*)?$/,kfe=l(([e,t=""])=>{let r=MP([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Afe=l(([e,t=""])=>{let r=FP([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),Ife=l(([e,t=""])=>{let r=FP([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),_fe=l(([e,t=""])=>{let r=MP([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),MP=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),FP=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),UP=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",DP={win32:{sep:"\\"},posix:{sep:"/"}},$fe=UP==="win32"?DP.win32.sep:DP.posix.sep;Xr.sep=$fe;var wn=Symbol("globstar **");Xr.GLOBSTAR=wn;var Tfe="[^/]",Ofe=Tfe+"*?",Cfe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Nfe="(?:(?!(?:\\/|^)\\.).)*?",Rfe=l((e,t={})=>r=>Xr(r,e,t),"filter");Xr.filter=Rfe;var bi=l((e,t={})=>Object.assign({},e,t),"ext"),Pfe=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Xr;let t=Xr;return Object.assign(l((n,i,s={})=>t(n,i,bi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,bi(e,s))}static defaults(i){return t.defaults(bi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,bi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,bi(e,s))}},unescape:l((n,i={})=>t.unescape(n,bi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,bi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,bi(e,i)),"filter"),defaults:l(n=>t.defaults(bi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,bi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,bi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,bi(e,s)),"match"),sep:t.sep,GLOBSTAR:wn})},"defaults");Xr.defaults=Pfe;var jP=l((e,t={})=>(ff(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:$P(e,{max:t.braceExpandMax})),"braceExpand");Xr.braceExpand=jP;var Dfe=l((e,t={})=>new Tc(e,t).makeRe(),"makeRe");Xr.makeRe=Dfe;var Lfe=l((e,t,r={})=>{let n=new Tc(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Xr.match=Lfe;var LP=/[?*]|[+@!]\(.*?\)|\[|\]/,Mfe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Tc=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={}){ff(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||UP,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]==="?"||!LP.test(s[2]))&&!LP.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(wn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(wn,s),a=r.lastIndexOf(wn),[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 b=i;b<t.length-f;b++){let k=String(t[b]);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===wn?(g.push(m),h=[[],0],p.push(h)):(h[0].push(w),m++);let y=p.length-1,x=t.length-f;for(let w of p)w[1]=x-(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===wn)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 jP(this.pattern,this.options)}parse(t){ff(t);let r=this.options;if(t==="**")return wn;if(t==="")return"";let n,i=null;(n=t.match(bfe))?i=r.dot?Efe:xfe:(n=t.match(ufe))?i=(r.nocase?r.dot?hfe:pfe:r.dot?ffe:dfe)(n[1]):(n=t.match(Sfe))?i=(r.nocase?r.dot?Afe:kfe:r.dot?Ife:_fe)(n):(n=t.match(mfe))?i=r.dot?yfe:gfe:(n=t.match(vfe))&&(i=wfe);let s=Za.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?Ofe:r.dot?Cfe:Nfe,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"?Mfe(f):f===wn?wn:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==wn||m===wn||(m===void 0?h!==void 0&&h!==wn?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=m+"(?:\\/|\\/"+n+")?":h!==wn&&(u[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=wn))});let d=u.filter(f=>f!==wn);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 Xr.defaults(t).Minimatch}};Xr.AST=Za;Xr.Minimatch=Tc;Xr.escape=Fk;Xr.unescape=Zo;import{gunzipSync as Mhe}from"node:zlib";var hf=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,x=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let b,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let O=S.oldPos-w;A=S&&0<=O&&O<a}let I=k&&k.oldPos+1<c;if(!A&&!I){h[w]=void 0;continue}if(!I||A&&k.oldPos<S.oldPos?b=this.addToPath(S,!0,!1,0,n):b=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(b,r,t,w,n),b.oldPos+1>=c&&m+1>=a)return o(this.buildValues(b.lastComponent,r,t))||!0;h[w]=b,b.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);x()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let w=x();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 Uk=class extends hf{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Ufe}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
716
716
  `))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
717
717
  `))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
718
718
  `)&&(t=t.slice(0,-1)),r.endsWith(`
@@ -712,7 +712,7 @@ ${i}`:""}`}});function y$(e){if(e.url.trim().length===0)throw new Error("url mus
712
712
  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; }
713
713
  .secondary { background: #29314b; color: #edf2ff; }
714
714
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
715
- `}l(gC,"pageStyles");var Yte="https://api.deepseek.com";var ene="deepseek-v4-flash",tne="high";var nne=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function lx(e){let t=e??Yte,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(lx,"resolveEdgeBaseURL");function eu(e){if(e===void 0)return ene;if(!nne.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(eu,"resolveEdgeModel");function cx(e){if(e===void 0)return tne;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(cx,"resolveEdgeReasoningEffort");function ux(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(ux,"resolveEdgeStreamIdleTimeoutMs");function dx(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(dx,"resolveEdgeMaxOutputTokens");var fx={name:"dsh-edge",version:"0.5.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-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-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"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","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 ph=fx.version,yC=fx.dshEdge.upstreamVersion;function ine(){return"dsh-edge@0.5.0/isolated"}l(ine,"resolveEdgeDeploymentId");function hh(e){return{baseURL:lx(e.DEEPSEEK_BASE_URL),maxTokens:dx(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:eu(e.DEEPSEEK_MODEL),reasoningEffort:cx(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Jp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:ux(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Xc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(hh,"resolveEdgeDeploymentConfig");function sne(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(sne,"edgeDeploymentApiKeyConfigured");function ane(e){let t=lx(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(ane,"projectedEdgeBaseURL");function px(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:ine(),apiKeyConfigured:sne(e),baseURL:ane(e.DEEPSEEK_BASE_URL),maxTokens:dx(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:eu(e.DEEPSEEK_MODEL),reasoningEffort:cx(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Jp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:ux(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Xc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(px,"resolveEdgeDeploymentProfile");function wC(e){hh(e);let t=px(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:ph,upstreamVersion:yC,status:"ready"}}l(wC,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Zke}from"cloudflare:workers";var Fa=Jm(vC(),1);var hx=l((e,t,n)=>{let i=e instanceof RegExp?bC(e,n):e,r=t instanceof RegExp?bC(t,n):t,s=i!==null&&r!=null&&one(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"),bC=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),one=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 xC="\0SLASH"+Math.random()+"\0",EC="\0OPEN"+Math.random()+"\0",yx="\0CLOSE"+Math.random()+"\0",SC="\0COMMA"+Math.random()+"\0",kC="\0PERIOD"+Math.random()+"\0",lne=new RegExp(xC,"g"),cne=new RegExp(EC,"g"),une=new RegExp(yx,"g"),dne=new RegExp(SC,"g"),fne=new RegExp(kC,"g"),pne=/\\\\/g,hne=/\\{/g,mne=/\\}/g,gne=/\\,/g,yne=/\\\./g,wne=1e5,vne=4e6;function mx(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(mx,"numeric");function bne(e){return e.replace(pne,xC).replace(hne,EC).replace(mne,yx).replace(gne,SC).replace(yne,kC)}l(bne,"escapeBraces");function xne(e){return e.replace(lne,"\\").replace(cne,"{").replace(une,"}").replace(dne,",").replace(fne,".")}l(xne,"unescapeBraces");function AC(e){if(!e)return[""];let t=[],n=hx("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=AC(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(AC,"parseCommaParts");function _C(e,t={}){if(!e)return[];let{max:n=wne,maxLength:i=vne}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),gx(bne(e),n,i,!0).map(xne)}l(_C,"expand");function Ene(e){return"{"+e+"}"}l(Ene,"embrace");function Sne(e){return/^-?0\d/.test(e)}l(Sne,"isPadded");function kne(e,t){return e<=t}l(kne,"lte");function Ane(e,t){return e>=t}l(Ane,"gte");function tu(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(tu,"combine");function _ne(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=mx(r[0]),o=mx(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(mx(r[2])),1):1,d=kne;o<a&&(u*=-1,d=Ane);let p=r.some(Sne),h=0;for(let m=a;d(m,o)&&s.length<n;m+=u){let y;if(t)y=String.fromCharCode(m),y==="\\"&&(y="");else if(y=String(m),p){let v=c-y.length;if(v>0){let E=new Array(v+1).join("0");m<0?y="-"+E+y.slice(1):y=E+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(_ne,"expandSequence");function gx(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=hx("{","}",e);if(!o)return tu(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=tu(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+yx+o.post,i=!0;continue}return tu(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=_ne(o.body,d,t,n);else{let m=AC(o.body);if(m.length===1&&m[0]!==void 0&&(m=gx(m[0],t,n,!1).map(Ene),m.length===1)){if(r=tu(r,c+m[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let E=0;y&&E<r.length;E++)r[E]&&(y=!1);h=[];let v=0;e:for(let E=0;E<m.length;E++){let k=gx(m[E],t,n,!1);for(let x=0;x<k.length;x++){let A=k[x];if(!(y&&!A)){if(h.length>=t||v+A.length>n)break e;h.push(A),v+=A.length}}}}if(r=tu(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(gx,"expand_");var nu=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Ine={"[: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]},ru=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),$ne=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),IC=l(e=>e.join(""),"rangesToString"),$C=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[v,[E,k,x]]of Object.entries(Ine))if(e.startsWith(v,s)){if(f)return["$.",!1,e.length-n,!0];s+=v.length,x?r.push(E):i.push(E),o=o||k;continue e}}if(c=!1,f){y>f?i.push(ru(f)+"-"+ru(y)):y===f&&i.push(ru(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(ru(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(ru(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[$ne(y),!1,d-n,!1]}let p="["+(u?"^":"")+IC(i)+"]",h="["+(u?"":"^")+IC(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var $s=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 ur,Cne=new Set(["!","?","+","*","@"]),wx=l(e=>Cne.has(e),"isExtglobType"),CC=l(e=>wx(e.type),"isExtglobAST"),Tne=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Nne=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Rne=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),TC=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),One="(?!(?:^|/)\\.\\.?(?:$|/))",gh="(?!\\.)",Pne=new Set(["[","."]),Dne=new Set(["..","."]),Lne=new Set("().*{}+?[]^$\\!"),Mne=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),vx="[^/]",NC=vx+"*?",RC=vx+"+?",jne=0,Ea=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++jne;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 ur&&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 ur&&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 ur(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,v="";for(;y<t.length;){let E=t.charAt(y++);if(o||E==="\\"){o=!o,v+=E;continue}if(c){y===u+1?(E==="^"||E==="!")&&(d=!0):E==="]"&&!(y===u+2&&d)&&(c=!1),v+=E;continue}else if(E==="["){c=!0,u=y,d=!1,v+=E;continue}if(!r.noext&&wx(E)&&t.charAt(y)==="("&&s<=a){n.push(v),v="";let x=new ur(E,n);y=ur.#h(t,x,y,r,s+1),n.push(x);continue}v+=E}return n.push(v),y}let f=i+1,p=new ur(null,n),h=[],m="";for(;f<t.length;){let y=t.charAt(f++);if(o||y==="\\"){o=!o,m+=y;continue}if(c){f===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(f===u+2&&d)&&(c=!1),m+=y;continue}else if(y==="["){c=!0,u=f,d=!1,m+=y;continue}if(!r.noext&&wx(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let E=n&&n.#g(y)?0:1;p.push(m),m="";let k=new ur(y,p);p.push(k),f=ur.#h(t,k,f,r,s+E);continue}if(y==="|"){p.push(m),m="",h.push(p),p=new ur(null,n);continue}if(y===")")return m===""&&n.#t.length===0&&(n.#c=!0),p.push(m),m="",n.push(...h,p),f;m+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#T(t){return this.#m(t,Nne)}#m(t,n=Tne){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=Rne){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new ur(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!!TC.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=TC.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 ur(null,void 0,n);return ur.#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()),!CC(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,y,v,E]=typeof h=="string"?ur.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||E,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Dne.has(this.#t[0]))){let m=Pne,y=n&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),v=!n&&!t&&m.has(u.charAt(0));d=y?One:v?gh:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,$s(u),this.#n=!!this.#n,this.#r]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#w(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,$s(this.toString()),!1,!1]}let a=!i||t||n||!gh?"":this.#w(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?gh:"")+RC;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?gh:"")+NC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,$s(s),this.#n=!!this.#n,this.#r]}#p(){if(CC(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}#w(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+=(Lne.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?RC:NC,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=$C(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=vx,n=!0;continue}s+=Mne(u)}return[s,$s(t),!!n,a]}};ur=Ea;var bx=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 En=l((e,t,n={})=>(nu(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Ho(t,n).match(e)),"minimatch"),Fne=/^\*+([^+@!?*[(]*)$/,Une=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),zne=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),Bne=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Wne=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),qne=/^\*+\.\*+$/,Hne=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Gne=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Vne=/^\.\*+$/,Zne=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Kne=/^\*+$/,Xne=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Qne=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Jne=/^\?+([^+@!?*[(]*)?$/,Yne=l(([e,t=""])=>{let n=DC([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),ere=l(([e,t=""])=>{let n=LC([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),tre=l(([e,t=""])=>{let n=LC([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),nre=l(([e,t=""])=>{let n=DC([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),DC=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),LC=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),MC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",OC={win32:{sep:"\\"},posix:{sep:"/"}},rre=MC==="win32"?OC.win32.sep:OC.posix.sep;En.sep=rre;var Un=Symbol("globstar **");En.GLOBSTAR=Un;var ire="[^/]",sre=ire+"*?",are="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ore="(?:(?!(?:\\/|^)\\.).)*?",lre=l((e,t={})=>n=>En(n,e,t),"filter");En.filter=lre;var Tr=l((e,t={})=>Object.assign({},e,t),"ext"),cre=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return En;let t=En;return Object.assign(l((i,r,s={})=>t(i,r,Tr(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Tr(e,s))}static defaults(r){return t.defaults(Tr(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Tr(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Tr(e,s))}},unescape:l((i,r={})=>t.unescape(i,Tr(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Tr(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Tr(e,r)),"filter"),defaults:l(i=>t.defaults(Tr(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Tr(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Tr(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Tr(e,s)),"match"),sep:t.sep,GLOBSTAR:Un})},"defaults");En.defaults=cre;var jC=l((e,t={})=>(nu(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:_C(e,{max:t.braceExpandMax})),"braceExpand");En.braceExpand=jC;var ure=l((e,t={})=>new Ho(e,t).makeRe(),"makeRe");En.makeRe=ure;var dre=l((e,t,n={})=>{let i=new Ho(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");En.match=dre;var PC=/[?*]|[+@!]\(.*?\)|\[|\]/,fre=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Ho=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={}){nu(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||MC,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]==="?"||!PC.test(s[2]))&&!PC.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,m]=[t[f],n[p]];h.toLowerCase()===m.toLowerCase()&&(n[p]=h,s=p,r=f)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Un)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(Un,s),o=n.lastIndexOf(Un),[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 x=r;x<t.length-f;x++){let A=String(t[x]);if(k=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return i||k}let p=[[[],0]],h=p[0],m=0,y=[0];for(let k of u)k===Un?(y.push(m),h=[[],0],p.push(h)):(h[0].push(k),m++);let v=p.length-1,E=t.length-f;for(let k of p)k[1]=E-(y[v--]+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===Un)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 jC(this.pattern,this.options)}parse(t){nu(t);let n=this.options;if(t==="**")return Un;if(t==="")return"";let i,r=null;(i=t.match(Kne))?r=n.dot?Qne:Xne:(i=t.match(Fne))?r=(n.nocase?n.dot?Wne:Bne:n.dot?zne:Une)(i[1]):(i=t.match(Jne))?r=(n.nocase?n.dot?ere:Yne:n.dot?tre:nre)(i):(i=t.match(qne))?r=n.dot?Gne:Hne:(i=t.match(Vne))&&(r=Zne);let s=Ea.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?sre:n.dot?are:ore,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"?fre(f):f===Un?Un:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==Un||m===Un||(m===void 0?h!==void 0&&h!==Un?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=m+"(?:\\/|\\/"+i+")?":h!==Un&&(u[p-1]=m+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=Un))});let d=u.filter(f=>f!==Un);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 En.defaults(t).Minimatch}};En.AST=Ea;En.Minimatch=Ho;En.escape=bx;En.unescape=$s;import{gunzipSync as Nse}from"node:zlib";var iu=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}],m=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&m+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,v=1/0,E=l(()=>{for(let k=Math.max(y,-u);k<=Math.min(v,u);k+=2){let x,A=h[k-1],S=h[k+1];A&&(h[k-1]=void 0);let _=!1;if(S){let L=S.oldPos-k;_=S&&0<=L&&L<o}let T=A&&A.oldPos+1<c;if(!_&&!T){h[k]=void 0;continue}if(!T||_&&A.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,i):x=this.addToPath(A,!1,!0,1,i),m=this.extractCommon(x,n,t,k,i),x.oldPos+1>=c&&m+1>=o)return a(this.buildValues(x.lastComponent,n,t))||!0;h[k]=x,x.oldPos+1>=c&&(v=Math.min(v,k-1)),m+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);E()||k()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let k=E();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 m=i[u+h];return m.length>p.length?m: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 xx=class extends iu{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=hre}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
715
+ `}l(gC,"pageStyles");var Yte="https://api.deepseek.com";var ene="deepseek-v4-flash",tne="high";var nne=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function lx(e){let t=e??Yte,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(lx,"resolveEdgeBaseURL");function eu(e){if(e===void 0)return ene;if(!nne.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(eu,"resolveEdgeModel");function cx(e){if(e===void 0)return tne;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(cx,"resolveEdgeReasoningEffort");function ux(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(ux,"resolveEdgeStreamIdleTimeoutMs");function dx(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(dx,"resolveEdgeMaxOutputTokens");var fx={name:"dsh-edge",version:"0.5.1-alpha.1",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-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-query":"0.1.1-rc.2","@deepseek-ai/dsh-session-title":"0.1.1-rc.2","@deepseek-ai/dsh-settings":"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","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 ph=fx.version,yC=fx.dshEdge.upstreamVersion;function ine(){return"dsh-edge@0.5.1-alpha.1/isolated"}l(ine,"resolveEdgeDeploymentId");function hh(e){return{baseURL:lx(e.DEEPSEEK_BASE_URL),maxTokens:dx(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:eu(e.DEEPSEEK_MODEL),reasoningEffort:cx(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Jp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:ux(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Xc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(hh,"resolveEdgeDeploymentConfig");function sne(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(sne,"edgeDeploymentApiKeyConfigured");function ane(e){let t=lx(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(ane,"projectedEdgeBaseURL");function px(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:ine(),apiKeyConfigured:sne(e),baseURL:ane(e.DEEPSEEK_BASE_URL),maxTokens:dx(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:eu(e.DEEPSEEK_MODEL),reasoningEffort:cx(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Jp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:ux(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Xc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(px,"resolveEdgeDeploymentProfile");function wC(e){hh(e);let t=px(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:ph,upstreamVersion:yC,status:"ready"}}l(wC,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Zke}from"cloudflare:workers";var Fa=Jm(vC(),1);var hx=l((e,t,n)=>{let i=e instanceof RegExp?bC(e,n):e,r=t instanceof RegExp?bC(t,n):t,s=i!==null&&r!=null&&one(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"),bC=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),one=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 xC="\0SLASH"+Math.random()+"\0",EC="\0OPEN"+Math.random()+"\0",yx="\0CLOSE"+Math.random()+"\0",SC="\0COMMA"+Math.random()+"\0",kC="\0PERIOD"+Math.random()+"\0",lne=new RegExp(xC,"g"),cne=new RegExp(EC,"g"),une=new RegExp(yx,"g"),dne=new RegExp(SC,"g"),fne=new RegExp(kC,"g"),pne=/\\\\/g,hne=/\\{/g,mne=/\\}/g,gne=/\\,/g,yne=/\\\./g,wne=1e5,vne=4e6;function mx(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(mx,"numeric");function bne(e){return e.replace(pne,xC).replace(hne,EC).replace(mne,yx).replace(gne,SC).replace(yne,kC)}l(bne,"escapeBraces");function xne(e){return e.replace(lne,"\\").replace(cne,"{").replace(une,"}").replace(dne,",").replace(fne,".")}l(xne,"unescapeBraces");function AC(e){if(!e)return[""];let t=[],n=hx("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=AC(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(AC,"parseCommaParts");function _C(e,t={}){if(!e)return[];let{max:n=wne,maxLength:i=vne}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),gx(bne(e),n,i,!0).map(xne)}l(_C,"expand");function Ene(e){return"{"+e+"}"}l(Ene,"embrace");function Sne(e){return/^-?0\d/.test(e)}l(Sne,"isPadded");function kne(e,t){return e<=t}l(kne,"lte");function Ane(e,t){return e>=t}l(Ane,"gte");function tu(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(tu,"combine");function _ne(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=mx(r[0]),o=mx(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(mx(r[2])),1):1,d=kne;o<a&&(u*=-1,d=Ane);let p=r.some(Sne),h=0;for(let m=a;d(m,o)&&s.length<n;m+=u){let y;if(t)y=String.fromCharCode(m),y==="\\"&&(y="");else if(y=String(m),p){let v=c-y.length;if(v>0){let E=new Array(v+1).join("0");m<0?y="-"+E+y.slice(1):y=E+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(_ne,"expandSequence");function gx(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=hx("{","}",e);if(!o)return tu(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=tu(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+yx+o.post,i=!0;continue}return tu(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=_ne(o.body,d,t,n);else{let m=AC(o.body);if(m.length===1&&m[0]!==void 0&&(m=gx(m[0],t,n,!1).map(Ene),m.length===1)){if(r=tu(r,c+m[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let E=0;y&&E<r.length;E++)r[E]&&(y=!1);h=[];let v=0;e:for(let E=0;E<m.length;E++){let k=gx(m[E],t,n,!1);for(let x=0;x<k.length;x++){let A=k[x];if(!(y&&!A)){if(h.length>=t||v+A.length>n)break e;h.push(A),v+=A.length}}}}if(r=tu(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(gx,"expand_");var nu=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Ine={"[: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]},ru=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),$ne=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),IC=l(e=>e.join(""),"rangesToString"),$C=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[v,[E,k,x]]of Object.entries(Ine))if(e.startsWith(v,s)){if(f)return["$.",!1,e.length-n,!0];s+=v.length,x?r.push(E):i.push(E),o=o||k;continue e}}if(c=!1,f){y>f?i.push(ru(f)+"-"+ru(y)):y===f&&i.push(ru(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(ru(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(ru(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[$ne(y),!1,d-n,!1]}let p="["+(u?"^":"")+IC(i)+"]",h="["+(u?"":"^")+IC(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var $s=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 ur,Cne=new Set(["!","?","+","*","@"]),wx=l(e=>Cne.has(e),"isExtglobType"),CC=l(e=>wx(e.type),"isExtglobAST"),Tne=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Nne=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Rne=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),TC=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),One="(?!(?:^|/)\\.\\.?(?:$|/))",gh="(?!\\.)",Pne=new Set(["[","."]),Dne=new Set(["..","."]),Lne=new Set("().*{}+?[]^$\\!"),Mne=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),vx="[^/]",NC=vx+"*?",RC=vx+"+?",jne=0,Ea=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++jne;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 ur&&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 ur&&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 ur(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,v="";for(;y<t.length;){let E=t.charAt(y++);if(o||E==="\\"){o=!o,v+=E;continue}if(c){y===u+1?(E==="^"||E==="!")&&(d=!0):E==="]"&&!(y===u+2&&d)&&(c=!1),v+=E;continue}else if(E==="["){c=!0,u=y,d=!1,v+=E;continue}if(!r.noext&&wx(E)&&t.charAt(y)==="("&&s<=a){n.push(v),v="";let x=new ur(E,n);y=ur.#h(t,x,y,r,s+1),n.push(x);continue}v+=E}return n.push(v),y}let f=i+1,p=new ur(null,n),h=[],m="";for(;f<t.length;){let y=t.charAt(f++);if(o||y==="\\"){o=!o,m+=y;continue}if(c){f===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(f===u+2&&d)&&(c=!1),m+=y;continue}else if(y==="["){c=!0,u=f,d=!1,m+=y;continue}if(!r.noext&&wx(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let E=n&&n.#g(y)?0:1;p.push(m),m="";let k=new ur(y,p);p.push(k),f=ur.#h(t,k,f,r,s+E);continue}if(y==="|"){p.push(m),m="",h.push(p),p=new ur(null,n);continue}if(y===")")return m===""&&n.#t.length===0&&(n.#c=!0),p.push(m),m="",n.push(...h,p),f;m+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#T(t){return this.#m(t,Nne)}#m(t,n=Tne){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=Rne){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new ur(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!!TC.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=TC.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 ur(null,void 0,n);return ur.#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()),!CC(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,y,v,E]=typeof h=="string"?ur.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||E,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Dne.has(this.#t[0]))){let m=Pne,y=n&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),v=!n&&!t&&m.has(u.charAt(0));d=y?One:v?gh:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,$s(u),this.#n=!!this.#n,this.#r]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#w(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,$s(this.toString()),!1,!1]}let a=!i||t||n||!gh?"":this.#w(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?gh:"")+RC;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?gh:"")+NC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,$s(s),this.#n=!!this.#n,this.#r]}#p(){if(CC(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}#w(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+=(Lne.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?RC:NC,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=$C(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=vx,n=!0;continue}s+=Mne(u)}return[s,$s(t),!!n,a]}};ur=Ea;var bx=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 En=l((e,t,n={})=>(nu(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Ho(t,n).match(e)),"minimatch"),Fne=/^\*+([^+@!?*[(]*)$/,Une=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),zne=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),Bne=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Wne=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),qne=/^\*+\.\*+$/,Hne=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Gne=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Vne=/^\.\*+$/,Zne=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Kne=/^\*+$/,Xne=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Qne=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Jne=/^\?+([^+@!?*[(]*)?$/,Yne=l(([e,t=""])=>{let n=DC([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),ere=l(([e,t=""])=>{let n=LC([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),tre=l(([e,t=""])=>{let n=LC([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),nre=l(([e,t=""])=>{let n=DC([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),DC=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),LC=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),MC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",OC={win32:{sep:"\\"},posix:{sep:"/"}},rre=MC==="win32"?OC.win32.sep:OC.posix.sep;En.sep=rre;var Un=Symbol("globstar **");En.GLOBSTAR=Un;var ire="[^/]",sre=ire+"*?",are="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ore="(?:(?!(?:\\/|^)\\.).)*?",lre=l((e,t={})=>n=>En(n,e,t),"filter");En.filter=lre;var Tr=l((e,t={})=>Object.assign({},e,t),"ext"),cre=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return En;let t=En;return Object.assign(l((i,r,s={})=>t(i,r,Tr(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Tr(e,s))}static defaults(r){return t.defaults(Tr(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Tr(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Tr(e,s))}},unescape:l((i,r={})=>t.unescape(i,Tr(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Tr(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Tr(e,r)),"filter"),defaults:l(i=>t.defaults(Tr(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Tr(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Tr(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Tr(e,s)),"match"),sep:t.sep,GLOBSTAR:Un})},"defaults");En.defaults=cre;var jC=l((e,t={})=>(nu(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:_C(e,{max:t.braceExpandMax})),"braceExpand");En.braceExpand=jC;var ure=l((e,t={})=>new Ho(e,t).makeRe(),"makeRe");En.makeRe=ure;var dre=l((e,t,n={})=>{let i=new Ho(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");En.match=dre;var PC=/[?*]|[+@!]\(.*?\)|\[|\]/,fre=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Ho=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={}){nu(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||MC,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]==="?"||!PC.test(s[2]))&&!PC.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,m]=[t[f],n[p]];h.toLowerCase()===m.toLowerCase()&&(n[p]=h,s=p,r=f)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Un)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(Un,s),o=n.lastIndexOf(Un),[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 x=r;x<t.length-f;x++){let A=String(t[x]);if(k=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return i||k}let p=[[[],0]],h=p[0],m=0,y=[0];for(let k of u)k===Un?(y.push(m),h=[[],0],p.push(h)):(h[0].push(k),m++);let v=p.length-1,E=t.length-f;for(let k of p)k[1]=E-(y[v--]+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===Un)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 jC(this.pattern,this.options)}parse(t){nu(t);let n=this.options;if(t==="**")return Un;if(t==="")return"";let i,r=null;(i=t.match(Kne))?r=n.dot?Qne:Xne:(i=t.match(Fne))?r=(n.nocase?n.dot?Wne:Bne:n.dot?zne:Une)(i[1]):(i=t.match(Jne))?r=(n.nocase?n.dot?ere:Yne:n.dot?tre:nre)(i):(i=t.match(qne))?r=n.dot?Gne:Hne:(i=t.match(Vne))&&(r=Zne);let s=Ea.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?sre:n.dot?are:ore,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"?fre(f):f===Un?Un:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==Un||m===Un||(m===void 0?h!==void 0&&h!==Un?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=m+"(?:\\/|\\/"+i+")?":h!==Un&&(u[p-1]=m+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=Un))});let d=u.filter(f=>f!==Un);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 En.defaults(t).Minimatch}};En.AST=Ea;En.Minimatch=Ho;En.escape=bx;En.unescape=$s;import{gunzipSync as Nse}from"node:zlib";var iu=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}],m=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&m+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,v=1/0,E=l(()=>{for(let k=Math.max(y,-u);k<=Math.min(v,u);k+=2){let x,A=h[k-1],S=h[k+1];A&&(h[k-1]=void 0);let _=!1;if(S){let L=S.oldPos-k;_=S&&0<=L&&L<o}let T=A&&A.oldPos+1<c;if(!_&&!T){h[k]=void 0;continue}if(!T||_&&A.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,i):x=this.addToPath(A,!1,!0,1,i),m=this.extractCommon(x,n,t,k,i),x.oldPos+1>=c&&m+1>=o)return a(this.buildValues(x.lastComponent,n,t))||!0;h[k]=x,x.oldPos+1>=c&&(v=Math.min(v,k-1)),m+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);E()||k()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let k=E();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 m=i[u+h];return m.length>p.length?m: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 xx=class extends iu{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=hre}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
716
716
  `))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
717
717
  `))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
718
718
  `)&&(t=t.slice(0,-1)),n.endsWith(`