dsh-edge 0.13.0-alpha.3 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-edge",
3
- "version": "0.13.0-alpha.3",
3
+ "version": "0.13.0",
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",
@@ -4012,7 +4012,7 @@ The web search request used endpoint ${JSON.stringify(e)}. Search endpoint confi
4012
4012
  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; }
4013
4013
  .secondary { background: #29314b; color: #edf2ff; }
4014
4014
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
4015
- `}l(GQ,"pageStyles");var Q7={name:"dsh-edge",version:"0.13.0-alpha.3",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.2-rc.1"},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.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-schedule":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.2-rc.1","@deepseek-ai/dsh-tool-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Ix=Q7.version,VQ=Q7.dshEdge.upstreamVersion;function EDe(){return"dsh-edge@0.13.0-alpha.3/direct"}l(EDe,"resolveEdgeDeploymentId");function Cg(e){return{baseURL:x3(e.DEEPSEEK_BASE_URL),maxTokens:k3(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Su(e.DEEPSEEK_MODEL),reasoningEffort:S3(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:jw(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:E3(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:_g(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Cg,"resolveEdgeDeploymentConfig");function kDe(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(kDe,"edgeDeploymentApiKeyConfigured");function _De(e){let t=x3(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(_De,"projectedEdgeBaseURL");function e$(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:EDe(),apiKeyConfigured:kDe(e),baseURL:_De(e.DEEPSEEK_BASE_URL),maxTokens:k3(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Su(e.DEEPSEEK_MODEL),reasoningEffort:S3(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:jw(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:E3(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:_g(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(e$,"resolveEdgeDeploymentProfile");function ZQ(e){Cg(e);let t=e$(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:Ix,upstreamVersion:VQ,status:"ready"}}l(ZQ,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as NYe}from"node:async_hooks";import{WorkerEntrypoint as HSt}from"cloudflare:workers";var wd=_d(KQ(),1);var t$=l((e,t,r)=>{let n=e instanceof RegExp?JQ(e,r):e,i=t instanceof RegExp?JQ(t,r):t,s=n!==null&&i!=null&&TDe(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"),JQ=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),TDe=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 p=n.pop();p!==void 0&&(a=[p,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 XQ="\0SLASH"+Math.random()+"\0",YQ="\0OPEN"+Math.random()+"\0",i$="\0CLOSE"+Math.random()+"\0",QQ="\0COMMA"+Math.random()+"\0",eee="\0PERIOD"+Math.random()+"\0",IDe=new RegExp(XQ,"g"),ADe=new RegExp(YQ,"g"),CDe=new RegExp(i$,"g"),RDe=new RegExp(QQ,"g"),ODe=new RegExp(eee,"g"),$De=/\\\\/g,NDe=/\\{/g,PDe=/\\}/g,DDe=/\\,/g,MDe=/\\\./g,LDe=1e5,FDe=4e6;function r$(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(r$,"numeric");function jDe(e){return e.replace($De,XQ).replace(NDe,YQ).replace(PDe,i$).replace(DDe,QQ).replace(MDe,eee)}l(jDe,"escapeBraces");function UDe(e){return e.replace(IDe,"\\").replace(ADe,"{").replace(CDe,"}").replace(RDe,",").replace(ODe,".")}l(UDe,"unescapeBraces");function tee(e){if(!e)return[""];let t=[],r=t$("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=tee(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(tee,"parseCommaParts");function ree(e,t={}){if(!e)return[];let{max:r=LDe,maxLength:n=FDe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),n$(jDe(e),r,n,!0).map(UDe)}l(ree,"expand");function qDe(e){return"{"+e+"}"}l(qDe,"embrace");function BDe(e){return/^-?0\d/.test(e)}l(BDe,"isPadded");function zDe(e,t){return e<=t}l(zDe,"lte");function WDe(e,t){return e>=t}l(WDe,"gte");function Rg(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(Rg,"combine");function HDe(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=r$(i[0]),a=r$(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(r$(i[2])),1):1,d=zDe;a<o&&(u*=-1,d=WDe);let h=i.some(BDe),f=0;for(let g=o;d(g,a)&&s.length<r;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),h){let v=c-y.length;if(v>0){let w=new Array(v+1).join("0");g<0?y="-"+w+y.slice(1):y=w+y}}if(f+y.length>n)break;s.push(y),f+=y.length}return s}l(HDe,"expandSequence");function n$(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=t$("{","}",e);if(!a)return Rg(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=Rg(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),p=u||d,h=a.body.indexOf(",")>=0;if(!p&&!h){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+i$+a.post,n=!0;continue}return Rg(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!p,o=!1);let f;if(p)f=HDe(a.body,d,t,r);else{let g=tee(a.body);if(g.length===1&&g[0]!==void 0&&(g=n$(g[0],t,r,!1).map(qDe),g.length===1)){if(i=Rg(i,c+g[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let y=s&&!a.post.length&&!c;for(let w=0;y&&w<i.length;w++)i[w]&&(y=!1);f=[];let v=0;e:for(let w=0;w<g.length;w++){let b=n$(g[w],t,r,!1);for(let x=0;x<b.length;x++){let E=b[x];if(!(y&&!E)){if(f.length>=t||v+E.length>r)break e;f.push(E),v+=E.length}}}}if(i=Rg(i,c,f,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(n$,"expand_");var Og=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var GDe={"[: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]},$g=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VDe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),nee=l(e=>e.join(""),"rangesToString"),iee=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,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===r+1){u=!0,s++;continue}if(y==="]"&&o&&!c){d=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[w,b,x]]of Object.entries(GDe))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-r,!0];s+=v.length,x?i.push(w):n.push(w),a=a||b;continue e}}if(c=!1,p){y>p?n.push($g(p)+"-"+$g(y)):y===p&&n.push($g(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push($g(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}n.push($g(y)),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 y=n[0].length===2?n[0].slice(-1):n[0];return[VDe(y),!1,d-r,!1]}let h="["+(u?"^":"")+nee(n)+"]",f="["+(u?"":"^")+nee(i)+"]";return[n.length&&i.length?"("+h+"|"+f+")":n.length?h:f,a,d-r,!0]},"parseClass");var dc=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 Vi,ZDe=new Set(["!","?","+","*","@"]),s$=l(e=>ZDe.has(e),"isExtglobType"),see=l(e=>s$(e.type),"isExtglobAST"),KDe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),JDe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),XDe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),oee=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),YDe="(?!(?:^|/)\\.\\.?(?:$|/))",Cx="(?!\\.)",QDe=new Set(["[","."]),eMe=new Set(["..","."]),tMe=new Set("().*{}+?[]^$\\!"),rMe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),o$="[^/]",aee=o$+"*?",lee=o$+"+?",nMe=0,zu=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#d=!1;#l;#o;#c=!1;id=++nMe;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.#d&&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("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!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 Vi&&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.#d&&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 Vi&&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 Vi(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#m(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let y=n,v="";for(;y<t.length;){let w=t.charAt(y++);if(a||w==="\\"){a=!a,v+=w;continue}if(c){y===u+1?(w==="^"||w==="!")&&(d=!0):w==="]"&&!(y===u+2&&d)&&(c=!1),v+=w;continue}else if(w==="["){c=!0,u=y,d=!1,v+=w;continue}if(!i.noext&&s$(w)&&t.charAt(y)==="("&&s<=o){r.push(v),v="";let x=new Vi(w,r);y=Vi.#m(t,x,y,i,s+1),r.push(x);continue}v+=w}return r.push(v),y}let p=n+1,h=new Vi(null,r),f=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(a||y==="\\"){a=!a,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&s$(y)&&t.charAt(p)==="("&&(s<=o||r&&r.#y(y))){let w=r&&r.#y(y)?0:1;h.push(g),g="";let b=new Vi(y,h);h.push(b),p=Vi.#m(t,b,p,i,s+w);continue}if(y==="|"){h.push(g),g="",f.push(h),h=new Vi(null,r);continue}if(y===")")return g===""&&r.#t.length===0&&(r.#c=!0),h.push(g),g="",r.push(...f,h),p;g+=y}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],p}#N(t){return this.#g(t,JDe)}#g(t,r=KDe){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.#y(n.type,r)}#y(t,r=XDe){return!!r.get(this.type)?.includes(t)}#p(t,r){let n=t.#t[0],i=new Vi(null,n,this.options);i.#t.push(""),n.push(i),this.#_(t,r)}#_(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}#T(t){return!!oee.get(this.type)?.has(t)}#P(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.#T(r.type)}#v(t){let r=oee.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 Vi(null,void 0,r);return Vi.#m(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.#f(),this.#k()),!see(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(f=>typeof f!="string"),u=this.#t.map(f=>{let[g,y,v,w]=typeof f=="string"?Vi.#I(f,this.#r,c):f.toRegExpSource(t);return this.#r=this.#r||v,this.#n=this.#n||w,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&eMe.has(this.#t[0]))){let g=QDe,y=r&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!r&&!t&&g.has(u.charAt(0));d=y?YDe:v?Cx:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,dc(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(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,dc(this.toString()),!1,!1]}let o=!n||t||r||!Cx?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Cx:"")+lee;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Cx:"")+aee+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,dc(s),this.#r=!!this.#r,this.#n]}#f(){if(see(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.#f(),this.#g(i)?(r=!1,this.#_(i,n)):this.#N(i)?(r=!1,this.#p(i,n)):this.#P(i)&&(r=!1,this.#v(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#b(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#I(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+=(tMe.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?lee:aee,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,h,f]=iee(t,c);if(h){s+=d,o=o||p,c+=h-1,r=r||f;continue}}if(u==="?"){s+=o$,r=!0;continue}s+=rMe(u)}return[s,dc(t),!!r,o]}};Vi=zu;var a$=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 Zn=l((e,t,r={})=>(Og(t),!r.nocomment&&t.charAt(0)==="#"?!1:new af(t,r).match(e)),"minimatch"),iMe=/^\*+([^+@!?*[(]*)$/,sMe=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),oMe=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),aMe=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),lMe=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),cMe=/^\*+\.\*+$/,uMe=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),dMe=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),pMe=/^\.\*+$/,fMe=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),hMe=/^\*+$/,mMe=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),gMe=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),yMe=/^\?+([^+@!?*[(]*)?$/,vMe=l(([e,t=""])=>{let r=dee([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),bMe=l(([e,t=""])=>{let r=pee([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),wMe=l(([e,t=""])=>{let r=pee([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),xMe=l(([e,t=""])=>{let r=dee([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),dee=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),pee=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),fee=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",cee={win32:{sep:"\\"},posix:{sep:"/"}},SMe=fee==="win32"?cee.win32.sep:cee.posix.sep;Zn.sep=SMe;var wi=Symbol("globstar **");Zn.GLOBSTAR=wi;var EMe="[^/]",kMe=EMe+"*?",_Me="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",TMe="(?:(?!(?:\\/|^)\\.).)*?",IMe=l((e,t={})=>r=>Zn(r,e,t),"filter");Zn.filter=IMe;var Fs=l((e,t={})=>Object.assign({},e,t),"ext"),AMe=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Zn;let t=Zn;return Object.assign(l((n,i,s={})=>t(n,i,Fs(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,Fs(e,s))}static defaults(i){return t.defaults(Fs(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,Fs(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,Fs(e,s))}},unescape:l((n,i={})=>t.unescape(n,Fs(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,Fs(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,Fs(e,i)),"filter"),defaults:l(n=>t.defaults(Fs(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,Fs(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,Fs(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,Fs(e,s)),"match"),sep:t.sep,GLOBSTAR:wi})},"defaults");Zn.defaults=AMe;var hee=l((e,t={})=>(Og(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ree(e,{max:t.braceExpandMax})),"braceExpand");Zn.braceExpand=hee;var CMe=l((e,t={})=>new af(e,t).makeRe(),"makeRe");Zn.makeRe=CMe;var RMe=l((e,t,r={})=>{let n=new af(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Zn.match=RMe;var uee=/[?*]|[+@!]\(.*?\)|\[|\]/,OMe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),af=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={}){Og(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||fee,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]==="?"||!uee.test(s[2]))&&!uee.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]),p=c?3:a?0:void 0,h=d?3:u?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,g]=[t[p],r[h]];f.toLowerCase()===g.toLowerCase()&&(r[h]=f,s=h,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(wi)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(wi,s),a=r.lastIndexOf(wi),[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 b=t.slice(i,i+c.length);if(!this.#n(b,c,n,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let b=t.length-d.length;if(this.#n(t,d,n,b,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(b--,!this.#n(t,d,n,b,0)))return!1;p=d.length+1}}if(!u.length){let b=!!p;for(let x=i;x<t.length-p;x++){let E=String(t[x]);if(b=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||b}let h=[[[],0]],f=h[0],g=0,y=[0];for(let b of u)b===wi?(y.push(g),f=[[],0],h.push(f)):(f[0].push(b),g++);let v=h.length-1,w=t.length-p;for(let b of h)b[1]=w-(y[v--]+b[0].length);return!!this.#r(t,h,i,0,n,0,!!p)}#r(t,r,n,i,s,o,a){let c=r[i];if(!c){for(let p=n;p<t.length;p++){a=!0;let h=t[p];if(h==="."||h===".."||!this.options.dot&&h.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 f=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(f!==!1)return f}let h=t[n];if(h==="."||h===".."||!this.options.dot&&h.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],p=t[o];if(this.debug(r,d,p),d===!1||d===wi)return!1;let h;if(typeof d=="string"?(h=p===d,this.debug("string match",d,p,h)):(h=d.test(p),this.debug("pattern match",d,p,h)),!h)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 hee(this.pattern,this.options)}parse(t){Og(t);let r=this.options;if(t==="**")return wi;if(t==="")return"";let n,i=null;(n=t.match(hMe))?i=r.dot?gMe:mMe:(n=t.match(iMe))?i=(r.nocase?r.dot?lMe:aMe:r.dot?oMe:sMe)(n[1]):(n=t.match(yMe))?i=(r.nocase?r.dot?bMe:vMe:r.dot?wMe:xMe)(n):(n=t.match(cMe))?i=r.dot?dMe:uMe:(n=t.match(pMe))&&(i=fMe);let s=zu.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?kMe:r.dot?_Me:TMe,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let h of p.flags.split(""))i.add(h);return typeof p=="string"?OMe(p):p===wi?wi:p._src});u.forEach((p,h)=>{let f=u[h+1],g=u[h-1];p!==wi||g===wi||(g===void 0?f!==void 0&&f!==wi?u[h+1]="(?:\\/|"+n+"\\/)?"+f:u[h]=n:f===void 0?u[h-1]=g+"(?:\\/|\\/"+n+")?":f!==wi&&(u[h-1]=g+"(?:\\/|\\/"+n+"\\/)"+f,u[h+1]=wi))});let d=u.filter(p=>p!==wi);if(this.partial&&d.length>=1){let p=[];for(let h=1;h<=d.length;h++)p.push(d.slice(0,h).join("/"));return"(?:"+p.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 Zn.defaults(t).Minimatch}};Zn.AST=zu;Zn.Minimatch=af;Zn.escape=a$;Zn.unescape=dc;import{gunzipSync as MFe}from"node:zlib";var Ng=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(b=>{if(b=this.postProcess(b,n),i){setTimeout(function(){i(b)},0);return}else return b},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let p=(s=n.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+p,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],r,t,0,n);if(f[0].oldPos+1>=c&&g+1>=a)return o(this.buildValues(f[0].lastComponent,r,t));let y=-1/0,v=1/0,w=l(()=>{for(let b=Math.max(y,-u);b<=Math.min(v,u);b+=2){let x,E=f[b-1],S=f[b+1];E&&(f[b-1]=void 0);let k=!1;if(S){let C=S.oldPos-b;k=S&&0<=C&&C<a}let _=E&&E.oldPos+1<c;if(!k&&!_){f[b]=void 0;continue}if(!_||k&&E.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,n):x=this.addToPath(E,!1,!0,1,n),g=this.extractCommon(x,r,t,b,n),x.oldPos+1>=c&&g+1>=a)return o(this.buildValues(x.lastComponent,r,t))||!0;f[b]=x,x.oldPos+1>=c&&(v=Math.min(v,b-1)),g+1>=a&&(y=Math.max(y,b+1))}u++},"execEditLength");if(i)l(function b(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);w()||b()},0)},"exec")();else for(;u<=d&&Date.now()<=h;){let b=w();if(b)return b}}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 p=r.slice(c,c+d.count);p=p.map(function(h,f){let g=n[u+f];return g.length>h.length?g:h}),d.value=this.join(p)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var l$=class extends Ng{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=NMe}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
4015
+ `}l(GQ,"pageStyles");var Q7={name:"dsh-edge",version:"0.13.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.2-rc.1"},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.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-schedule":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.2-rc.1","@deepseek-ai/dsh-tool-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Ix=Q7.version,VQ=Q7.dshEdge.upstreamVersion;function EDe(){return"dsh-edge@0.13.0/direct"}l(EDe,"resolveEdgeDeploymentId");function Cg(e){return{baseURL:x3(e.DEEPSEEK_BASE_URL),maxTokens:k3(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Su(e.DEEPSEEK_MODEL),reasoningEffort:S3(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:jw(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:E3(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:_g(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Cg,"resolveEdgeDeploymentConfig");function kDe(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(kDe,"edgeDeploymentApiKeyConfigured");function _De(e){let t=x3(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(_De,"projectedEdgeBaseURL");function e$(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:EDe(),apiKeyConfigured:kDe(e),baseURL:_De(e.DEEPSEEK_BASE_URL),maxTokens:k3(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Su(e.DEEPSEEK_MODEL),reasoningEffort:S3(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:jw(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:E3(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:_g(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(e$,"resolveEdgeDeploymentProfile");function ZQ(e){Cg(e);let t=e$(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:Ix,upstreamVersion:VQ,status:"ready"}}l(ZQ,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as NYe}from"node:async_hooks";import{WorkerEntrypoint as HSt}from"cloudflare:workers";var wd=_d(KQ());var t$=l((e,t,r)=>{let n=e instanceof RegExp?JQ(e,r):e,i=t instanceof RegExp?JQ(t,r):t,s=n!==null&&i!=null&&TDe(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"),JQ=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),TDe=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 p=n.pop();p!==void 0&&(a=[p,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 XQ="\0SLASH"+Math.random()+"\0",YQ="\0OPEN"+Math.random()+"\0",i$="\0CLOSE"+Math.random()+"\0",QQ="\0COMMA"+Math.random()+"\0",eee="\0PERIOD"+Math.random()+"\0",IDe=new RegExp(XQ,"g"),ADe=new RegExp(YQ,"g"),CDe=new RegExp(i$,"g"),RDe=new RegExp(QQ,"g"),ODe=new RegExp(eee,"g"),$De=/\\\\/g,NDe=/\\{/g,PDe=/\\}/g,DDe=/\\,/g,MDe=/\\\./g,LDe=1e5,FDe=4e6;function r$(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(r$,"numeric");function jDe(e){return e.replace($De,XQ).replace(NDe,YQ).replace(PDe,i$).replace(DDe,QQ).replace(MDe,eee)}l(jDe,"escapeBraces");function UDe(e){return e.replace(IDe,"\\").replace(ADe,"{").replace(CDe,"}").replace(RDe,",").replace(ODe,".")}l(UDe,"unescapeBraces");function tee(e){if(!e)return[""];let t=[],r=t$("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=tee(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(tee,"parseCommaParts");function ree(e,t={}){if(!e)return[];let{max:r=LDe,maxLength:n=FDe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),n$(jDe(e),r,n,!0).map(UDe)}l(ree,"expand");function qDe(e){return"{"+e+"}"}l(qDe,"embrace");function BDe(e){return/^-?0\d/.test(e)}l(BDe,"isPadded");function zDe(e,t){return e<=t}l(zDe,"lte");function WDe(e,t){return e>=t}l(WDe,"gte");function Rg(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(Rg,"combine");function HDe(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=r$(i[0]),a=r$(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(r$(i[2])),1):1,d=zDe;a<o&&(u*=-1,d=WDe);let h=i.some(BDe),f=0;for(let g=o;d(g,a)&&s.length<r;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),h){let v=c-y.length;if(v>0){let w=new Array(v+1).join("0");g<0?y="-"+w+y.slice(1):y=w+y}}if(f+y.length>n)break;s.push(y),f+=y.length}return s}l(HDe,"expandSequence");function n$(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=t$("{","}",e);if(!a)return Rg(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=Rg(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),p=u||d,h=a.body.indexOf(",")>=0;if(!p&&!h){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+i$+a.post,n=!0;continue}return Rg(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!p,o=!1);let f;if(p)f=HDe(a.body,d,t,r);else{let g=tee(a.body);if(g.length===1&&g[0]!==void 0&&(g=n$(g[0],t,r,!1).map(qDe),g.length===1)){if(i=Rg(i,c+g[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let y=s&&!a.post.length&&!c;for(let w=0;y&&w<i.length;w++)i[w]&&(y=!1);f=[];let v=0;e:for(let w=0;w<g.length;w++){let b=n$(g[w],t,r,!1);for(let x=0;x<b.length;x++){let E=b[x];if(!(y&&!E)){if(f.length>=t||v+E.length>r)break e;f.push(E),v+=E.length}}}}if(i=Rg(i,c,f,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(n$,"expand_");var Og=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var GDe={"[: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]},$g=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VDe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),nee=l(e=>e.join(""),"rangesToString"),iee=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,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===r+1){u=!0,s++;continue}if(y==="]"&&o&&!c){d=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[w,b,x]]of Object.entries(GDe))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-r,!0];s+=v.length,x?i.push(w):n.push(w),a=a||b;continue e}}if(c=!1,p){y>p?n.push($g(p)+"-"+$g(y)):y===p&&n.push($g(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push($g(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}n.push($g(y)),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 y=n[0].length===2?n[0].slice(-1):n[0];return[VDe(y),!1,d-r,!1]}let h="["+(u?"^":"")+nee(n)+"]",f="["+(u?"":"^")+nee(i)+"]";return[n.length&&i.length?"("+h+"|"+f+")":n.length?h:f,a,d-r,!0]},"parseClass");var dc=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 Vi,ZDe=new Set(["!","?","+","*","@"]),s$=l(e=>ZDe.has(e),"isExtglobType"),see=l(e=>s$(e.type),"isExtglobAST"),KDe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),JDe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),XDe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),oee=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),YDe="(?!(?:^|/)\\.\\.?(?:$|/))",Cx="(?!\\.)",QDe=new Set(["[","."]),eMe=new Set(["..","."]),tMe=new Set("().*{}+?[]^$\\!"),rMe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),o$="[^/]",aee=o$+"*?",lee=o$+"+?",nMe=0,zu=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#d=!1;#l;#o;#c=!1;id=++nMe;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.#d&&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("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!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 Vi&&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.#d&&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 Vi&&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 Vi(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#m(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let y=n,v="";for(;y<t.length;){let w=t.charAt(y++);if(a||w==="\\"){a=!a,v+=w;continue}if(c){y===u+1?(w==="^"||w==="!")&&(d=!0):w==="]"&&!(y===u+2&&d)&&(c=!1),v+=w;continue}else if(w==="["){c=!0,u=y,d=!1,v+=w;continue}if(!i.noext&&s$(w)&&t.charAt(y)==="("&&s<=o){r.push(v),v="";let x=new Vi(w,r);y=Vi.#m(t,x,y,i,s+1),r.push(x);continue}v+=w}return r.push(v),y}let p=n+1,h=new Vi(null,r),f=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(a||y==="\\"){a=!a,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&s$(y)&&t.charAt(p)==="("&&(s<=o||r&&r.#y(y))){let w=r&&r.#y(y)?0:1;h.push(g),g="";let b=new Vi(y,h);h.push(b),p=Vi.#m(t,b,p,i,s+w);continue}if(y==="|"){h.push(g),g="",f.push(h),h=new Vi(null,r);continue}if(y===")")return g===""&&r.#t.length===0&&(r.#c=!0),h.push(g),g="",r.push(...f,h),p;g+=y}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],p}#N(t){return this.#g(t,JDe)}#g(t,r=KDe){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.#y(n.type,r)}#y(t,r=XDe){return!!r.get(this.type)?.includes(t)}#p(t,r){let n=t.#t[0],i=new Vi(null,n,this.options);i.#t.push(""),n.push(i),this.#_(t,r)}#_(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}#T(t){return!!oee.get(this.type)?.has(t)}#P(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.#T(r.type)}#v(t){let r=oee.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 Vi(null,void 0,r);return Vi.#m(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.#f(),this.#k()),!see(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(f=>typeof f!="string"),u=this.#t.map(f=>{let[g,y,v,w]=typeof f=="string"?Vi.#I(f,this.#r,c):f.toRegExpSource(t);return this.#r=this.#r||v,this.#n=this.#n||w,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&eMe.has(this.#t[0]))){let g=QDe,y=r&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!r&&!t&&g.has(u.charAt(0));d=y?YDe:v?Cx:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,dc(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(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,dc(this.toString()),!1,!1]}let o=!n||t||r||!Cx?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Cx:"")+lee;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Cx:"")+aee+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,dc(s),this.#r=!!this.#r,this.#n]}#f(){if(see(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.#f(),this.#g(i)?(r=!1,this.#_(i,n)):this.#N(i)?(r=!1,this.#p(i,n)):this.#P(i)&&(r=!1,this.#v(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#b(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#I(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+=(tMe.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?lee:aee,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,h,f]=iee(t,c);if(h){s+=d,o=o||p,c+=h-1,r=r||f;continue}}if(u==="?"){s+=o$,r=!0;continue}s+=rMe(u)}return[s,dc(t),!!r,o]}};Vi=zu;var a$=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 Zn=l((e,t,r={})=>(Og(t),!r.nocomment&&t.charAt(0)==="#"?!1:new af(t,r).match(e)),"minimatch"),iMe=/^\*+([^+@!?*[(]*)$/,sMe=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),oMe=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),aMe=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),lMe=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),cMe=/^\*+\.\*+$/,uMe=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),dMe=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),pMe=/^\.\*+$/,fMe=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),hMe=/^\*+$/,mMe=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),gMe=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),yMe=/^\?+([^+@!?*[(]*)?$/,vMe=l(([e,t=""])=>{let r=dee([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),bMe=l(([e,t=""])=>{let r=pee([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),wMe=l(([e,t=""])=>{let r=pee([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),xMe=l(([e,t=""])=>{let r=dee([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),dee=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),pee=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),fee=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",cee={win32:{sep:"\\"},posix:{sep:"/"}},SMe=fee==="win32"?cee.win32.sep:cee.posix.sep;Zn.sep=SMe;var wi=Symbol("globstar **");Zn.GLOBSTAR=wi;var EMe="[^/]",kMe=EMe+"*?",_Me="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",TMe="(?:(?!(?:\\/|^)\\.).)*?",IMe=l((e,t={})=>r=>Zn(r,e,t),"filter");Zn.filter=IMe;var Fs=l((e,t={})=>Object.assign({},e,t),"ext"),AMe=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Zn;let t=Zn;return Object.assign(l((n,i,s={})=>t(n,i,Fs(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,Fs(e,s))}static defaults(i){return t.defaults(Fs(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,Fs(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,Fs(e,s))}},unescape:l((n,i={})=>t.unescape(n,Fs(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,Fs(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,Fs(e,i)),"filter"),defaults:l(n=>t.defaults(Fs(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,Fs(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,Fs(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,Fs(e,s)),"match"),sep:t.sep,GLOBSTAR:wi})},"defaults");Zn.defaults=AMe;var hee=l((e,t={})=>(Og(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ree(e,{max:t.braceExpandMax})),"braceExpand");Zn.braceExpand=hee;var CMe=l((e,t={})=>new af(e,t).makeRe(),"makeRe");Zn.makeRe=CMe;var RMe=l((e,t,r={})=>{let n=new af(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Zn.match=RMe;var uee=/[?*]|[+@!]\(.*?\)|\[|\]/,OMe=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),af=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={}){Og(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||fee,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]==="?"||!uee.test(s[2]))&&!uee.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]),p=c?3:a?0:void 0,h=d?3:u?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,g]=[t[p],r[h]];f.toLowerCase()===g.toLowerCase()&&(r[h]=f,s=h,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(wi)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(wi,s),a=r.lastIndexOf(wi),[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 b=t.slice(i,i+c.length);if(!this.#n(b,c,n,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let b=t.length-d.length;if(this.#n(t,d,n,b,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(b--,!this.#n(t,d,n,b,0)))return!1;p=d.length+1}}if(!u.length){let b=!!p;for(let x=i;x<t.length-p;x++){let E=String(t[x]);if(b=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||b}let h=[[[],0]],f=h[0],g=0,y=[0];for(let b of u)b===wi?(y.push(g),f=[[],0],h.push(f)):(f[0].push(b),g++);let v=h.length-1,w=t.length-p;for(let b of h)b[1]=w-(y[v--]+b[0].length);return!!this.#r(t,h,i,0,n,0,!!p)}#r(t,r,n,i,s,o,a){let c=r[i];if(!c){for(let p=n;p<t.length;p++){a=!0;let h=t[p];if(h==="."||h===".."||!this.options.dot&&h.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 f=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(f!==!1)return f}let h=t[n];if(h==="."||h===".."||!this.options.dot&&h.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],p=t[o];if(this.debug(r,d,p),d===!1||d===wi)return!1;let h;if(typeof d=="string"?(h=p===d,this.debug("string match",d,p,h)):(h=d.test(p),this.debug("pattern match",d,p,h)),!h)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 hee(this.pattern,this.options)}parse(t){Og(t);let r=this.options;if(t==="**")return wi;if(t==="")return"";let n,i=null;(n=t.match(hMe))?i=r.dot?gMe:mMe:(n=t.match(iMe))?i=(r.nocase?r.dot?lMe:aMe:r.dot?oMe:sMe)(n[1]):(n=t.match(yMe))?i=(r.nocase?r.dot?bMe:vMe:r.dot?wMe:xMe)(n):(n=t.match(cMe))?i=r.dot?dMe:uMe:(n=t.match(pMe))&&(i=fMe);let s=zu.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?kMe:r.dot?_Me:TMe,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let h of p.flags.split(""))i.add(h);return typeof p=="string"?OMe(p):p===wi?wi:p._src});u.forEach((p,h)=>{let f=u[h+1],g=u[h-1];p!==wi||g===wi||(g===void 0?f!==void 0&&f!==wi?u[h+1]="(?:\\/|"+n+"\\/)?"+f:u[h]=n:f===void 0?u[h-1]=g+"(?:\\/|\\/"+n+")?":f!==wi&&(u[h-1]=g+"(?:\\/|\\/"+n+"\\/)"+f,u[h+1]=wi))});let d=u.filter(p=>p!==wi);if(this.partial&&d.length>=1){let p=[];for(let h=1;h<=d.length;h++)p.push(d.slice(0,h).join("/"));return"(?:"+p.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 Zn.defaults(t).Minimatch}};Zn.AST=zu;Zn.Minimatch=af;Zn.escape=a$;Zn.unescape=dc;import{gunzipSync as MFe}from"node:zlib";var Ng=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(b=>{if(b=this.postProcess(b,n),i){setTimeout(function(){i(b)},0);return}else return b},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let p=(s=n.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+p,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],r,t,0,n);if(f[0].oldPos+1>=c&&g+1>=a)return o(this.buildValues(f[0].lastComponent,r,t));let y=-1/0,v=1/0,w=l(()=>{for(let b=Math.max(y,-u);b<=Math.min(v,u);b+=2){let x,E=f[b-1],S=f[b+1];E&&(f[b-1]=void 0);let k=!1;if(S){let C=S.oldPos-b;k=S&&0<=C&&C<a}let _=E&&E.oldPos+1<c;if(!k&&!_){f[b]=void 0;continue}if(!_||k&&E.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,n):x=this.addToPath(E,!1,!0,1,n),g=this.extractCommon(x,r,t,b,n),x.oldPos+1>=c&&g+1>=a)return o(this.buildValues(x.lastComponent,r,t))||!0;f[b]=x,x.oldPos+1>=c&&(v=Math.min(v,b-1)),g+1>=a&&(y=Math.max(y,b+1))}u++},"execEditLength");if(i)l(function b(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);w()||b()},0)},"exec")();else for(;u<=d&&Date.now()<=h;){let b=w();if(b)return b}}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 p=r.slice(c,c+d.count);p=p.map(function(h,f){let g=n[u+f];return g.length>h.length?g:h}),d.value=this.join(p)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var l$=class extends Ng{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=NMe}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
4016
4016
  `))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
4017
4017
  `))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
4018
4018
  `)&&(t=t.slice(0,-1)),r.endsWith(`
@@ -4012,7 +4012,7 @@ The web search request used endpoint ${JSON.stringify(e)}. Search endpoint confi
4012
4012
  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; }
4013
4013
  .secondary { background: #29314b; color: #edf2ff; }
4014
4014
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
4015
- `}o(WZ,"pageStyles");var D8={name:"dsh-edge",version:"0.13.0-alpha.3",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.2-rc.1"},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.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-schedule":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.2-rc.1","@deepseek-ai/dsh-tool-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Qy=D8.version,HZ=D8.dshEdge.upstreamVersion;function X8e(){return"dsh-edge@0.13.0-alpha.3/isolated"}o(X8e,"resolveEdgeDeploymentId");function vh(e){return{baseURL:r7(e.DEEPSEEK_BASE_URL),maxTokens:a7(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Jl(e.DEEPSEEK_MODEL),reasoningEffort:i7(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:uy(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:s7(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:gh(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(vh,"resolveEdgeDeploymentConfig");function J8e(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}o(J8e,"edgeDeploymentApiKeyConfigured");function Q8e(e){let t=r7(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}o(Q8e,"projectedEdgeBaseURL");function M8(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:X8e(),apiKeyConfigured:J8e(e),baseURL:Q8e(e.DEEPSEEK_BASE_URL),maxTokens:a7(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Jl(e.DEEPSEEK_MODEL),reasoningEffort:i7(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:uy(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:s7(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:gh(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(M8,"resolveEdgeDeploymentProfile");function GZ(e){vh(e);let t=M8(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:Qy,upstreamVersion:HZ,status:"ready"}}o(GZ,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as gMe}from"node:async_hooks";import{WorkerEntrypoint as Gct}from"cloudflare:workers";var Dc=Bc(VZ(),1);var L8=o((e,t,n)=>{let r=e instanceof RegExp?ZZ(e,n):e,i=t instanceof RegExp?ZZ(t,n):t,s=r!==null&&i!=null&&Y8e(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),ZZ=o((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Y8e=o((e,t,n)=>{let r,i,s,a,l,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],s=n.length;d>=0&&!l;){if(d===c)r.push(d),c=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(l=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}r.length&&a!==void 0&&(l=[s,a])}return l},"range");var KZ="\0SLASH"+Math.random()+"\0",XZ="\0OPEN"+Math.random()+"\0",U8="\0CLOSE"+Math.random()+"\0",JZ="\0COMMA"+Math.random()+"\0",QZ="\0PERIOD"+Math.random()+"\0",eTe=new RegExp(KZ,"g"),tTe=new RegExp(XZ,"g"),nTe=new RegExp(U8,"g"),rTe=new RegExp(JZ,"g"),iTe=new RegExp(QZ,"g"),sTe=/\\\\/g,aTe=/\\{/g,oTe=/\\}/g,lTe=/\\,/g,cTe=/\\\./g,uTe=1e5,dTe=4e6;function j8(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}o(j8,"numeric");function pTe(e){return e.replace(sTe,KZ).replace(aTe,XZ).replace(oTe,U8).replace(lTe,JZ).replace(cTe,QZ)}o(pTe,"escapeBraces");function fTe(e){return e.replace(eTe,"\\").replace(tTe,"{").replace(nTe,"}").replace(rTe,",").replace(iTe,".")}o(fTe,"unescapeBraces");function YZ(e){if(!e)return[""];let t=[],n=L8("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";let l=YZ(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}o(YZ,"parseCommaParts");function eK(e,t={}){if(!e)return[];let{max:n=uTe,maxLength:r=dTe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),F8(pTe(e),n,r,!0).map(fTe)}o(eK,"expand");function hTe(e){return"{"+e+"}"}o(hTe,"embrace");function mTe(e){return/^-?0\d/.test(e)}o(mTe,"isPadded");function gTe(e,t){return e<=t}o(gTe,"lte");function yTe(e,t){return e>=t}o(yTe,"gte");function wh(e,t,n,r,i,s){let a=[],l=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=r)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(l+d.length>i)return a;a.push(d),l+=d.length}}return a}o(wh,"combine");function xTe(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let a=j8(i[0]),l=j8(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(j8(i[2])),1):1,d=gTe;l<a&&(u*=-1,d=yTe);let m=i.some(mTe),h=0;for(let g=a;d(g,l)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),m){let x=c-y.length;if(x>0){let b=new Array(x+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}o(xTe,"expandSequence");function F8(e,t,n,r){let i=[""],s=!1,a=!0;for(;;){let l=L8("{","}",e);if(!l)return wh(i,e,[""],t,n,s);let c=l.pre;if(/\$$/.test(c)){if(i=wh(i,c+"{"+l.body+"}",[""],t,n,s&&!l.post.length),a=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,m=l.body.indexOf(",")>=0;if(!p&&!m){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+U8+l.post,r=!0;continue}return wh(i,c+"{"+l.body+"}"+l.post,[""],t,n,s)}a&&(s=r&&!p,a=!1);let h;if(p)h=xTe(l.body,d,t,n);else{let g=YZ(l.body);if(g.length===1&&g[0]!==void 0&&(g=F8(g[0],t,n,!1).map(hTe),g.length===1)){if(i=wh(i,c+g[0],[""],t,n,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let b=0;y&&b<i.length;b++)i[b]&&(y=!1);h=[];let x=0;e:for(let b=0;b<g.length;b++){let w=F8(g[b],t,n,!1);for(let v=0;v<w.length;v++){let E=w[v];if(!(y&&!E)){if(h.length>=t||x+E.length>n)break e;h.push(E),x+=E.length}}}}if(i=wh(i,c,h,t,n,s&&!l.post.length),!l.post.length)break;e=l.post}return i}o(F8,"expand_");var Sh=o(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var bTe={"[: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]},Eh=o(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),vTe=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),tK=o(e=>e.join(""),"rangesToString"),nK=o((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,a=!1,l=!1,c=!1,u=!1,d=n,p="";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[x,[b,w,v]]of Object.entries(bTe))if(e.startsWith(x,s)){if(p)return["$.",!1,e.length-n,!0];s+=x.length,v?i.push(b):r.push(b),l=l||w;continue e}}if(c=!1,p){y>p?r.push(Eh(p)+"-"+Eh(y)):y===p&&r.push(Eh(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(Eh(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(Eh(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[vTe(y),!1,d-n,!1]}let m="["+(u?"^":"")+tK(r)+"]",h="["+(u?"":"^")+tK(i)+"]";return[r.length&&i.length?"("+m+"|"+h+")":r.length?m:h,l,d-n,!0]},"parseClass");var Go=o((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 pi,wTe=new Set(["!","?","+","*","@"]),B8=o(e=>wTe.has(e),"isExtglobType"),rK=o(e=>B8(e.type),"isExtglobAST"),STe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),ETe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),kTe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),iK=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),_Te="(?!(?:^|/)\\.\\.?(?:$|/))",e3="(?!\\.)",ATe=new Set(["[","."]),TTe=new Set(["..","."]),ITe=new Set("().*{}+?[]^$\\!"),CTe=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),q8="[^/]",sK=q8+"*?",aK=q8+"+?",RTe=0,xc=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#d=!1;#l;#a;#c=!1;id=++RTe;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,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?r:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#d&&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("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof pi&&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.#d&&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 r=t.#t[n];if(!(r instanceof pi&&r.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 pi(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let a=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=r,x="";for(;y<t.length;){let b=t.charAt(y++);if(l||b==="\\"){l=!l,x+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),x+=b;continue}else if(b==="["){c=!0,u=y,d=!1,x+=b;continue}if(!i.noext&&B8(b)&&t.charAt(y)==="("&&s<=a){n.push(x),x="";let v=new pi(b,n);y=pi.#m(t,v,y,i,s+1),n.push(v);continue}x+=b}return n.push(x),y}let p=r+1,m=new pi(null,n),h=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&B8(y)&&t.charAt(p)==="("&&(s<=a||n&&n.#y(y))){let b=n&&n.#y(y)?0:1;m.push(g),g="";let w=new pi(y,m);m.push(w),p=pi.#m(t,w,p,i,s+b);continue}if(y==="|"){m.push(g),g="",h.push(m),m=new pi(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),m.push(g),g="",n.push(...h,m),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#$(t){return this.#g(t,ETe)}#g(t,n=STe){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=kTe){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new pi(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#a=void 0}#A(t){return!!iK.get(this.type)?.has(t)}#P(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.#A(n.type)}#x(t){let n=iK.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let r=new pi(null,void 0,n);return pi.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,l),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!rK(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,x,b]=typeof h=="string"?pi.#T(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||x,this.#r=this.#r||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&TTe.has(this.#t[0]))){let g=ATe,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),x=!n&&!t&&g.has(u.charAt(0));d=y?_Te:x?e3:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,Go(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(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,Go(this.toString()),!1,!1]}let a=!r||t||n||!e3?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!n?e3:"")+aK;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?e3:"")+sK+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=i+s+c}return[l,Go(s),this.#n=!!this.#n,this.#r]}#f(){if(rK(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#$(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#x(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#a=void 0}#b(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#T(t,n,r=!1){let i=!1,s="",a=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(ITe.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(t)?aK:sK,n=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,m,h]=nK(t,c);if(m){s+=d,a=a||p,c+=m-1,n=n||h;continue}}if(u==="?"){s+=q8,n=!0;continue}s+=CTe(u)}return[s,Go(t),!!n,a]}};pi=xc;var z8=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var xr=o((e,t,n={})=>(Sh(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Sd(t,n).match(e)),"minimatch"),NTe=/^\*+([^+@!?*[(]*)$/,OTe=o(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),$Te=o(e=>t=>t.endsWith(e),"starDotExtTestDot"),PTe=o(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),DTe=o(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),MTe=/^\*+\.\*+$/,LTe=o(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),jTe=o(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),FTe=/^\.\*+$/,UTe=o(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),BTe=/^\*+$/,qTe=o(e=>e.length!==0&&!e.startsWith("."),"starTest"),zTe=o(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),WTe=/^\?+([^+@!?*[(]*)?$/,HTe=o(([e,t=""])=>{let n=cK([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),GTe=o(([e,t=""])=>{let n=uK([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),VTe=o(([e,t=""])=>{let n=uK([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),ZTe=o(([e,t=""])=>{let n=cK([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),cK=o(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),uK=o(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),dK=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",oK={win32:{sep:"\\"},posix:{sep:"/"}},KTe=dK==="win32"?oK.win32.sep:oK.posix.sep;xr.sep=KTe;var Br=Symbol("globstar **");xr.GLOBSTAR=Br;var XTe="[^/]",JTe=XTe+"*?",QTe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",YTe="(?:(?!(?:\\/|^)\\.).)*?",eIe=o((e,t={})=>n=>xr(n,e,t),"filter");xr.filter=eIe;var Vi=o((e,t={})=>Object.assign({},e,t),"ext"),tIe=o(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return xr;let t=xr;return Object.assign(o((r,i,s={})=>t(r,i,Vi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,Vi(e,s))}static defaults(i){return t.defaults(Vi(e,i)).Minimatch}},AST:class extends t.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,Vi(e,a))}static fromGlob(i,s={}){return t.AST.fromGlob(i,Vi(e,s))}},unescape:o((r,i={})=>t.unescape(r,Vi(e,i)),"unescape"),escape:o((r,i={})=>t.escape(r,Vi(e,i)),"escape"),filter:o((r,i={})=>t.filter(r,Vi(e,i)),"filter"),defaults:o(r=>t.defaults(Vi(e,r)),"defaults"),makeRe:o((r,i={})=>t.makeRe(r,Vi(e,i)),"makeRe"),braceExpand:o((r,i={})=>t.braceExpand(r,Vi(e,i)),"braceExpand"),match:o((r,i,s={})=>t.match(r,i,Vi(e,s)),"match"),sep:t.sep,GLOBSTAR:Br})},"defaults");xr.defaults=tIe;var pK=o((e,t={})=>(Sh(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:eK(e,{max:t.braceExpandMax})),"braceExpand");xr.braceExpand=pK;var nIe=o((e,t={})=>new Sd(e,t).makeRe(),"makeRe");xr.makeRe=nIe;var rIe=o((e,t,n={})=>{let r=new Sd(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");xr.match=rIe;var lK=/[?*]|[+@!]\(.*?\)|\[|\]/,iIe=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Sd=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){Sh(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||dK,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!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 r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!lK.test(s[2]))&&!lK.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 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 r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");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 r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let l=r[a];a===1&&l===""&&r[0]===""||(l==="."||l==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,a=[],l="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])a.push(l==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])a.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])a.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(l==="b")return!1;l="a",a.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="b",a.push(n[s]),i++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&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]),p=c?3:l?0:void 0,m=d?3:u?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[h,g]=[t[p],n[m]];h.toLowerCase()===g.toLowerCase()&&(n[m]=h,s=m,i=p)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Br)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let a=n.indexOf(Br,s),l=n.lastIndexOf(Br),[c,u,d]=r?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,l),n.slice(l+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#r(w,c,r,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#r(t,d,r,w,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#r(t,d,r,w,0)))return!1;p=d.length+1}}if(!u.length){let w=!!p;for(let v=i;v<t.length-p;v++){let E=String(t[v]);if(w=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||w}let m=[[[],0]],h=m[0],g=0,y=[0];for(let w of u)w===Br?(y.push(g),h=[[],0],m.push(h)):(h[0].push(w),g++);let x=m.length-1,b=t.length-p;for(let w of m)w[1]=b-(y[x--]+w[0].length);return!!this.#n(t,m,i,0,r,0,!!p)}#n(t,n,r,i,s,a,l){let c=n[i];if(!c){for(let p=r;p<t.length;p++){l=!0;let m=t[p];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return l}let[u,d]=c;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,r+u.length,i+1,s,a+1,l);if(h!==!1)return h}let m=t[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let a,l,c,u;for(a=i,l=s,u=t.length,c=n.length;a<u&&l<c;a++,l++){this.debug("matchOne loop");let d=n[l],p=t[a];if(this.debug(n,d,p),d===!1||d===Br)return!1;let m;if(typeof d=="string"?(m=p===d,this.debug("string match",d,p,m)):(m=d.test(p),this.debug("pattern match",d,p,m)),!m)return!1}if(a===u&&l===c)return!0;if(a===u)return r;if(l===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return pK(this.pattern,this.options)}parse(t){Sh(t);let n=this.options;if(t==="**")return Br;if(t==="")return"";let r,i=null;(r=t.match(BTe))?i=n.dot?zTe:qTe:(r=t.match(NTe))?i=(n.nocase?n.dot?DTe:PTe:n.dot?$Te:OTe)(r[1]):(r=t.match(WTe))?i=(n.nocase?n.dot?GTe:HTe:n.dot?VTe:ZTe)(r):(r=t.match(MTe))?i=n.dot?jTe:LTe:(r=t.match(FTe))&&(i=UTe);let s=xc.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 n=this.options,r=n.noglobstar?JTe:n.dot?QTe:YTe,i=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))i.add(m);return typeof p=="string"?iIe(p):p===Br?Br:p._src});u.forEach((p,m)=>{let h=u[m+1],g=u[m-1];p!==Br||g===Br||(g===void 0?h!==void 0&&h!==Br?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=g+"(?:\\/|\\/"+r+")?":h!==Br&&(u[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=Br))});let d=u.filter(p=>p!==Br);if(this.partial&&d.length>=1){let p=[];for(let m=1;m<=d.length;m++)p.push(d.slice(0,m).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+l+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+l+")$"),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,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 r=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 a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return xr.defaults(t).Minimatch}};xr.AST=xc;xr.Minimatch=Sd;xr.escape=z8;xr.unescape=Go;import{gunzipSync as ICe}from"node:zlib";var kh=class{static{o(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),a=this.castInput(n,r),l=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(l,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;let a=o(w=>{if(w=this.postProcess(w,r),i){setTimeout(function(){i(w)},0);return}else return w},"done"),l=n.length,c=t.length,u=1,d=l+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&g+1>=l)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,x=1/0,b=o(()=>{for(let w=Math.max(y,-u);w<=Math.min(x,u);w+=2){let v,E=h[w-1],S=h[w+1];E&&(h[w-1]=void 0);let _=!1;if(S){let $=S.oldPos-w;_=S&&0<=$&&$<l}let T=E&&E.oldPos+1<c;if(!_&&!T){h[w]=void 0;continue}if(!T||_&&E.oldPos<S.oldPos?v=this.addToPath(S,!0,!1,0,r):v=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(v,n,t,w,r),v.oldPos+1>=c&&g+1>=l)return a(this.buildValues(v.lastComponent,n,t))||!0;h[w]=v,v.oldPos+1>=c&&(x=Math.min(x,w-1)),g+1>=l&&(y=Math.max(y,w+1))}u++},"execEditLength");if(i)o(function w(){setTimeout(function(){if(u>d||Date.now()>m)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=m;){let w=b();if(w)return w}}addToPath(t,n,r,i,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){let a=n.length,l=r.length,c=t.oldPos,u=c-i,d=0;for(;u+1<a&&c+1<l&&this.equals(r[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,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);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,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let a=i.length,l=0,c=0,u=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(c,c+d.count);p=p.map(function(m,h){let g=r[u+h];return g.length>m.length?g:m}),d.value=this.join(p)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var W8=class extends kh{static{o(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=aIe}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
4015
+ `}o(WZ,"pageStyles");var D8={name:"dsh-edge",version:"0.13.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.2-rc.1"},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.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-schedule":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-in-process-driver":"0.1.2-rc.1","@deepseek-ai/dsh-subagent-spawn-in-process":"0.1.2-rc.1","@deepseek-ai/dsh-tool-subagent":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Qy=D8.version,HZ=D8.dshEdge.upstreamVersion;function X8e(){return"dsh-edge@0.13.0/isolated"}o(X8e,"resolveEdgeDeploymentId");function vh(e){return{baseURL:r7(e.DEEPSEEK_BASE_URL),maxTokens:a7(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Jl(e.DEEPSEEK_MODEL),reasoningEffort:i7(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:uy(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:s7(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:gh(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(vh,"resolveEdgeDeploymentConfig");function J8e(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}o(J8e,"edgeDeploymentApiKeyConfigured");function Q8e(e){let t=r7(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}o(Q8e,"projectedEdgeBaseURL");function M8(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:X8e(),apiKeyConfigured:J8e(e),baseURL:Q8e(e.DEEPSEEK_BASE_URL),maxTokens:a7(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Jl(e.DEEPSEEK_MODEL),reasoningEffort:i7(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:uy(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:s7(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:gh(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(M8,"resolveEdgeDeploymentProfile");function GZ(e){vh(e);let t=M8(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:Qy,upstreamVersion:HZ,status:"ready"}}o(GZ,"resolveEdgeDeploymentHealth");import{AsyncLocalStorage as gMe}from"node:async_hooks";import{WorkerEntrypoint as Gct}from"cloudflare:workers";var Dc=Bc(VZ(),1);var L8=o((e,t,n)=>{let r=e instanceof RegExp?ZZ(e,n):e,i=t instanceof RegExp?ZZ(t,n):t,s=r!==null&&i!=null&&Y8e(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),ZZ=o((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Y8e=o((e,t,n)=>{let r,i,s,a,l,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],s=n.length;d>=0&&!l;){if(d===c)r.push(d),c=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(l=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}r.length&&a!==void 0&&(l=[s,a])}return l},"range");var KZ="\0SLASH"+Math.random()+"\0",XZ="\0OPEN"+Math.random()+"\0",U8="\0CLOSE"+Math.random()+"\0",JZ="\0COMMA"+Math.random()+"\0",QZ="\0PERIOD"+Math.random()+"\0",eTe=new RegExp(KZ,"g"),tTe=new RegExp(XZ,"g"),nTe=new RegExp(U8,"g"),rTe=new RegExp(JZ,"g"),iTe=new RegExp(QZ,"g"),sTe=/\\\\/g,aTe=/\\{/g,oTe=/\\}/g,lTe=/\\,/g,cTe=/\\\./g,uTe=1e5,dTe=4e6;function j8(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}o(j8,"numeric");function pTe(e){return e.replace(sTe,KZ).replace(aTe,XZ).replace(oTe,U8).replace(lTe,JZ).replace(cTe,QZ)}o(pTe,"escapeBraces");function fTe(e){return e.replace(eTe,"\\").replace(tTe,"{").replace(nTe,"}").replace(rTe,",").replace(iTe,".")}o(fTe,"unescapeBraces");function YZ(e){if(!e)return[""];let t=[],n=L8("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";let l=YZ(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}o(YZ,"parseCommaParts");function eK(e,t={}){if(!e)return[];let{max:n=uTe,maxLength:r=dTe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),F8(pTe(e),n,r,!0).map(fTe)}o(eK,"expand");function hTe(e){return"{"+e+"}"}o(hTe,"embrace");function mTe(e){return/^-?0\d/.test(e)}o(mTe,"isPadded");function gTe(e,t){return e<=t}o(gTe,"lte");function yTe(e,t){return e>=t}o(yTe,"gte");function wh(e,t,n,r,i,s){let a=[],l=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=r)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(l+d.length>i)return a;a.push(d),l+=d.length}}return a}o(wh,"combine");function xTe(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let a=j8(i[0]),l=j8(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(j8(i[2])),1):1,d=gTe;l<a&&(u*=-1,d=yTe);let m=i.some(mTe),h=0;for(let g=a;d(g,l)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),m){let x=c-y.length;if(x>0){let b=new Array(x+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}o(xTe,"expandSequence");function F8(e,t,n,r){let i=[""],s=!1,a=!0;for(;;){let l=L8("{","}",e);if(!l)return wh(i,e,[""],t,n,s);let c=l.pre;if(/\$$/.test(c)){if(i=wh(i,c+"{"+l.body+"}",[""],t,n,s&&!l.post.length),a=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,m=l.body.indexOf(",")>=0;if(!p&&!m){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+U8+l.post,r=!0;continue}return wh(i,c+"{"+l.body+"}"+l.post,[""],t,n,s)}a&&(s=r&&!p,a=!1);let h;if(p)h=xTe(l.body,d,t,n);else{let g=YZ(l.body);if(g.length===1&&g[0]!==void 0&&(g=F8(g[0],t,n,!1).map(hTe),g.length===1)){if(i=wh(i,c+g[0],[""],t,n,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let b=0;y&&b<i.length;b++)i[b]&&(y=!1);h=[];let x=0;e:for(let b=0;b<g.length;b++){let w=F8(g[b],t,n,!1);for(let v=0;v<w.length;v++){let E=w[v];if(!(y&&!E)){if(h.length>=t||x+E.length>n)break e;h.push(E),x+=E.length}}}}if(i=wh(i,c,h,t,n,s&&!l.post.length),!l.post.length)break;e=l.post}return i}o(F8,"expand_");var Sh=o(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var bTe={"[: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]},Eh=o(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),vTe=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),tK=o(e=>e.join(""),"rangesToString"),nK=o((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,a=!1,l=!1,c=!1,u=!1,d=n,p="";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[x,[b,w,v]]of Object.entries(bTe))if(e.startsWith(x,s)){if(p)return["$.",!1,e.length-n,!0];s+=x.length,v?i.push(b):r.push(b),l=l||w;continue e}}if(c=!1,p){y>p?r.push(Eh(p)+"-"+Eh(y)):y===p&&r.push(Eh(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(Eh(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(Eh(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[vTe(y),!1,d-n,!1]}let m="["+(u?"^":"")+tK(r)+"]",h="["+(u?"":"^")+tK(i)+"]";return[r.length&&i.length?"("+m+"|"+h+")":r.length?m:h,l,d-n,!0]},"parseClass");var Go=o((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 pi,wTe=new Set(["!","?","+","*","@"]),B8=o(e=>wTe.has(e),"isExtglobType"),rK=o(e=>B8(e.type),"isExtglobAST"),STe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),ETe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),kTe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),iK=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),_Te="(?!(?:^|/)\\.\\.?(?:$|/))",e3="(?!\\.)",ATe=new Set(["[","."]),TTe=new Set(["..","."]),ITe=new Set("().*{}+?[]^$\\!"),CTe=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),q8="[^/]",sK=q8+"*?",aK=q8+"+?",RTe=0,xc=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#d=!1;#l;#a;#c=!1;id=++RTe;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,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?r:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#d&&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("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof pi&&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.#d&&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 r=t.#t[n];if(!(r instanceof pi&&r.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 pi(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let a=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=r,x="";for(;y<t.length;){let b=t.charAt(y++);if(l||b==="\\"){l=!l,x+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),x+=b;continue}else if(b==="["){c=!0,u=y,d=!1,x+=b;continue}if(!i.noext&&B8(b)&&t.charAt(y)==="("&&s<=a){n.push(x),x="";let v=new pi(b,n);y=pi.#m(t,v,y,i,s+1),n.push(v);continue}x+=b}return n.push(x),y}let p=r+1,m=new pi(null,n),h=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&B8(y)&&t.charAt(p)==="("&&(s<=a||n&&n.#y(y))){let b=n&&n.#y(y)?0:1;m.push(g),g="";let w=new pi(y,m);m.push(w),p=pi.#m(t,w,p,i,s+b);continue}if(y==="|"){m.push(g),g="",h.push(m),m=new pi(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),m.push(g),g="",n.push(...h,m),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#$(t){return this.#g(t,ETe)}#g(t,n=STe){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=kTe){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new pi(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#a=void 0}#A(t){return!!iK.get(this.type)?.has(t)}#P(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.#A(n.type)}#x(t){let n=iK.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let r=new pi(null,void 0,n);return pi.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,l),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!rK(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,x,b]=typeof h=="string"?pi.#T(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||x,this.#r=this.#r||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&TTe.has(this.#t[0]))){let g=ATe,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),x=!n&&!t&&g.has(u.charAt(0));d=y?_Te:x?e3:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,Go(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(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,Go(this.toString()),!1,!1]}let a=!r||t||n||!e3?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!n?e3:"")+aK;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?e3:"")+sK+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=i+s+c}return[l,Go(s),this.#n=!!this.#n,this.#r]}#f(){if(rK(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#$(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#x(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#a=void 0}#b(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#T(t,n,r=!1){let i=!1,s="",a=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(ITe.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(t)?aK:sK,n=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,m,h]=nK(t,c);if(m){s+=d,a=a||p,c+=m-1,n=n||h;continue}}if(u==="?"){s+=q8,n=!0;continue}s+=CTe(u)}return[s,Go(t),!!n,a]}};pi=xc;var z8=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var xr=o((e,t,n={})=>(Sh(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Sd(t,n).match(e)),"minimatch"),NTe=/^\*+([^+@!?*[(]*)$/,OTe=o(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),$Te=o(e=>t=>t.endsWith(e),"starDotExtTestDot"),PTe=o(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),DTe=o(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),MTe=/^\*+\.\*+$/,LTe=o(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),jTe=o(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),FTe=/^\.\*+$/,UTe=o(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),BTe=/^\*+$/,qTe=o(e=>e.length!==0&&!e.startsWith("."),"starTest"),zTe=o(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),WTe=/^\?+([^+@!?*[(]*)?$/,HTe=o(([e,t=""])=>{let n=cK([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),GTe=o(([e,t=""])=>{let n=uK([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),VTe=o(([e,t=""])=>{let n=uK([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),ZTe=o(([e,t=""])=>{let n=cK([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),cK=o(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),uK=o(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),dK=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",oK={win32:{sep:"\\"},posix:{sep:"/"}},KTe=dK==="win32"?oK.win32.sep:oK.posix.sep;xr.sep=KTe;var Br=Symbol("globstar **");xr.GLOBSTAR=Br;var XTe="[^/]",JTe=XTe+"*?",QTe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",YTe="(?:(?!(?:\\/|^)\\.).)*?",eIe=o((e,t={})=>n=>xr(n,e,t),"filter");xr.filter=eIe;var Vi=o((e,t={})=>Object.assign({},e,t),"ext"),tIe=o(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return xr;let t=xr;return Object.assign(o((r,i,s={})=>t(r,i,Vi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,Vi(e,s))}static defaults(i){return t.defaults(Vi(e,i)).Minimatch}},AST:class extends t.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,Vi(e,a))}static fromGlob(i,s={}){return t.AST.fromGlob(i,Vi(e,s))}},unescape:o((r,i={})=>t.unescape(r,Vi(e,i)),"unescape"),escape:o((r,i={})=>t.escape(r,Vi(e,i)),"escape"),filter:o((r,i={})=>t.filter(r,Vi(e,i)),"filter"),defaults:o(r=>t.defaults(Vi(e,r)),"defaults"),makeRe:o((r,i={})=>t.makeRe(r,Vi(e,i)),"makeRe"),braceExpand:o((r,i={})=>t.braceExpand(r,Vi(e,i)),"braceExpand"),match:o((r,i,s={})=>t.match(r,i,Vi(e,s)),"match"),sep:t.sep,GLOBSTAR:Br})},"defaults");xr.defaults=tIe;var pK=o((e,t={})=>(Sh(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:eK(e,{max:t.braceExpandMax})),"braceExpand");xr.braceExpand=pK;var nIe=o((e,t={})=>new Sd(e,t).makeRe(),"makeRe");xr.makeRe=nIe;var rIe=o((e,t,n={})=>{let r=new Sd(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");xr.match=rIe;var lK=/[?*]|[+@!]\(.*?\)|\[|\]/,iIe=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Sd=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){Sh(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||dK,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!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 r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!lK.test(s[2]))&&!lK.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 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 r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");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 r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let l=r[a];a===1&&l===""&&r[0]===""||(l==="."||l==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,a=[],l="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])a.push(l==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])a.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])a.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(l==="b")return!1;l="a",a.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="b",a.push(n[s]),i++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&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]),p=c?3:l?0:void 0,m=d?3:u?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[h,g]=[t[p],n[m]];h.toLowerCase()===g.toLowerCase()&&(n[m]=h,s=m,i=p)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Br)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let a=n.indexOf(Br,s),l=n.lastIndexOf(Br),[c,u,d]=r?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,l),n.slice(l+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#r(w,c,r,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#r(t,d,r,w,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#r(t,d,r,w,0)))return!1;p=d.length+1}}if(!u.length){let w=!!p;for(let v=i;v<t.length-p;v++){let E=String(t[v]);if(w=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||w}let m=[[[],0]],h=m[0],g=0,y=[0];for(let w of u)w===Br?(y.push(g),h=[[],0],m.push(h)):(h[0].push(w),g++);let x=m.length-1,b=t.length-p;for(let w of m)w[1]=b-(y[x--]+w[0].length);return!!this.#n(t,m,i,0,r,0,!!p)}#n(t,n,r,i,s,a,l){let c=n[i];if(!c){for(let p=r;p<t.length;p++){l=!0;let m=t[p];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return l}let[u,d]=c;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,r+u.length,i+1,s,a+1,l);if(h!==!1)return h}let m=t[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let a,l,c,u;for(a=i,l=s,u=t.length,c=n.length;a<u&&l<c;a++,l++){this.debug("matchOne loop");let d=n[l],p=t[a];if(this.debug(n,d,p),d===!1||d===Br)return!1;let m;if(typeof d=="string"?(m=p===d,this.debug("string match",d,p,m)):(m=d.test(p),this.debug("pattern match",d,p,m)),!m)return!1}if(a===u&&l===c)return!0;if(a===u)return r;if(l===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return pK(this.pattern,this.options)}parse(t){Sh(t);let n=this.options;if(t==="**")return Br;if(t==="")return"";let r,i=null;(r=t.match(BTe))?i=n.dot?zTe:qTe:(r=t.match(NTe))?i=(n.nocase?n.dot?DTe:PTe:n.dot?$Te:OTe)(r[1]):(r=t.match(WTe))?i=(n.nocase?n.dot?GTe:HTe:n.dot?VTe:ZTe)(r):(r=t.match(MTe))?i=n.dot?jTe:LTe:(r=t.match(FTe))&&(i=UTe);let s=xc.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 n=this.options,r=n.noglobstar?JTe:n.dot?QTe:YTe,i=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))i.add(m);return typeof p=="string"?iIe(p):p===Br?Br:p._src});u.forEach((p,m)=>{let h=u[m+1],g=u[m-1];p!==Br||g===Br||(g===void 0?h!==void 0&&h!==Br?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=g+"(?:\\/|\\/"+r+")?":h!==Br&&(u[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=Br))});let d=u.filter(p=>p!==Br);if(this.partial&&d.length>=1){let p=[];for(let m=1;m<=d.length;m++)p.push(d.slice(0,m).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+l+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+l+")$"),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,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 r=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 a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return xr.defaults(t).Minimatch}};xr.AST=xc;xr.Minimatch=Sd;xr.escape=z8;xr.unescape=Go;import{gunzipSync as ICe}from"node:zlib";var kh=class{static{o(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),a=this.castInput(n,r),l=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(l,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;let a=o(w=>{if(w=this.postProcess(w,r),i){setTimeout(function(){i(w)},0);return}else return w},"done"),l=n.length,c=t.length,u=1,d=l+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&g+1>=l)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,x=1/0,b=o(()=>{for(let w=Math.max(y,-u);w<=Math.min(x,u);w+=2){let v,E=h[w-1],S=h[w+1];E&&(h[w-1]=void 0);let _=!1;if(S){let $=S.oldPos-w;_=S&&0<=$&&$<l}let T=E&&E.oldPos+1<c;if(!_&&!T){h[w]=void 0;continue}if(!T||_&&E.oldPos<S.oldPos?v=this.addToPath(S,!0,!1,0,r):v=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(v,n,t,w,r),v.oldPos+1>=c&&g+1>=l)return a(this.buildValues(v.lastComponent,n,t))||!0;h[w]=v,v.oldPos+1>=c&&(x=Math.min(x,w-1)),g+1>=l&&(y=Math.max(y,w+1))}u++},"execEditLength");if(i)o(function w(){setTimeout(function(){if(u>d||Date.now()>m)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=m;){let w=b();if(w)return w}}addToPath(t,n,r,i,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){let a=n.length,l=r.length,c=t.oldPos,u=c-i,d=0;for(;u+1<a&&c+1<l&&this.equals(r[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,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);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,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let a=i.length,l=0,c=0,u=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(c,c+d.count);p=p.map(function(m,h){let g=r[u+h];return g.length>m.length?g:m}),d.value=this.join(p)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var W8=class extends kh{static{o(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=aIe}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
4016
4016
  `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
4017
4017
  `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
4018
4018
  `)&&(t=t.slice(0,-1)),n.endsWith(`