dsh-edge 0.2.0-alpha.3 → 0.2.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/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # last confirmed-consistent state. Both languages carry equal authority.
3
3
  # After editing either side, update both and re-record every pair with:
4
4
  # pnpm run doc-pairs -- --write
5
- README.md: 6677bc90acde245bf00f9cacf27c800c1320caf3
6
- README.zh.md: 899072d815abafe399c8561999a07c8c3cb12474
5
+ README.md: 65798a580140d2f74122b8f6aeb48cb8c2e89ec2
6
+ README.zh.md: f439f9a6a2dda97cbdf1148ac92b6d6cc5aa8427
package/README.md CHANGED
@@ -146,23 +146,23 @@ The same file also defines `env.isolated`, a complete Workers Paid target with t
146
146
 
147
147
  `wrangler.jsonc` remains the single canonical configuration for both modes. Release packaging builds one tested, minified Worker artifact per mode from the workspace sources. Direct mode replaces only Computer's unreachable Dynamic Worker shell-core module at build time; the Computer workspace adapter and command exports remain the upstream implementations. Isolated mode preserves that shell core but replaces the unreachable Direct backend with a fail-closed module, so each artifact carries only its selected command runtime. The published installer generates a private mode-specific configuration that points at the selected artifact and asks Wrangler to upload it with `no_bundle`; the user's machine does not rebuild dsh-edge or resolve the upstream Harness packages into a new Worker. CI starts the Direct artifact from an installed tarball and rejects it above a 900 KiB compressed budget, leaving headroom below the 1 MiB limit enforced by Cloudflare's anonymous temporary-account upload path.
148
148
 
149
- Run the current 0.2 prerelease installer from the `next` channel without cloning this repository:
149
+ Run the stable installer without cloning this repository:
150
150
 
151
151
  ```sh
152
- npx dsh-edge@next install
152
+ npx dsh-edge install
153
153
  ```
154
154
 
155
- Use `npx dsh-edge@latest install` for the stable channel, which remains on 0.1.3 until 0.2 is promoted.
155
+ This resolves through npm's `latest` channel. Use `npx dsh-edge@next install` only when intentionally testing a future prerelease.
156
156
 
157
157
  Upgrade an existing named Worker with the same runtime choice. The deployment keeps its Durable Object data; because Cloudflare secrets are write-only, the upgrade asks for the owner access key and DeepSeek API key again and replaces their active values:
158
158
 
159
- Use the same channel as the installed release. A 0.2 prerelease follows `next`:
159
+ For a stable deployment, run:
160
160
 
161
161
  ```sh
162
- npx dsh-edge@next upgrade
162
+ npx dsh-edge upgrade
163
163
  ```
164
164
 
165
- Stable deployments use `npx dsh-edge@latest upgrade`. The Edge settings page derives the channel from the installed version and copies the matching command.
165
+ If the installed version is a 0.2 alpha, promote it to the stable channel once with `npx dsh-edge@latest upgrade`; prerelease deployments otherwise remain on `next`. The Edge settings page derives the channel from the installed version and copies the matching command.
166
166
 
167
167
  The installer asks for the runtime before the account. The recommended `Free — Direct Shell` mode works on Workers Free and can use a detected Cloudflare account, open Cloudflare sign-in or registration, or create a temporary account without login. `Isolated — Dynamic Worker` requires Workers Paid and therefore offers only a detected or newly authenticated account. Cloudflare does not expose a reliable local entitlement check for Worker Loader, so an isolated install lets Cloudflare authorize the upload and turns a rejection into a choice between enabling Workers Paid and using direct mode.
168
168
 
package/README.zh.md CHANGED
@@ -146,23 +146,23 @@ Cloudflare static assets -> upstream Web shell + client plugin graph
146
146
 
147
147
  `wrangler.jsonc` 仍然是两种模式唯一的 canonical configuration。发布打包会从 workspace 源码为每种模式构建一个经过测试、已 minify 的 Worker artifact。Direct 模式只在构建时替换 Computer 中不可达的 Dynamic Worker shell-core module;Computer workspace adapter 与 command export 仍使用上游实现。Isolated 模式保留该 shell core,但把不可达的 Direct backend 替换成 fail-closed module,因此每个 artifact 都只携带所选 command runtime。发布的安装器会生成私有的 mode-specific configuration,指向所选 artifact,并要求 Wrangler 使用 `no_bundle` 上传;用户机器不会重新构建 dsh-edge,也不会把上游 Harness package 解析进一个新的 Worker。CI 会从已安装的 tarball 启动 Direct artifact,并拒绝压缩后超过 900 KiB 的产物,从而在 Cloudflare 匿名临时账户上传路径强制执行的 1 MiB 上限下保留余量。
148
148
 
149
- 无需克隆仓库,即可从 `next` 渠道运行当前 0.2 预发布安装器:
149
+ 无需克隆仓库,即可运行稳定版安装器:
150
150
 
151
151
  ```sh
152
- npx dsh-edge@next install
152
+ npx dsh-edge install
153
153
  ```
154
154
 
155
- 稳定渠道使用 `npx dsh-edge@latest install`;在 0.2 正式晋级前,它仍指向 0.1.3。
155
+ 该命令通过 npm `latest` 渠道解析。只有在明确测试未来预发布版本时,才使用 `npx dsh-edge@next install`。
156
156
 
157
157
  选择相同 runtime 并输入现有 Worker 名称即可升级。部署会保留 Durable Object 数据;由于 Cloudflare secret 只能写入而不能读取,升级会再次要求 owner access key 与 DeepSeek API key,并用输入值替换当前生效值:
158
158
 
159
- 升级时使用与已安装版本相同的渠道。0.2 预发布版本跟随 `next`:
159
+ 稳定部署运行:
160
160
 
161
161
  ```sh
162
- npx dsh-edge@next upgrade
162
+ npx dsh-edge upgrade
163
163
  ```
164
164
 
165
- 稳定部署使用 `npx dsh-edge@latest upgrade`。Edge 设置页会根据已安装版本推导渠道,并复制匹配的命令。
165
+ 如果当前安装的是 0.2 alpha,需要执行一次 `npx dsh-edge@latest upgrade` 晋级到稳定渠道;其他预发布部署仍跟随 `next`。Edge 设置页会根据已安装版本推导渠道,并复制匹配的命令。
166
166
 
167
167
  安装器会先询问运行时,再询问账户。推荐的 `Free — Direct Shell` 模式可在 Workers Free 上运行,并可使用检测到的 Cloudflare 账户、打开 Cloudflare 登录或注册,也可在不登录的情况下创建临时账户。`Isolated — Dynamic Worker` 需要 Workers Paid,因此只提供已检测到或新认证的账户。Cloudflare 没有提供可靠的本地 Worker Loader entitlement 检查;isolated 安装会由 Cloudflare 对上传进行授权,并在被拒绝时提示启用 Workers Paid 或改用 direct 模式。
168
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-edge",
3
- "version": "0.2.0-alpha.3",
3
+ "version": "0.2.0",
4
4
  "description": "Run DeepSeek Harness on Cloudflare Workers as an independent community project",
5
5
  "author": "pawaca",
6
6
  "license": "MIT",
@@ -677,7 +677,7 @@ ${n}`:""}`}});function hO(e){if(e.url.trim().length===0)throw new Error("url mus
677
677
  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; }
678
678
  .secondary { background: #29314b; color: #edf2ff; }
679
679
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
680
- `}l(hC,"pageStyles");var YS={name:"dsh-edge",version:"0.2.0-alpha.3",description:"Run DeepSeek Harness on Cloudflare Workers as an independent community project",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/tree/master/apps/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","agent","cloudflare-workers","durable-objects"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.0-rc.8"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.0-rc.8","@deepseek-ai/dsh-agent-loop":"0.1.0-rc.8","@deepseek-ai/dsh-anonymous-user-id":"0.1.0-rc.8","@deepseek-ai/dsh-brand":"0.1.0-rc.8","@deepseek-ai/dsh-credentials":"0.1.0-rc.8","@deepseek-ai/dsh-host-apiproxy":"0.1.0-rc.8","@deepseek-ai/dsh-launch-environment":"0.1.0-rc.8","@deepseek-ai/dsh-llm":"0.1.0-rc.8","@deepseek-ai/dsh-llm-deepseek":"0.1.0-rc.8","@deepseek-ai/dsh-session":"0.1.0-rc.8","@deepseek-ai/dsh-session-persistence":"0.1.0-rc.8","@deepseek-ai/dsh-session-query":"0.1.0-rc.8","@deepseek-ai/dsh-session-title":"0.1.0-rc.8","@deepseek-ai/dsh-settings":"0.1.0-rc.8","@deepseek-ai/dsh-system-prompt":"0.1.0-rc.8","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.0-rc.8","@deepseek-ai/dsh-tool-web":"0.1.0-rc.8","@deepseek-ai/dsh-tools":"0.1.0-rc.8","@deepseek-ai/dsh-web":"0.1.0-rc.8","@deepseek-ai/dsh-web-search-deepseek":"0.1.0-rc.8","just-bash":"3.3.0",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Vm=YS.version,mC=YS.dshEdge.upstreamVersion;function Coe(){return"dsh-edge@0.2.0-alpha.3/direct"}l(Coe,"resolveEdgeDeploymentId");function Zm(e){return QO(e.DEEPSEEK_API_KEY),{baseURL:pS(e.DEEPSEEK_BASE_URL),maxTokens:mS(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Td(e.DEEPSEEK_MODEL),reasoningEffort:fS(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Lm(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:hS(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Pd(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Zm,"resolveEdgeDeploymentConfig");function Noe(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Noe,"edgeDeploymentApiKeyConfigured");function Roe(e){let t=pS(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(Roe,"projectedEdgeBaseURL");function JS(e){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",deploymentId:Coe(),apiKeyConfigured:Noe(e),baseURL:Roe(e.DEEPSEEK_BASE_URL),maxTokens:mS(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Td(e.DEEPSEEK_MODEL),reasoningEffort:fS(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Lm(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:hS(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Pd(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(JS,"resolveEdgeDeploymentProfile");function gC(e){Zm(e);let t=JS(e);return{ok:!0,service:"dsh-edge",storage:t.storage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:Vm,upstreamVersion:mC,status:"ready"}}l(gC,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as jCe}from"cloudflare:workers";var hl=f7(yC());var XS=l((e,t,r)=>{let n=e instanceof RegExp?vC(e,r):e,i=t instanceof RegExp?vC(t,r):t,s=n!==null&&i!=null&&Poe(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"),vC=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),Poe=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 wC="\0SLASH"+Math.random()+"\0",bC="\0OPEN"+Math.random()+"\0",t6="\0CLOSE"+Math.random()+"\0",xC="\0COMMA"+Math.random()+"\0",EC="\0PERIOD"+Math.random()+"\0",Doe=new RegExp(wC,"g"),Loe=new RegExp(bC,"g"),Moe=new RegExp(t6,"g"),Foe=new RegExp(xC,"g"),joe=new RegExp(EC,"g"),zoe=/\\\\/g,Uoe=/\\{/g,Boe=/\\}/g,Woe=/\\,/g,qoe=/\\\./g,Hoe=1e5,Goe=4e6;function QS(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(QS,"numeric");function Voe(e){return e.replace(zoe,wC).replace(Uoe,bC).replace(Boe,t6).replace(Woe,xC).replace(qoe,EC)}l(Voe,"escapeBraces");function Zoe(e){return e.replace(Doe,"\\").replace(Loe,"{").replace(Moe,"}").replace(Foe,",").replace(joe,".")}l(Zoe,"unescapeBraces");function SC(e){if(!e)return[""];let t=[],r=XS("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=SC(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(SC,"parseCommaParts");function kC(e,t={}){if(!e)return[];let{max:r=Hoe,maxLength:n=Goe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),e6(Voe(e),r,n,!0).map(Zoe)}l(kC,"expand");function Koe(e){return"{"+e+"}"}l(Koe,"embrace");function Yoe(e){return/^-?0\d/.test(e)}l(Yoe,"isPadded");function Joe(e,t){return e<=t}l(Joe,"lte");function Xoe(e,t){return e>=t}l(Xoe,"gte");function Fd(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(Fd,"combine");function Qoe(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=QS(i[0]),a=QS(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(QS(i[2])),1):1,d=Joe;a<o&&(u*=-1,d=Xoe);let f=i.some(Yoe),h=0;for(let m=o;d(m,a)&&s.length<r;m+=u){let g;if(t)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),f){let y=c-g.length;if(y>0){let b=new Array(y+1).join("0");m<0?g="-"+b+g.slice(1):g=b+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(Qoe,"expandSequence");function e6(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=XS("{","}",e);if(!a)return Fd(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=Fd(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,f=a.body.indexOf(",")>=0;if(!p&&!f){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+t6+a.post,n=!0;continue}return Fd(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!p,o=!1);let h;if(p)h=Qoe(a.body,d,t,r);else{let m=SC(a.body);if(m.length===1&&m[0]!==void 0&&(m=e6(m[0],t,r,!1).map(Koe),m.length===1)){if(i=Fd(i,c+m[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let g=s&&!a.post.length&&!c;for(let b=0;g&&b<i.length;b++)i[b]&&(g=!1);h=[];let y=0;e:for(let b=0;b<m.length;b++){let w=e6(m[b],t,r,!1);for(let x=0;x<w.length;x++){let k=w[x];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=Fd(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(e6,"expand_");var jd=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var eae={"[: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]},zd=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),tae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),AC=l(e=>e.join(""),"rangesToString"),$C=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 g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){u=!0,s++;continue}if(g==="]"&&o&&!c){d=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(let[y,[b,w,x]]of Object.entries(eae))if(e.startsWith(y,s)){if(p)return["$.",!1,e.length-r,!0];s+=y.length,x?i.push(b):n.push(b),a=a||w;continue e}}if(c=!1,p){g>p?n.push(zd(p)+"-"+zd(g)):g===p&&n.push(zd(g)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push(zd(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=g,s+=2;continue}n.push(zd(g)),s++}if(d<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let g=n[0].length===2?n[0].slice(-1):n[0];return[tae(g),!1,d-r,!1]}let f="["+(u?"^":"")+AC(n)+"]",h="["+(u?"":"^")+AC(i)+"]";return[n.length&&i.length?"("+f+"|"+h+")":n.length?f:h,a,d-r,!0]},"parseClass");var zo=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var Ln,rae=new Set(["!","?","+","*","@"]),r6=l(e=>rae.has(e),"isExtglobType"),IC=l(e=>r6(e.type),"isExtglobAST"),nae=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),iae=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),sae=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),_C=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),oae="(?!(?:^|/)\\.\\.?(?:$|/))",Ym="(?!\\.)",aae=new Set(["[","."]),lae=new Set(["..","."]),cae=new Set("().*{}+?[]^$\\!"),uae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),n6="[^/]",TC=n6+"*?",OC=n6+"+?",dae=0,Ma=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++dae;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#u&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Ln&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Ln&&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 Ln(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#h(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let g=n,y="";for(;g<t.length;){let b=t.charAt(g++);if(a||b==="\\"){a=!a,y+=b;continue}if(c){g===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(g===u+2&&d)&&(c=!1),y+=b;continue}else if(b==="["){c=!0,u=g,d=!1,y+=b;continue}if(!i.noext&&r6(b)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let x=new Ln(b,r);g=Ln.#h(t,x,g,i,s+1),r.push(x);continue}y+=b}return r.push(y),g}let p=n+1,f=new Ln(null,r),h=[],m="";for(;p<t.length;){let g=t.charAt(p++);if(a||g==="\\"){a=!a,m+=g;continue}if(c){p===u+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(p===u+2&&d)&&(c=!1),m+=g;continue}else if(g==="["){c=!0,u=p,d=!1,m+=g;continue}if(!i.noext&&r6(g)&&t.charAt(p)==="("&&(s<=o||r&&r.#g(g))){let b=r&&r.#g(g)?0:1;f.push(m),m="";let w=new Ln(g,f);f.push(w),p=Ln.#h(t,w,p,i,s+b);continue}if(g==="|"){f.push(m),m="",h.push(f),f=new Ln(null,r);continue}if(g===")")return m===""&&r.#t.length===0&&(r.#c=!0),f.push(m),m="",r.push(...h,f),p;m+=g}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],p}#O(t){return this.#m(t,iae)}#m(t,r=nae){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#g(n.type,r)}#g(t,r=sae){return!!r.get(this.type)?.includes(t)}#p(t,r){let n=t.#t[0],i=new Ln(null,n,this.options);i.#t.push(""),n.push(i),this.#E(t,r)}#E(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#S(t){return!!_C.get(this.type)?.has(t)}#C(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#S(r.type)}#y(t){let r=_C.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 Ln(null,void 0,r);return Ln.#h(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#x()),!IC(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,b]=typeof h=="string"?Ln.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||b,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&lae.has(this.#t[0]))){let m=aae,g=r&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),y=!r&&!t&&m.has(u.charAt(0));d=g?oae:y?Ym:""}let p="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,zo(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#r=void 0,[c,zo(this.toString()),!1,!1]}let o=!n||t||r||!Ym?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Ym:"")+OC;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Ym:"")+TC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,zo(s),this.#r=!!this.#r,this.#n]}#f(){if(IC(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.#m(i)?(r=!1,this.#E(i,n)):this.#O(i)?(r=!1,this.#p(i,n)):this.#C(i)&&(r=!1,this.#y(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#v(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(t,r,n=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(cae.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?OC:TC,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,f,h]=$C(t,c);if(f){s+=d,o=o||p,c+=f-1,r=r||h;continue}}if(u==="?"){s+=n6,r=!0;continue}s+=uae(u)}return[s,zo(t),!!r,o]}};Ln=Ma;var i6=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 Gr=l((e,t,r={})=>(jd(t),!r.nocomment&&t.charAt(0)==="#"?!1:new fc(t,r).match(e)),"minimatch"),pae=/^\*+([^+@!?*[(]*)$/,fae=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),hae=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),mae=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),gae=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),yae=/^\*+\.\*+$/,vae=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),wae=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),bae=/^\.\*+$/,xae=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Eae=/^\*+$/,Sae=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),kae=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Aae=/^\?+([^+@!?*[(]*)?$/,$ae=l(([e,t=""])=>{let r=RC([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Iae=l(([e,t=""])=>{let r=PC([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),_ae=l(([e,t=""])=>{let r=PC([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),Tae=l(([e,t=""])=>{let r=RC([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),RC=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),PC=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),DC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",CC={win32:{sep:"\\"},posix:{sep:"/"}},Oae=DC==="win32"?CC.win32.sep:CC.posix.sep;Gr.sep=Oae;var pn=Symbol("globstar **");Gr.GLOBSTAR=pn;var Cae="[^/]",Nae=Cae+"*?",Rae="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Pae="(?:(?!(?:\\/|^)\\.).)*?",Dae=l((e,t={})=>r=>Gr(r,e,t),"filter");Gr.filter=Dae;var pi=l((e,t={})=>Object.assign({},e,t),"ext"),Lae=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Gr;let t=Gr;return Object.assign(l((n,i,s={})=>t(n,i,pi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,pi(e,s))}static defaults(i){return t.defaults(pi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,pi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,pi(e,s))}},unescape:l((n,i={})=>t.unescape(n,pi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,pi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,pi(e,i)),"filter"),defaults:l(n=>t.defaults(pi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,pi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,pi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,pi(e,s)),"match"),sep:t.sep,GLOBSTAR:pn})},"defaults");Gr.defaults=Lae;var LC=l((e,t={})=>(jd(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:kC(e,{max:t.braceExpandMax})),"braceExpand");Gr.braceExpand=LC;var Mae=l((e,t={})=>new fc(e,t).makeRe(),"makeRe");Gr.makeRe=Mae;var Fae=l((e,t,r={})=>{let n=new fc(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Gr.match=Fae;var NC=/[?*]|[+@!]\(.*?\)|\[|\]/,jae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),fc=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={}){jd(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||DC,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]==="?"||!NC.test(s[2]))&&!NC.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,f=d?3:u?0:void 0;if(typeof p=="number"&&typeof f=="number"){let[h,m]=[t[p],r[f]];h.toLowerCase()===m.toLowerCase()&&(r[f]=h,s=f,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(pn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(pn,s),a=r.lastIndexOf(pn),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,a),r.slice(a+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#n(w,c,n,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#n(t,d,n,w,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#n(t,d,n,w,0)))return!1;p=d.length+1}}if(!u.length){let w=!!p;for(let x=i;x<t.length-p;x++){let k=String(t[x]);if(w=!0,k==="."||k===".."||!this.options.dot&&k.startsWith("."))return!1}return n||w}let f=[[[],0]],h=f[0],m=0,g=[0];for(let w of u)w===pn?(g.push(m),h=[[],0],f.push(h)):(h[0].push(w),m++);let y=f.length-1,b=t.length-p;for(let w of f)w[1]=b-(g[y--]+w[0].length);return!!this.#r(t,f,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 f=t[p];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return a}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(h!==!1)return h}let f=t[n];if(f==="."||f===".."||!this.options.dot&&f.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===pn)return!1;let f;if(typeof d=="string"?(f=p===d,this.debug("string match",d,p,f)):(f=d.test(p),this.debug("pattern match",d,p,f)),!f)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 LC(this.pattern,this.options)}parse(t){jd(t);let r=this.options;if(t==="**")return pn;if(t==="")return"";let n,i=null;(n=t.match(Eae))?i=r.dot?kae:Sae:(n=t.match(pae))?i=(r.nocase?r.dot?gae:mae:r.dot?hae:fae)(n[1]):(n=t.match(Aae))?i=(r.nocase?r.dot?Iae:$ae:r.dot?_ae:Tae)(n):(n=t.match(yae))?i=r.dot?wae:vae:(n=t.match(bae))&&(i=xae);let s=Ma.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?Nae:r.dot?Rae:Pae,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let f of p.flags.split(""))i.add(f);return typeof p=="string"?jae(p):p===pn?pn:p._src});u.forEach((p,f)=>{let h=u[f+1],m=u[f-1];p!==pn||m===pn||(m===void 0?h!==void 0&&h!==pn?u[f+1]="(?:\\/|"+n+"\\/)?"+h:u[f]=n:h===void 0?u[f-1]=m+"(?:\\/|\\/"+n+")?":h!==pn&&(u[f-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[f+1]=pn))});let d=u.filter(p=>p!==pn);if(this.partial&&d.length>=1){let p=[];for(let f=1;f<=d.length;f++)p.push(d.slice(0,f).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 Gr.defaults(t).Minimatch}};Gr.AST=Ma;Gr.Minimatch=fc;Gr.escape=i6;Gr.unescape=zo;import{gunzipSync as jce}from"node:zlib";var Ud=class{static{l(this,"Diff")}diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=l(w=>{if(w=this.postProcess(w,n),i){setTimeout(function(){i(w)},0);return}else return w},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let p=(s=n.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&m+1>=a)return o(this.buildValues(h[0].lastComponent,r,t));let g=-1/0,y=1/0,b=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let x,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let C=S.oldPos-w;A=S&&0<=C&&C<a}let I=k&&k.oldPos+1<c;if(!A&&!I){h[w]=void 0;continue}if(!I||A&&k.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,n):x=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(x,r,t,w,n),x.oldPos+1>=c&&m+1>=a)return o(this.buildValues(x.lastComponent,r,t))||!0;h[w]=x,x.oldPos+1>=c&&(y=Math.min(y,w-1)),m+1>=a&&(g=Math.max(g,w+1))}u++},"execEditLength");if(i)l(function w(){setTimeout(function(){if(u>d||Date.now()>f)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=f;){let w=b();if(w)return w}}addToPath(t,r,n,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){let o=r.length,a=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,a=0,c=0,u=0;for(;a<o;a++){let d=i[a];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=r.slice(c,c+d.count);p=p.map(function(f,h){let m=n[u+h];return m.length>f.length?m:f}),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 s6=class extends Ud{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Uae}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
680
+ `}l(hC,"pageStyles");var YS={name:"dsh-edge",version:"0.2.0",description:"Run DeepSeek Harness on Cloudflare Workers as an independent community project",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/tree/master/apps/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","agent","cloudflare-workers","durable-objects"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.0-rc.8"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.0-rc.8","@deepseek-ai/dsh-agent-loop":"0.1.0-rc.8","@deepseek-ai/dsh-anonymous-user-id":"0.1.0-rc.8","@deepseek-ai/dsh-brand":"0.1.0-rc.8","@deepseek-ai/dsh-credentials":"0.1.0-rc.8","@deepseek-ai/dsh-host-apiproxy":"0.1.0-rc.8","@deepseek-ai/dsh-launch-environment":"0.1.0-rc.8","@deepseek-ai/dsh-llm":"0.1.0-rc.8","@deepseek-ai/dsh-llm-deepseek":"0.1.0-rc.8","@deepseek-ai/dsh-session":"0.1.0-rc.8","@deepseek-ai/dsh-session-persistence":"0.1.0-rc.8","@deepseek-ai/dsh-session-query":"0.1.0-rc.8","@deepseek-ai/dsh-session-title":"0.1.0-rc.8","@deepseek-ai/dsh-settings":"0.1.0-rc.8","@deepseek-ai/dsh-system-prompt":"0.1.0-rc.8","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.0-rc.8","@deepseek-ai/dsh-tool-web":"0.1.0-rc.8","@deepseek-ai/dsh-tools":"0.1.0-rc.8","@deepseek-ai/dsh-web":"0.1.0-rc.8","@deepseek-ai/dsh-web-search-deepseek":"0.1.0-rc.8","just-bash":"3.3.0",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Vm=YS.version,mC=YS.dshEdge.upstreamVersion;function Coe(){return"dsh-edge@0.2.0/direct"}l(Coe,"resolveEdgeDeploymentId");function Zm(e){return QO(e.DEEPSEEK_API_KEY),{baseURL:pS(e.DEEPSEEK_BASE_URL),maxTokens:mS(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Td(e.DEEPSEEK_MODEL),reasoningEffort:fS(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Lm(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:hS(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Pd(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Zm,"resolveEdgeDeploymentConfig");function Noe(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Noe,"edgeDeploymentApiKeyConfigured");function Roe(e){let t=pS(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(Roe,"projectedEdgeBaseURL");function JS(e){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",deploymentId:Coe(),apiKeyConfigured:Noe(e),baseURL:Roe(e.DEEPSEEK_BASE_URL),maxTokens:mS(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Td(e.DEEPSEEK_MODEL),reasoningEffort:fS(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Lm(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:hS(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Pd(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(JS,"resolveEdgeDeploymentProfile");function gC(e){Zm(e);let t=JS(e);return{ok:!0,service:"dsh-edge",storage:t.storage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:Vm,upstreamVersion:mC,status:"ready"}}l(gC,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as jCe}from"cloudflare:workers";var hl=f7(yC());var XS=l((e,t,r)=>{let n=e instanceof RegExp?vC(e,r):e,i=t instanceof RegExp?vC(t,r):t,s=n!==null&&i!=null&&Poe(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"),vC=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),Poe=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 wC="\0SLASH"+Math.random()+"\0",bC="\0OPEN"+Math.random()+"\0",t6="\0CLOSE"+Math.random()+"\0",xC="\0COMMA"+Math.random()+"\0",EC="\0PERIOD"+Math.random()+"\0",Doe=new RegExp(wC,"g"),Loe=new RegExp(bC,"g"),Moe=new RegExp(t6,"g"),Foe=new RegExp(xC,"g"),joe=new RegExp(EC,"g"),zoe=/\\\\/g,Uoe=/\\{/g,Boe=/\\}/g,Woe=/\\,/g,qoe=/\\\./g,Hoe=1e5,Goe=4e6;function QS(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(QS,"numeric");function Voe(e){return e.replace(zoe,wC).replace(Uoe,bC).replace(Boe,t6).replace(Woe,xC).replace(qoe,EC)}l(Voe,"escapeBraces");function Zoe(e){return e.replace(Doe,"\\").replace(Loe,"{").replace(Moe,"}").replace(Foe,",").replace(joe,".")}l(Zoe,"unescapeBraces");function SC(e){if(!e)return[""];let t=[],r=XS("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=SC(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(SC,"parseCommaParts");function kC(e,t={}){if(!e)return[];let{max:r=Hoe,maxLength:n=Goe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),e6(Voe(e),r,n,!0).map(Zoe)}l(kC,"expand");function Koe(e){return"{"+e+"}"}l(Koe,"embrace");function Yoe(e){return/^-?0\d/.test(e)}l(Yoe,"isPadded");function Joe(e,t){return e<=t}l(Joe,"lte");function Xoe(e,t){return e>=t}l(Xoe,"gte");function Fd(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(Fd,"combine");function Qoe(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=QS(i[0]),a=QS(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(QS(i[2])),1):1,d=Joe;a<o&&(u*=-1,d=Xoe);let f=i.some(Yoe),h=0;for(let m=o;d(m,a)&&s.length<r;m+=u){let g;if(t)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),f){let y=c-g.length;if(y>0){let b=new Array(y+1).join("0");m<0?g="-"+b+g.slice(1):g=b+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(Qoe,"expandSequence");function e6(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=XS("{","}",e);if(!a)return Fd(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=Fd(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,f=a.body.indexOf(",")>=0;if(!p&&!f){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+t6+a.post,n=!0;continue}return Fd(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!p,o=!1);let h;if(p)h=Qoe(a.body,d,t,r);else{let m=SC(a.body);if(m.length===1&&m[0]!==void 0&&(m=e6(m[0],t,r,!1).map(Koe),m.length===1)){if(i=Fd(i,c+m[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let g=s&&!a.post.length&&!c;for(let b=0;g&&b<i.length;b++)i[b]&&(g=!1);h=[];let y=0;e:for(let b=0;b<m.length;b++){let w=e6(m[b],t,r,!1);for(let x=0;x<w.length;x++){let k=w[x];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=Fd(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(e6,"expand_");var jd=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var eae={"[: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]},zd=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),tae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),AC=l(e=>e.join(""),"rangesToString"),$C=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 g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){u=!0,s++;continue}if(g==="]"&&o&&!c){d=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(let[y,[b,w,x]]of Object.entries(eae))if(e.startsWith(y,s)){if(p)return["$.",!1,e.length-r,!0];s+=y.length,x?i.push(b):n.push(b),a=a||w;continue e}}if(c=!1,p){g>p?n.push(zd(p)+"-"+zd(g)):g===p&&n.push(zd(g)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push(zd(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=g,s+=2;continue}n.push(zd(g)),s++}if(d<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let g=n[0].length===2?n[0].slice(-1):n[0];return[tae(g),!1,d-r,!1]}let f="["+(u?"^":"")+AC(n)+"]",h="["+(u?"":"^")+AC(i)+"]";return[n.length&&i.length?"("+f+"|"+h+")":n.length?f:h,a,d-r,!0]},"parseClass");var zo=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var Ln,rae=new Set(["!","?","+","*","@"]),r6=l(e=>rae.has(e),"isExtglobType"),IC=l(e=>r6(e.type),"isExtglobAST"),nae=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),iae=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),sae=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),_C=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),oae="(?!(?:^|/)\\.\\.?(?:$|/))",Ym="(?!\\.)",aae=new Set(["[","."]),lae=new Set(["..","."]),cae=new Set("().*{}+?[]^$\\!"),uae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),n6="[^/]",TC=n6+"*?",OC=n6+"+?",dae=0,Ma=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++dae;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#u&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Ln&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Ln&&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 Ln(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#h(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let g=n,y="";for(;g<t.length;){let b=t.charAt(g++);if(a||b==="\\"){a=!a,y+=b;continue}if(c){g===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(g===u+2&&d)&&(c=!1),y+=b;continue}else if(b==="["){c=!0,u=g,d=!1,y+=b;continue}if(!i.noext&&r6(b)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let x=new Ln(b,r);g=Ln.#h(t,x,g,i,s+1),r.push(x);continue}y+=b}return r.push(y),g}let p=n+1,f=new Ln(null,r),h=[],m="";for(;p<t.length;){let g=t.charAt(p++);if(a||g==="\\"){a=!a,m+=g;continue}if(c){p===u+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(p===u+2&&d)&&(c=!1),m+=g;continue}else if(g==="["){c=!0,u=p,d=!1,m+=g;continue}if(!i.noext&&r6(g)&&t.charAt(p)==="("&&(s<=o||r&&r.#g(g))){let b=r&&r.#g(g)?0:1;f.push(m),m="";let w=new Ln(g,f);f.push(w),p=Ln.#h(t,w,p,i,s+b);continue}if(g==="|"){f.push(m),m="",h.push(f),f=new Ln(null,r);continue}if(g===")")return m===""&&r.#t.length===0&&(r.#c=!0),f.push(m),m="",r.push(...h,f),p;m+=g}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],p}#O(t){return this.#m(t,iae)}#m(t,r=nae){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#g(n.type,r)}#g(t,r=sae){return!!r.get(this.type)?.includes(t)}#p(t,r){let n=t.#t[0],i=new Ln(null,n,this.options);i.#t.push(""),n.push(i),this.#E(t,r)}#E(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#S(t){return!!_C.get(this.type)?.has(t)}#C(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#S(r.type)}#y(t){let r=_C.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 Ln(null,void 0,r);return Ln.#h(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#x()),!IC(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,b]=typeof h=="string"?Ln.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||b,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&lae.has(this.#t[0]))){let m=aae,g=r&&m.has(u.charAt(0))||u.startsWith("\\.")&&m.has(u.charAt(2))||u.startsWith("\\.\\.")&&m.has(u.charAt(4)),y=!r&&!t&&m.has(u.charAt(0));d=g?oae:y?Ym:""}let p="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,zo(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(r);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#r=void 0,[c,zo(this.toString()),!1,!1]}let o=!n||t||r||!Ym?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Ym:"")+OC;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Ym:"")+TC+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,zo(s),this.#r=!!this.#r,this.#n]}#f(){if(IC(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.#m(i)?(r=!1,this.#E(i,n)):this.#O(i)?(r=!1,this.#p(i,n)):this.#C(i)&&(r=!1,this.#y(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#v(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(t,r,n=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(cae.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?OC:TC,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,f,h]=$C(t,c);if(f){s+=d,o=o||p,c+=f-1,r=r||h;continue}}if(u==="?"){s+=n6,r=!0;continue}s+=uae(u)}return[s,zo(t),!!r,o]}};Ln=Ma;var i6=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 Gr=l((e,t,r={})=>(jd(t),!r.nocomment&&t.charAt(0)==="#"?!1:new fc(t,r).match(e)),"minimatch"),pae=/^\*+([^+@!?*[(]*)$/,fae=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),hae=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),mae=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),gae=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),yae=/^\*+\.\*+$/,vae=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),wae=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),bae=/^\.\*+$/,xae=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Eae=/^\*+$/,Sae=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),kae=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Aae=/^\?+([^+@!?*[(]*)?$/,$ae=l(([e,t=""])=>{let r=RC([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),Iae=l(([e,t=""])=>{let r=PC([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),_ae=l(([e,t=""])=>{let r=PC([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),Tae=l(([e,t=""])=>{let r=RC([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),RC=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),PC=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),DC=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",CC={win32:{sep:"\\"},posix:{sep:"/"}},Oae=DC==="win32"?CC.win32.sep:CC.posix.sep;Gr.sep=Oae;var pn=Symbol("globstar **");Gr.GLOBSTAR=pn;var Cae="[^/]",Nae=Cae+"*?",Rae="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Pae="(?:(?!(?:\\/|^)\\.).)*?",Dae=l((e,t={})=>r=>Gr(r,e,t),"filter");Gr.filter=Dae;var pi=l((e,t={})=>Object.assign({},e,t),"ext"),Lae=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Gr;let t=Gr;return Object.assign(l((n,i,s={})=>t(n,i,pi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,pi(e,s))}static defaults(i){return t.defaults(pi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,pi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,pi(e,s))}},unescape:l((n,i={})=>t.unescape(n,pi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,pi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,pi(e,i)),"filter"),defaults:l(n=>t.defaults(pi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,pi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,pi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,pi(e,s)),"match"),sep:t.sep,GLOBSTAR:pn})},"defaults");Gr.defaults=Lae;var LC=l((e,t={})=>(jd(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:kC(e,{max:t.braceExpandMax})),"braceExpand");Gr.braceExpand=LC;var Mae=l((e,t={})=>new fc(e,t).makeRe(),"makeRe");Gr.makeRe=Mae;var Fae=l((e,t,r={})=>{let n=new fc(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Gr.match=Fae;var NC=/[?*]|[+@!]\(.*?\)|\[|\]/,jae=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),fc=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={}){jd(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||DC,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]==="?"||!NC.test(s[2]))&&!NC.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,f=d?3:u?0:void 0;if(typeof p=="number"&&typeof f=="number"){let[h,m]=[t[p],r[f]];h.toLowerCase()===m.toLowerCase()&&(r[f]=h,s=f,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(pn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(pn,s),a=r.lastIndexOf(pn),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,a),r.slice(a+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#n(w,c,n,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#n(t,d,n,w,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#n(t,d,n,w,0)))return!1;p=d.length+1}}if(!u.length){let w=!!p;for(let x=i;x<t.length-p;x++){let k=String(t[x]);if(w=!0,k==="."||k===".."||!this.options.dot&&k.startsWith("."))return!1}return n||w}let f=[[[],0]],h=f[0],m=0,g=[0];for(let w of u)w===pn?(g.push(m),h=[[],0],f.push(h)):(h[0].push(w),m++);let y=f.length-1,b=t.length-p;for(let w of f)w[1]=b-(g[y--]+w[0].length);return!!this.#r(t,f,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 f=t[p];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return a}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(h!==!1)return h}let f=t[n];if(f==="."||f===".."||!this.options.dot&&f.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===pn)return!1;let f;if(typeof d=="string"?(f=p===d,this.debug("string match",d,p,f)):(f=d.test(p),this.debug("pattern match",d,p,f)),!f)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 LC(this.pattern,this.options)}parse(t){jd(t);let r=this.options;if(t==="**")return pn;if(t==="")return"";let n,i=null;(n=t.match(Eae))?i=r.dot?kae:Sae:(n=t.match(pae))?i=(r.nocase?r.dot?gae:mae:r.dot?hae:fae)(n[1]):(n=t.match(Aae))?i=(r.nocase?r.dot?Iae:$ae:r.dot?_ae:Tae)(n):(n=t.match(yae))?i=r.dot?wae:vae:(n=t.match(bae))&&(i=xae);let s=Ma.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?Nae:r.dot?Rae:Pae,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let f of p.flags.split(""))i.add(f);return typeof p=="string"?jae(p):p===pn?pn:p._src});u.forEach((p,f)=>{let h=u[f+1],m=u[f-1];p!==pn||m===pn||(m===void 0?h!==void 0&&h!==pn?u[f+1]="(?:\\/|"+n+"\\/)?"+h:u[f]=n:h===void 0?u[f-1]=m+"(?:\\/|\\/"+n+")?":h!==pn&&(u[f-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[f+1]=pn))});let d=u.filter(p=>p!==pn);if(this.partial&&d.length>=1){let p=[];for(let f=1;f<=d.length;f++)p.push(d.slice(0,f).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 Gr.defaults(t).Minimatch}};Gr.AST=Ma;Gr.Minimatch=fc;Gr.escape=i6;Gr.unescape=zo;import{gunzipSync as jce}from"node:zlib";var Ud=class{static{l(this,"Diff")}diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=l(w=>{if(w=this.postProcess(w,n),i){setTimeout(function(){i(w)},0);return}else return w},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let p=(s=n.timeout)!==null&&s!==void 0?s:1/0,f=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&m+1>=a)return o(this.buildValues(h[0].lastComponent,r,t));let g=-1/0,y=1/0,b=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let x,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let C=S.oldPos-w;A=S&&0<=C&&C<a}let I=k&&k.oldPos+1<c;if(!A&&!I){h[w]=void 0;continue}if(!I||A&&k.oldPos<S.oldPos?x=this.addToPath(S,!0,!1,0,n):x=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(x,r,t,w,n),x.oldPos+1>=c&&m+1>=a)return o(this.buildValues(x.lastComponent,r,t))||!0;h[w]=x,x.oldPos+1>=c&&(y=Math.min(y,w-1)),m+1>=a&&(g=Math.max(g,w+1))}u++},"execEditLength");if(i)l(function w(){setTimeout(function(){if(u>d||Date.now()>f)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=f;){let w=b();if(w)return w}}addToPath(t,r,n,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){let o=r.length,a=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,a=0,c=0,u=0;for(;a<o;a++){let d=i[a];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=r.slice(c,c+d.count);p=p.map(function(f,h){let m=n[u+h];return m.length>f.length?m:f}),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 s6=class extends Ud{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Uae}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
681
681
  `))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
682
682
  `))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
683
683
  `)&&(t=t.slice(0,-1)),r.endsWith(`
@@ -677,7 +677,7 @@ ${i}`:""}`}});function fA(e){if(e.url.trim().length===0)throw new Error("url mus
677
677
  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; }
678
678
  .secondary { background: #29314b; color: #edf2ff; }
679
679
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
680
- `}l(f_,"pageStyles");var Ow={name:"dsh-edge",version:"0.2.0-alpha.3",description:"Run DeepSeek Harness on Cloudflare Workers as an independent community project",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/tree/master/apps/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","agent","cloudflare-workers","durable-objects"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.0-rc.8"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.0-rc.8","@deepseek-ai/dsh-agent-loop":"0.1.0-rc.8","@deepseek-ai/dsh-anonymous-user-id":"0.1.0-rc.8","@deepseek-ai/dsh-brand":"0.1.0-rc.8","@deepseek-ai/dsh-credentials":"0.1.0-rc.8","@deepseek-ai/dsh-host-apiproxy":"0.1.0-rc.8","@deepseek-ai/dsh-launch-environment":"0.1.0-rc.8","@deepseek-ai/dsh-llm":"0.1.0-rc.8","@deepseek-ai/dsh-llm-deepseek":"0.1.0-rc.8","@deepseek-ai/dsh-session":"0.1.0-rc.8","@deepseek-ai/dsh-session-persistence":"0.1.0-rc.8","@deepseek-ai/dsh-session-query":"0.1.0-rc.8","@deepseek-ai/dsh-session-title":"0.1.0-rc.8","@deepseek-ai/dsh-settings":"0.1.0-rc.8","@deepseek-ai/dsh-system-prompt":"0.1.0-rc.8","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.0-rc.8","@deepseek-ai/dsh-tool-web":"0.1.0-rc.8","@deepseek-ai/dsh-tools":"0.1.0-rc.8","@deepseek-ai/dsh-web":"0.1.0-rc.8","@deepseek-ai/dsh-web-search-deepseek":"0.1.0-rc.8","just-bash":"3.3.0",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var vp=Ow.version,p_=Ow.dshEdge.upstreamVersion;function aJ(){return"dsh-edge@0.2.0-alpha.3/isolated"}l(aJ,"resolveEdgeDeploymentId");function wp(e){return JA(e.DEEPSEEK_API_KEY),{baseURL:Zv(e.DEEPSEEK_BASE_URL),maxTokens:Jv(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:bc(e.DEEPSEEK_MODEL),reasoningEffort:Kv(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:op(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Xv(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Ac(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(wp,"resolveEdgeDeploymentConfig");function oJ(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(oJ,"edgeDeploymentApiKeyConfigured");function lJ(e){let t=Zv(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(lJ,"projectedEdgeBaseURL");function Rw(e){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",deploymentId:aJ(),apiKeyConfigured:oJ(e),baseURL:lJ(e.DEEPSEEK_BASE_URL),maxTokens:Jv(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:bc(e.DEEPSEEK_MODEL),reasoningEffort:Kv(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:op(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Xv(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Ac(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Rw,"resolveEdgeDeploymentProfile");function h_(e){wp(e);let t=Rw(e);return{ok:!0,service:"dsh-edge",storage:t.storage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:vp,upstreamVersion:p_,status:"ready"}}l(h_,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Uxe}from"cloudflare:workers";var Ia=u4(m_(),1);var Pw=l((e,t,n)=>{let i=e instanceof RegExp?g_(e,n):e,r=t instanceof RegExp?g_(t,n):t,s=i!==null&&r!=null&&cJ(i,r,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+i.length,s[1]),post:n.slice(s[1]+r.length)}},"balanced"),g_=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),cJ=l((e,t,n)=>{let i,r,s,a,o,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(i=[],s=n.length;d>=0&&!o;){if(d===c)i.push(d),c=n.indexOf(e,d+1);else if(i.length===1){let f=i.pop();f!==void 0&&(o=[f,u])}else r=i.pop(),r!==void 0&&r<s&&(s=r,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}i.length&&a!==void 0&&(o=[s,a])}return o},"range");var y_="\0SLASH"+Math.random()+"\0",v_="\0OPEN"+Math.random()+"\0",Mw="\0CLOSE"+Math.random()+"\0",w_="\0COMMA"+Math.random()+"\0",b_="\0PERIOD"+Math.random()+"\0",uJ=new RegExp(y_,"g"),dJ=new RegExp(v_,"g"),fJ=new RegExp(Mw,"g"),pJ=new RegExp(w_,"g"),hJ=new RegExp(b_,"g"),mJ=/\\\\/g,gJ=/\\{/g,yJ=/\\}/g,vJ=/\\,/g,wJ=/\\\./g,bJ=1e5,xJ=4e6;function Dw(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(Dw,"numeric");function EJ(e){return e.replace(mJ,y_).replace(gJ,v_).replace(yJ,Mw).replace(vJ,w_).replace(wJ,b_)}l(EJ,"escapeBraces");function SJ(e){return e.replace(uJ,"\\").replace(dJ,"{").replace(fJ,"}").replace(pJ,",").replace(hJ,".")}l(SJ,"unescapeBraces");function x_(e){if(!e)return[""];let t=[],n=Pw("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=x_(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(x_,"parseCommaParts");function E_(e,t={}){if(!e)return[];let{max:n=bJ,maxLength:i=xJ}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Lw(EJ(e),n,i,!0).map(SJ)}l(E_,"expand");function kJ(e){return"{"+e+"}"}l(kJ,"embrace");function AJ(e){return/^-?0\d/.test(e)}l(AJ,"isPadded");function _J(e,t){return e<=t}l(_J,"lte");function $J(e,t){return e>=t}l($J,"gte");function Cc(e,t,n,i,r,s){let a=[],o=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=i)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(o+d.length>r)return a;a.push(d),o+=d.length}}return a}l(Cc,"combine");function IJ(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=Dw(r[0]),o=Dw(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(Dw(r[2])),1):1,d=_J;o<a&&(u*=-1,d=$J);let p=r.some(AJ),h=0;for(let g=a;d(g,o)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),p){let v=c-y.length;if(v>0){let b=new Array(v+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(IJ,"expandSequence");function Lw(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=Pw("{","}",e);if(!o)return Cc(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=Cc(r,c+"{"+o.body+"}",[""],t,n,s&&!o.post.length),a=!1,!o.post.length)break;e=o.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||d,p=o.body.indexOf(",")>=0;if(!f&&!p){if(o.post.match(/,(?!,).*\}/)){e=o.pre+"{"+o.body+Mw+o.post,i=!0;continue}return Cc(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=IJ(o.body,d,t,n);else{let g=x_(o.body);if(g.length===1&&g[0]!==void 0&&(g=Lw(g[0],t,n,!1).map(kJ),g.length===1)){if(r=Cc(r,c+g[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let b=0;y&&b<r.length;b++)r[b]&&(y=!1);h=[];let v=0;e:for(let b=0;b<g.length;b++){let E=Lw(g[b],t,n,!1);for(let S=0;S<E.length;S++){let _=E[S];if(!(y&&!_)){if(h.length>=t||v+_.length>n)break e;h.push(_),v+=_.length}}}}if(r=Cc(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(Lw,"expand_");var Nc=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var CJ={"[: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]},Tc=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),NJ=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),S_=l(e=>e.join(""),"rangesToString"),k_=l((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=n+1,a=!1,o=!1,c=!1,u=!1,d=n,f="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[b,E,S]]of Object.entries(CJ))if(e.startsWith(v,s)){if(f)return["$.",!1,e.length-n,!0];s+=v.length,S?r.push(b):i.push(b),o=o||E;continue e}}if(c=!1,f){y>f?i.push(Tc(f)+"-"+Tc(y)):y===f&&i.push(Tc(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(Tc(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(Tc(y)),s++}if(d<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,e.length-n,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let y=i[0].length===2?i[0].slice(-1):i[0];return[NJ(y),!1,d-n,!1]}let p="["+(u?"^":"")+S_(i)+"]",h="["+(u?"":"^")+S_(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var bs=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var tr,TJ=new Set(["!","?","+","*","@"]),jw=l(e=>TJ.has(e),"isExtglobType"),A_=l(e=>jw(e.type),"isExtglobAST"),OJ=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),RJ=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),PJ=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),__=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),DJ="(?!(?:^|/)\\.\\.?(?:$|/))",xp="(?!\\.)",LJ=new Set(["[","."]),MJ=new Set(["..","."]),jJ=new Set("().*{}+?[]^$\\!"),FJ=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Fw="[^/]",$_=Fw+"*?",I_=Fw+"+?",UJ=0,da=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++UJ;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,i={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?i:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#u&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,i=n.#i;for(;i;){for(let r=n.#s+1;!i.type&&r<i.#t.length;r++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#t[r])}n=i,i=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof tr&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let i=t.#t[n];if(!(i instanceof tr&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new tr(this.type,t);for(let i of this.#t)n.copyIn(i);return n}static#h(t,n,i,r,s){let a=r.maxExtglobRecursion??2,o=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=i,v="";for(;y<t.length;){let b=t.charAt(y++);if(o||b==="\\"){o=!o,v+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),v+=b;continue}else if(b==="["){c=!0,u=y,d=!1,v+=b;continue}if(!r.noext&&jw(b)&&t.charAt(y)==="("&&s<=a){n.push(v),v="";let S=new tr(b,n);y=tr.#h(t,S,y,r,s+1),n.push(S);continue}v+=b}return n.push(v),y}let f=i+1,p=new tr(null,n),h=[],g="";for(;f<t.length;){let y=t.charAt(f++);if(o||y==="\\"){o=!o,g+=y;continue}if(c){f===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(f===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=f,d=!1,g+=y;continue}if(!r.noext&&jw(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let b=n&&n.#g(y)?0:1;p.push(g),g="";let E=new tr(y,p);p.push(E),f=tr.#h(t,E,f,r,s+b);continue}if(y==="|"){p.push(g),g="",h.push(p),p=new tr(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),p.push(g),g="",n.push(...h,p),f;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#N(t){return this.#m(t,RJ)}#m(t,n=OJ){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let i=t.#t[0];return!i||typeof i!="object"||i.type===null?!1:this.#g(i.type,n)}#g(t,n=PJ){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new tr(null,i,this.options);r.#t.push(""),i.push(r),this.#E(t,n)}#E(t,n){let i=t.#t[0];this.#t.splice(n,1,...i.#t);for(let r of i.#t)typeof r=="object"&&(r.#i=this);this.#a=void 0}#S(t){return!!__.get(this.type)?.has(t)}#T(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=__.get(this.type),i=t.#t[0],r=n?.get(i.type);if(!r)return!1;this.#t=i.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=r,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let i=new tr(null,void 0,n);return tr.#h(t,i,0,n,0),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,i,r,s]=this.toRegExpSource();if(!(r||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let o=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!A_(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,v,b]=typeof h=="string"?tr.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&MJ.has(this.#t[0]))){let g=LJ,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!n&&!t&&g.has(u.charAt(0));d=y?DJ:v?xp:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,bs(u),this.#n=!!this.#n,this.#r]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,bs(this.toString()),!1,!1]}let a=!i||t||n||!xp?"":this.#v(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?xp:"")+I_;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?xp:"")+$_+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,bs(s),this.#n=!!this.#n,this.#r]}#p(){if(A_(this)){let t=0,n=!1;do{n=!0;for(let i=0;i<this.#t.length;i++){let r=this.#t[i];typeof r=="object"&&(r.#p(),this.#m(r)?(n=!1,this.#E(r,i)):this.#N(r)?(n=!1,this.#f(r,i)):this.#T(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#a=void 0}#v(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[i,r,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,i}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#k(t,n,i=!1){let r=!1,s="",a=!1,o=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,s+=(jJ.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?I_:$_,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=k_(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=Fw,n=!0;continue}s+=FJ(u)}return[s,bs(t),!!n,a]}};tr=da;var Uw=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var yn=l((e,t,n={})=>(Nc(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Co(t,n).match(e)),"minimatch"),zJ=/^\*+([^+@!?*[(]*)$/,BJ=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),WJ=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),qJ=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),HJ=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),GJ=/^\*+\.\*+$/,VJ=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),ZJ=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),KJ=/^\.\*+$/,XJ=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),JJ=/^\*+$/,QJ=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),YJ=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),eQ=/^\?+([^+@!?*[(]*)?$/,tQ=l(([e,t=""])=>{let n=T_([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),nQ=l(([e,t=""])=>{let n=O_([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),rQ=l(([e,t=""])=>{let n=O_([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),iQ=l(([e,t=""])=>{let n=T_([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),T_=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),O_=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),R_=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",C_={win32:{sep:"\\"},posix:{sep:"/"}},sQ=R_==="win32"?C_.win32.sep:C_.posix.sep;yn.sep=sQ;var Rn=Symbol("globstar **");yn.GLOBSTAR=Rn;var aQ="[^/]",oQ=aQ+"*?",lQ="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",cQ="(?:(?!(?:\\/|^)\\.).)*?",uQ=l((e,t={})=>n=>yn(n,e,t),"filter");yn.filter=uQ;var Er=l((e,t={})=>Object.assign({},e,t),"ext"),dQ=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return yn;let t=yn;return Object.assign(l((i,r,s={})=>t(i,r,Er(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Er(e,s))}static defaults(r){return t.defaults(Er(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Er(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Er(e,s))}},unescape:l((i,r={})=>t.unescape(i,Er(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Er(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Er(e,r)),"filter"),defaults:l(i=>t.defaults(Er(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Er(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Er(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Er(e,s)),"match"),sep:t.sep,GLOBSTAR:Rn})},"defaults");yn.defaults=dQ;var P_=l((e,t={})=>(Nc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:E_(e,{max:t.braceExpandMax})),"braceExpand");yn.braceExpand=P_;var fQ=l((e,t={})=>new Co(e,t).makeRe(),"makeRe");yn.makeRe=fQ;var pQ=l((e,t,n={})=>{let i=new Co(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");yn.match=pQ;var N_=/[?*]|[+@!]\(.*?\)|\[|\]/,hQ=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Co=class{static{l(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){Nc(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||R_,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!N_.test(s[2]))&&!N_.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i of t)for(let r=0;r<i.length;r++)i[r]==="**"&&(i[r]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let r=i;for(;n[r+1]==="**";)r++;r!==i&&n.splice(i,r-i)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let s=t[r];r===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let r=t[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(n=!0,t.splice(i-1,2),i-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let i of t){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let a=r;for(;i[a+1]==="**";)a++;a>r&&i.splice(r+1,a-r);let o=i[r+1],c=i[r+2],u=i[r+3];if(o!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,i.splice(r,1);let d=i.slice(0);d[r]="**",t.push(d),r--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(n=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(n=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let a=i[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let i=n+1;i<t.length;i++){let r=this.partsMatch(t[n],t[i],!this.preserveMultipleSlashes);if(r){t[n]=[],t[i]=r;break}}return t.filter(n=>n.length)}partsMatch(t,n,i=!1){let r=0,s=0,a=[],o="";for(;r<t.length&&s<n.length;)if(t[r]===n[s])a.push(o==="b"?n[s]:t[r]),r++,s++;else if(i&&t[r]==="**"&&n[s]===t[r+1])a.push(t[r]),r++;else if(i&&n[s]==="**"&&t[r]===n[s+1])a.push(n[s]),s++;else if(t[r]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(o==="b")return!1;o="a",a.push(t[r]),r++,s++}else if(n[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(o==="a")return!1;o="b",a.push(n[s]),r++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,i=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)n=!n,i++;i&&(this.pattern=t.slice(i)),this.negate=n}matchOne(t,n,i=!1){let r=0,s=0;if(this.isWindows){let o=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!o&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),f=c?3:o?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,g]=[t[f],n[p]];h.toLowerCase()===g.toLowerCase()&&(n[p]=h,s=p,r=f)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Rn)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(Rn,s),o=n.lastIndexOf(Rn),[c,u,d]=i?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,o),n.slice(o+1)];if(c.length){let E=t.slice(r,r+c.length);if(!this.#r(E,c,i,0,0))return!1;r+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+r>t.length)return!1;let E=t.length-d.length;if(this.#r(t,d,i,E,0))f=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(E--,!this.#r(t,d,i,E,0)))return!1;f=d.length+1}}if(!u.length){let E=!!f;for(let S=r;S<t.length-f;S++){let _=String(t[S]);if(E=!0,_==="."||_===".."||!this.options.dot&&_.startsWith("."))return!1}return i||E}let p=[[[],0]],h=p[0],g=0,y=[0];for(let E of u)E===Rn?(y.push(g),h=[[],0],p.push(h)):(h[0].push(E),g++);let v=p.length-1,b=t.length-f;for(let E of p)E[1]=b-(y[v--]+E[0].length);return!!this.#n(t,p,r,0,i,0,!!f)}#n(t,n,i,r,s,a,o){let c=n[r];if(!c){for(let f=i;f<t.length;f++){o=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[u,d]=c;for(;i<=d;){if(this.#r(t.slice(0,i+u.length),u,s,i,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,i+u.length,r+1,s,a+1,o);if(h!==!1)return h}let p=t[i];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;i++}return s||null}#r(t,n,i,r,s){let a,o,c,u;for(a=r,o=s,u=t.length,c=n.length;a<u&&o<c;a++,o++){this.debug("matchOne loop");let d=n[o],f=t[a];if(this.debug(n,d,f),d===!1||d===Rn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(a===u&&o===c)return!0;if(a===u)return i;if(o===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return P_(this.pattern,this.options)}parse(t){Nc(t);let n=this.options;if(t==="**")return Rn;if(t==="")return"";let i,r=null;(i=t.match(JJ))?r=n.dot?YJ:QJ:(i=t.match(zJ))?r=(n.nocase?n.dot?HJ:qJ:n.dot?WJ:BJ)(i[1]):(i=t.match(eQ))?r=(n.nocase?n.dot?nQ:tQ:n.dot?rQ:iQ)(i):(i=t.match(GJ))?r=n.dot?ZJ:VJ:(i=t.match(KJ))&&(r=XJ);let s=da.fromGlob(t,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?oQ:n.dot?lQ:cQ,r=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))r.add(p);return typeof f=="string"?hQ(f):f===Rn?Rn:f._src});u.forEach((f,p)=>{let h=u[p+1],g=u[p-1];f!==Rn||g===Rn||(g===void 0?h!==void 0&&h!==Rn?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=g+"(?:\\/|\\/"+i+")?":h!==Rn&&(u[p-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=Rn))});let d=u.filter(f=>f!==Rn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o of s){let c=r;if(i.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return yn.defaults(t).Minimatch}};yn.AST=da;yn.Minimatch=Co;yn.escape=Uw;yn.unescape=bs;import{gunzipSync as Ree}from"node:zlib";var Oc=class{static{l(this,"Diff")}diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);let s=this.castInput(t,i),a=this.castInput(n,i),o=this.removeEmpty(this.tokenize(s,i)),c=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,c,i,r)}diffWithOptionsObj(t,n,i,r){var s;let a=l(E=>{if(E=this.postProcess(E,i),r){setTimeout(function(){r(E)},0);return}else return E},"done"),o=n.length,c=t.length,u=1,d=o+c;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&g+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,v=1/0,b=l(()=>{for(let E=Math.max(y,-u);E<=Math.min(v,u);E+=2){let S,_=h[E-1],k=h[E+1];_&&(h[E-1]=void 0);let A=!1;if(k){let F=k.oldPos-E;A=k&&0<=F&&F<o}let O=_&&_.oldPos+1<c;if(!A&&!O){h[E]=void 0;continue}if(!O||A&&_.oldPos<k.oldPos?S=this.addToPath(k,!0,!1,0,i):S=this.addToPath(_,!1,!0,1,i),g=this.extractCommon(S,n,t,E,i),S.oldPos+1>=c&&g+1>=o)return a(this.buildValues(S.lastComponent,n,t))||!0;h[E]=S,S.oldPos+1>=c&&(v=Math.min(v,E-1)),g+1>=o&&(y=Math.max(y,E+1))}u++},"execEditLength");if(r)l(function E(){setTimeout(function(){if(u>d||Date.now()>p)return r(void 0);b()||E()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let E=b();if(E)return E}}addToPath(t,n,i,r,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:a.count+1,added:n,removed:i,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:a}}}extractCommon(t,n,i,r,s){let a=n.length,o=i.length,c=t.oldPos,u=c-r,d=0;for(;u+1<a&&c+1<o&&this.equals(i[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){let r=[],s;for(;t;)r.push(t),s=t.previousComponent,delete t.previousComponent,t=s;r.reverse();let a=r.length,o=0,c=0,u=0;for(;o<a;o++){let d=r[o];if(d.removed)d.value=this.join(i.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){let g=i[u+h];return g.length>p.length?g:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return r}};var zw=class extends Oc{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=gQ}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
680
+ `}l(f_,"pageStyles");var Ow={name:"dsh-edge",version:"0.2.0",description:"Run DeepSeek Harness on Cloudflare Workers as an independent community project",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/tree/master/apps/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","agent","cloudflare-workers","durable-objects"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.0-rc.8"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.0-rc.8","@deepseek-ai/dsh-agent-loop":"0.1.0-rc.8","@deepseek-ai/dsh-anonymous-user-id":"0.1.0-rc.8","@deepseek-ai/dsh-brand":"0.1.0-rc.8","@deepseek-ai/dsh-credentials":"0.1.0-rc.8","@deepseek-ai/dsh-host-apiproxy":"0.1.0-rc.8","@deepseek-ai/dsh-launch-environment":"0.1.0-rc.8","@deepseek-ai/dsh-llm":"0.1.0-rc.8","@deepseek-ai/dsh-llm-deepseek":"0.1.0-rc.8","@deepseek-ai/dsh-session":"0.1.0-rc.8","@deepseek-ai/dsh-session-persistence":"0.1.0-rc.8","@deepseek-ai/dsh-session-query":"0.1.0-rc.8","@deepseek-ai/dsh-session-title":"0.1.0-rc.8","@deepseek-ai/dsh-settings":"0.1.0-rc.8","@deepseek-ai/dsh-system-prompt":"0.1.0-rc.8","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.0-rc.8","@deepseek-ai/dsh-tool-web":"0.1.0-rc.8","@deepseek-ai/dsh-tools":"0.1.0-rc.8","@deepseek-ai/dsh-web":"0.1.0-rc.8","@deepseek-ai/dsh-web-search-deepseek":"0.1.0-rc.8","just-bash":"3.3.0",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var vp=Ow.version,p_=Ow.dshEdge.upstreamVersion;function aJ(){return"dsh-edge@0.2.0/isolated"}l(aJ,"resolveEdgeDeploymentId");function wp(e){return JA(e.DEEPSEEK_API_KEY),{baseURL:Zv(e.DEEPSEEK_BASE_URL),maxTokens:Jv(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:bc(e.DEEPSEEK_MODEL),reasoningEffort:Kv(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:op(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Xv(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Ac(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(wp,"resolveEdgeDeploymentConfig");function oJ(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(oJ,"edgeDeploymentApiKeyConfigured");function lJ(e){let t=Zv(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(lJ,"projectedEdgeBaseURL");function Rw(e){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",deploymentId:aJ(),apiKeyConfigured:oJ(e),baseURL:lJ(e.DEEPSEEK_BASE_URL),maxTokens:Jv(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:bc(e.DEEPSEEK_MODEL),reasoningEffort:Kv(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:op(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Xv(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Ac(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Rw,"resolveEdgeDeploymentProfile");function h_(e){wp(e);let t=Rw(e);return{ok:!0,service:"dsh-edge",storage:t.storage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:vp,upstreamVersion:p_,status:"ready"}}l(h_,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Uxe}from"cloudflare:workers";var Ia=u4(m_(),1);var Pw=l((e,t,n)=>{let i=e instanceof RegExp?g_(e,n):e,r=t instanceof RegExp?g_(t,n):t,s=i!==null&&r!=null&&cJ(i,r,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+i.length,s[1]),post:n.slice(s[1]+r.length)}},"balanced"),g_=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),cJ=l((e,t,n)=>{let i,r,s,a,o,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(i=[],s=n.length;d>=0&&!o;){if(d===c)i.push(d),c=n.indexOf(e,d+1);else if(i.length===1){let f=i.pop();f!==void 0&&(o=[f,u])}else r=i.pop(),r!==void 0&&r<s&&(s=r,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}i.length&&a!==void 0&&(o=[s,a])}return o},"range");var y_="\0SLASH"+Math.random()+"\0",v_="\0OPEN"+Math.random()+"\0",Mw="\0CLOSE"+Math.random()+"\0",w_="\0COMMA"+Math.random()+"\0",b_="\0PERIOD"+Math.random()+"\0",uJ=new RegExp(y_,"g"),dJ=new RegExp(v_,"g"),fJ=new RegExp(Mw,"g"),pJ=new RegExp(w_,"g"),hJ=new RegExp(b_,"g"),mJ=/\\\\/g,gJ=/\\{/g,yJ=/\\}/g,vJ=/\\,/g,wJ=/\\\./g,bJ=1e5,xJ=4e6;function Dw(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(Dw,"numeric");function EJ(e){return e.replace(mJ,y_).replace(gJ,v_).replace(yJ,Mw).replace(vJ,w_).replace(wJ,b_)}l(EJ,"escapeBraces");function SJ(e){return e.replace(uJ,"\\").replace(dJ,"{").replace(fJ,"}").replace(pJ,",").replace(hJ,".")}l(SJ,"unescapeBraces");function x_(e){if(!e)return[""];let t=[],n=Pw("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=x_(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(x_,"parseCommaParts");function E_(e,t={}){if(!e)return[];let{max:n=bJ,maxLength:i=xJ}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Lw(EJ(e),n,i,!0).map(SJ)}l(E_,"expand");function kJ(e){return"{"+e+"}"}l(kJ,"embrace");function AJ(e){return/^-?0\d/.test(e)}l(AJ,"isPadded");function _J(e,t){return e<=t}l(_J,"lte");function $J(e,t){return e>=t}l($J,"gte");function Cc(e,t,n,i,r,s){let a=[],o=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=i)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(o+d.length>r)return a;a.push(d),o+=d.length}}return a}l(Cc,"combine");function IJ(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=Dw(r[0]),o=Dw(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(Dw(r[2])),1):1,d=_J;o<a&&(u*=-1,d=$J);let p=r.some(AJ),h=0;for(let g=a;d(g,o)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),p){let v=c-y.length;if(v>0){let b=new Array(v+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(IJ,"expandSequence");function Lw(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=Pw("{","}",e);if(!o)return Cc(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=Cc(r,c+"{"+o.body+"}",[""],t,n,s&&!o.post.length),a=!1,!o.post.length)break;e=o.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),f=u||d,p=o.body.indexOf(",")>=0;if(!f&&!p){if(o.post.match(/,(?!,).*\}/)){e=o.pre+"{"+o.body+Mw+o.post,i=!0;continue}return Cc(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=IJ(o.body,d,t,n);else{let g=x_(o.body);if(g.length===1&&g[0]!==void 0&&(g=Lw(g[0],t,n,!1).map(kJ),g.length===1)){if(r=Cc(r,c+g[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let b=0;y&&b<r.length;b++)r[b]&&(y=!1);h=[];let v=0;e:for(let b=0;b<g.length;b++){let E=Lw(g[b],t,n,!1);for(let S=0;S<E.length;S++){let _=E[S];if(!(y&&!_)){if(h.length>=t||v+_.length>n)break e;h.push(_),v+=_.length}}}}if(r=Cc(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(Lw,"expand_");var Nc=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var CJ={"[: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]},Tc=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),NJ=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),S_=l(e=>e.join(""),"rangesToString"),k_=l((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=n+1,a=!1,o=!1,c=!1,u=!1,d=n,f="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[b,E,S]]of Object.entries(CJ))if(e.startsWith(v,s)){if(f)return["$.",!1,e.length-n,!0];s+=v.length,S?r.push(b):i.push(b),o=o||E;continue e}}if(c=!1,f){y>f?i.push(Tc(f)+"-"+Tc(y)):y===f&&i.push(Tc(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(Tc(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(Tc(y)),s++}if(d<s)return["",!1,0,!1];if(!i.length&&!r.length)return["$.",!1,e.length-n,!0];if(r.length===0&&i.length===1&&/^\\?.$/.test(i[0])&&!u){let y=i[0].length===2?i[0].slice(-1):i[0];return[NJ(y),!1,d-n,!1]}let p="["+(u?"^":"")+S_(i)+"]",h="["+(u?"":"^")+S_(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var bs=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var tr,TJ=new Set(["!","?","+","*","@"]),jw=l(e=>TJ.has(e),"isExtglobType"),A_=l(e=>jw(e.type),"isExtglobAST"),OJ=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),RJ=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),PJ=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),__=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),DJ="(?!(?:^|/)\\.\\.?(?:$|/))",xp="(?!\\.)",LJ=new Set(["[","."]),MJ=new Set(["..","."]),jJ=new Set("().*{}+?[]^$\\!"),FJ=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Fw="[^/]",$_=Fw+"*?",I_=Fw+"+?",UJ=0,da=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++UJ;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,i={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?i:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#u&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,i=n.#i;for(;i;){for(let r=n.#s+1;!i.type&&r<i.#t.length;r++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#t[r])}n=i,i=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof tr&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let i=t.#t[n];if(!(i instanceof tr&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new tr(this.type,t);for(let i of this.#t)n.copyIn(i);return n}static#h(t,n,i,r,s){let a=r.maxExtglobRecursion??2,o=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=i,v="";for(;y<t.length;){let b=t.charAt(y++);if(o||b==="\\"){o=!o,v+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),v+=b;continue}else if(b==="["){c=!0,u=y,d=!1,v+=b;continue}if(!r.noext&&jw(b)&&t.charAt(y)==="("&&s<=a){n.push(v),v="";let S=new tr(b,n);y=tr.#h(t,S,y,r,s+1),n.push(S);continue}v+=b}return n.push(v),y}let f=i+1,p=new tr(null,n),h=[],g="";for(;f<t.length;){let y=t.charAt(f++);if(o||y==="\\"){o=!o,g+=y;continue}if(c){f===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(f===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=f,d=!1,g+=y;continue}if(!r.noext&&jw(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let b=n&&n.#g(y)?0:1;p.push(g),g="";let E=new tr(y,p);p.push(E),f=tr.#h(t,E,f,r,s+b);continue}if(y==="|"){p.push(g),g="",h.push(p),p=new tr(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),p.push(g),g="",n.push(...h,p),f;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#N(t){return this.#m(t,RJ)}#m(t,n=OJ){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let i=t.#t[0];return!i||typeof i!="object"||i.type===null?!1:this.#g(i.type,n)}#g(t,n=PJ){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new tr(null,i,this.options);r.#t.push(""),i.push(r),this.#E(t,n)}#E(t,n){let i=t.#t[0];this.#t.splice(n,1,...i.#t);for(let r of i.#t)typeof r=="object"&&(r.#i=this);this.#a=void 0}#S(t){return!!__.get(this.type)?.has(t)}#T(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=__.get(this.type),i=t.#t[0],r=n?.get(i.type);if(!r)return!1;this.#t=i.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=r,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let i=new tr(null,void 0,n);return tr.#h(t,i,0,n,0),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,i,r,s]=this.toRegExpSource();if(!(r||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let o=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!A_(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,v,b]=typeof h=="string"?tr.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||v,this.#r=this.#r||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&MJ.has(this.#t[0]))){let g=LJ,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!n&&!t&&g.has(u.charAt(0));d=y?DJ:v?xp:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,bs(u),this.#n=!!this.#n,this.#r]}let i=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#v(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,bs(this.toString()),!1,!1]}let a=!i||t||n||!xp?"":this.#v(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?xp:"")+I_;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?xp:"")+$_+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,bs(s),this.#n=!!this.#n,this.#r]}#p(){if(A_(this)){let t=0,n=!1;do{n=!0;for(let i=0;i<this.#t.length;i++){let r=this.#t[i];typeof r=="object"&&(r.#p(),this.#m(r)?(n=!1,this.#E(r,i)):this.#N(r)?(n=!1,this.#f(r,i)):this.#T(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#a=void 0}#v(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[i,r,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,i}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#k(t,n,i=!1){let r=!1,s="",a=!1,o=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,s+=(jJ.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?I_:$_,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=k_(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=Fw,n=!0;continue}s+=FJ(u)}return[s,bs(t),!!n,a]}};tr=da;var Uw=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var yn=l((e,t,n={})=>(Nc(t),!n.nocomment&&t.charAt(0)==="#"?!1:new Co(t,n).match(e)),"minimatch"),zJ=/^\*+([^+@!?*[(]*)$/,BJ=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),WJ=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),qJ=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),HJ=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),GJ=/^\*+\.\*+$/,VJ=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),ZJ=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),KJ=/^\.\*+$/,XJ=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),JJ=/^\*+$/,QJ=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),YJ=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),eQ=/^\?+([^+@!?*[(]*)?$/,tQ=l(([e,t=""])=>{let n=T_([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),nQ=l(([e,t=""])=>{let n=O_([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),rQ=l(([e,t=""])=>{let n=O_([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),iQ=l(([e,t=""])=>{let n=T_([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),T_=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),O_=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),R_=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",C_={win32:{sep:"\\"},posix:{sep:"/"}},sQ=R_==="win32"?C_.win32.sep:C_.posix.sep;yn.sep=sQ;var Rn=Symbol("globstar **");yn.GLOBSTAR=Rn;var aQ="[^/]",oQ=aQ+"*?",lQ="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",cQ="(?:(?!(?:\\/|^)\\.).)*?",uQ=l((e,t={})=>n=>yn(n,e,t),"filter");yn.filter=uQ;var Er=l((e,t={})=>Object.assign({},e,t),"ext"),dQ=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return yn;let t=yn;return Object.assign(l((i,r,s={})=>t(i,r,Er(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Er(e,s))}static defaults(r){return t.defaults(Er(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Er(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Er(e,s))}},unescape:l((i,r={})=>t.unescape(i,Er(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Er(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Er(e,r)),"filter"),defaults:l(i=>t.defaults(Er(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Er(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Er(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Er(e,s)),"match"),sep:t.sep,GLOBSTAR:Rn})},"defaults");yn.defaults=dQ;var P_=l((e,t={})=>(Nc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:E_(e,{max:t.braceExpandMax})),"braceExpand");yn.braceExpand=P_;var fQ=l((e,t={})=>new Co(e,t).makeRe(),"makeRe");yn.makeRe=fQ;var pQ=l((e,t,n={})=>{let i=new Co(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");yn.match=pQ;var N_=/[?*]|[+@!]\(.*?\)|\[|\]/,hQ=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Co=class{static{l(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){Nc(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||R_,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[i]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let r=this.globParts.map((s,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!N_.test(s[2]))&&!N_.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let i of t)for(let r=0;r<i.length;r++)i[r]==="**"&&(i[r]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let r=i;for(;n[r+1]==="**";)r++;r!==i&&n.splice(i,r-i)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((i,r)=>{let s=i[i.length-1];return r==="**"&&s==="**"?i:r===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(i.pop(),i):(i.push(r),i)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let s=t[r];r===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let r=t[i-1];r&&r!=="."&&r!==".."&&r!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(n=!0,t.splice(i-1,2),i-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let i of t){let r=-1;for(;(r=i.indexOf("**",r+1))!==-1;){let a=r;for(;i[a+1]==="**";)a++;a>r&&i.splice(r+1,a-r);let o=i[r+1],c=i[r+2],u=i[r+3];if(o!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,i.splice(r,1);let d=i.slice(0);d[r]="**",t.push(d),r--}if(!this.preserveMultipleSlashes){for(let a=1;a<i.length-1;a++){let o=i[a];a===1&&o===""&&i[0]===""||(o==="."||o==="")&&(n=!0,i.splice(a,1),a--)}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(n=!0,i.pop())}let s=0;for(;(s=i.indexOf("..",s+1))!==-1;){let a=i[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&i[s+1]==="**"?["."]:[];i.splice(s-1,2,...c),i.length===0&&i.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let i=n+1;i<t.length;i++){let r=this.partsMatch(t[n],t[i],!this.preserveMultipleSlashes);if(r){t[n]=[],t[i]=r;break}}return t.filter(n=>n.length)}partsMatch(t,n,i=!1){let r=0,s=0,a=[],o="";for(;r<t.length&&s<n.length;)if(t[r]===n[s])a.push(o==="b"?n[s]:t[r]),r++,s++;else if(i&&t[r]==="**"&&n[s]===t[r+1])a.push(t[r]),r++;else if(i&&n[s]==="**"&&t[r]===n[s+1])a.push(n[s]),s++;else if(t[r]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(o==="b")return!1;o="a",a.push(t[r]),r++,s++}else if(n[s]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(o==="a")return!1;o="b",a.push(n[s]),r++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,i=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)n=!n,i++;i&&(this.pattern=t.slice(i)),this.negate=n}matchOne(t,n,i=!1){let r=0,s=0;if(this.isWindows){let o=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!o&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),f=c?3:o?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,g]=[t[f],n[p]];h.toLowerCase()===g.toLowerCase()&&(n[p]=h,s=p,r=f)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(Rn)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(Rn,s),o=n.lastIndexOf(Rn),[c,u,d]=i?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,o),n.slice(o+1)];if(c.length){let E=t.slice(r,r+c.length);if(!this.#r(E,c,i,0,0))return!1;r+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+r>t.length)return!1;let E=t.length-d.length;if(this.#r(t,d,i,E,0))f=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(E--,!this.#r(t,d,i,E,0)))return!1;f=d.length+1}}if(!u.length){let E=!!f;for(let S=r;S<t.length-f;S++){let _=String(t[S]);if(E=!0,_==="."||_===".."||!this.options.dot&&_.startsWith("."))return!1}return i||E}let p=[[[],0]],h=p[0],g=0,y=[0];for(let E of u)E===Rn?(y.push(g),h=[[],0],p.push(h)):(h[0].push(E),g++);let v=p.length-1,b=t.length-f;for(let E of p)E[1]=b-(y[v--]+E[0].length);return!!this.#n(t,p,r,0,i,0,!!f)}#n(t,n,i,r,s,a,o){let c=n[r];if(!c){for(let f=i;f<t.length;f++){o=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[u,d]=c;for(;i<=d;){if(this.#r(t.slice(0,i+u.length),u,s,i,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,i+u.length,r+1,s,a+1,o);if(h!==!1)return h}let p=t[i];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;i++}return s||null}#r(t,n,i,r,s){let a,o,c,u;for(a=r,o=s,u=t.length,c=n.length;a<u&&o<c;a++,o++){this.debug("matchOne loop");let d=n[o],f=t[a];if(this.debug(n,d,f),d===!1||d===Rn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(a===u&&o===c)return!0;if(a===u)return i;if(o===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return P_(this.pattern,this.options)}parse(t){Nc(t);let n=this.options;if(t==="**")return Rn;if(t==="")return"";let i,r=null;(i=t.match(JJ))?r=n.dot?YJ:QJ:(i=t.match(zJ))?r=(n.nocase?n.dot?HJ:qJ:n.dot?WJ:BJ)(i[1]):(i=t.match(eQ))?r=(n.nocase?n.dot?nQ:tQ:n.dot?rQ:iQ)(i):(i=t.match(GJ))?r=n.dot?ZJ:VJ:(i=t.match(KJ))&&(r=XJ);let s=da.fromGlob(t,this.options).toMMPattern();return r&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:r}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,i=n.noglobstar?oQ:n.dot?lQ:cQ,r=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))r.add(p);return typeof f=="string"?hQ(f):f===Rn?Rn:f._src});u.forEach((f,p)=>{let h=u[p+1],g=u[p-1];f!==Rn||g===Rn||(g===void 0?h!==void 0&&h!==Rn?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=g+"(?:\\/|\\/"+i+")?":h!==Rn&&(u[p-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=Rn))});let d=u.filter(f=>f!==Rn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o of s){let c=r;if(i.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return yn.defaults(t).Minimatch}};yn.AST=da;yn.Minimatch=Co;yn.escape=Uw;yn.unescape=bs;import{gunzipSync as Ree}from"node:zlib";var Oc=class{static{l(this,"Diff")}diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);let s=this.castInput(t,i),a=this.castInput(n,i),o=this.removeEmpty(this.tokenize(s,i)),c=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,c,i,r)}diffWithOptionsObj(t,n,i,r){var s;let a=l(E=>{if(E=this.postProcess(E,i),r){setTimeout(function(){r(E)},0);return}else return E},"done"),o=n.length,c=t.length,u=1,d=o+c;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&g+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,v=1/0,b=l(()=>{for(let E=Math.max(y,-u);E<=Math.min(v,u);E+=2){let S,_=h[E-1],k=h[E+1];_&&(h[E-1]=void 0);let A=!1;if(k){let F=k.oldPos-E;A=k&&0<=F&&F<o}let O=_&&_.oldPos+1<c;if(!A&&!O){h[E]=void 0;continue}if(!O||A&&_.oldPos<k.oldPos?S=this.addToPath(k,!0,!1,0,i):S=this.addToPath(_,!1,!0,1,i),g=this.extractCommon(S,n,t,E,i),S.oldPos+1>=c&&g+1>=o)return a(this.buildValues(S.lastComponent,n,t))||!0;h[E]=S,S.oldPos+1>=c&&(v=Math.min(v,E-1)),g+1>=o&&(y=Math.max(y,E+1))}u++},"execEditLength");if(r)l(function E(){setTimeout(function(){if(u>d||Date.now()>p)return r(void 0);b()||E()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let E=b();if(E)return E}}addToPath(t,n,i,r,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:a.count+1,added:n,removed:i,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:a}}}extractCommon(t,n,i,r,s){let a=n.length,o=i.length,c=t.oldPos,u=c-r,d=0;for(;u+1<a&&c+1<o&&this.equals(i[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){let r=[],s;for(;t;)r.push(t),s=t.previousComponent,delete t.previousComponent,t=s;r.reverse();let a=r.length,o=0,c=0,u=0;for(;o<a;o++){let d=r[o];if(d.removed)d.value=this.join(i.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){let g=i[u+h];return g.length>p.length?g:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return r}};var zw=class extends Oc{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=gQ}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
681
681
  `))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
682
682
  `))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
683
683
  `)&&(t=t.slice(0,-1)),n.endsWith(`