dsh-edge 0.4.0-alpha.3 → 0.4.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/dist/index.html
CHANGED
|
@@ -39,7 +39,7 @@ window.__ModuleLoader__={
|
|
|
39
39
|
return exports.createClientModuleSystem(this,{id:registration.id,exports},options)
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
})()</script><script src="/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=7eb526320903"></script><script src="/plugins/@deepseek-ai/dsh-client-runtime/client.js?rev=5a9e129c42ae"></script><script>globalThis["__DSH_BOOT__"] = {"rev":"
|
|
42
|
+
})()</script><script src="/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=7eb526320903"></script><script src="/plugins/@deepseek-ai/dsh-client-runtime/client.js?rev=5a9e129c42ae"></script><script>globalThis["__DSH_BOOT__"] = {"rev":"d41ec87b4ae5","entries":[{"id":"@deepseek-ai/dsh-typert-registry","url":"/plugins/@deepseek-ai/dsh-typert-registry/client.js?rev=f41d56e0b747","rev":"f41d56e0b747","inject":[],"immediately":true},{"id":"@deepseek-ai/dsh-api-gateway","url":"/plugins/@deepseek-ai/dsh-api-gateway/client.js?rev=965b70361a00","rev":"965b70361a00","inject":["@deepseek-ai/dsh-typert-registry","@deepseek-ai/dsh-client-connection"],"immediately":true},{"id":"@deepseek-ai/dsh-client-modules","url":"/plugins/@deepseek-ai/dsh-client-modules/client.js?rev=7eb526320903","rev":"7eb526320903","inject":[],"immediately":true},{"id":"@deepseek-ai/dsh-client-connection","url":"/plugins/@deepseek-ai/dsh-client-connection/client.js?rev=c54bce6ee644","rev":"c54bce6ee644","inject":[],"immediately":true},{"id":"@deepseek-ai/dsh-api-remotes","url":"/plugins/@deepseek-ai/dsh-api-remotes/client.js?rev=9a16f4532366","rev":"9a16f4532366","inject":["@deepseek-ai/dsh-api-gateway"],"immediately":true},{"id":"@deepseek-ai/dsh-client-runtime","url":"/plugins/@deepseek-ai/dsh-client-runtime/client.js?rev=5a9e129c42ae","rev":"5a9e129c42ae","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-typert-registry","@deepseek-ai/dsh-api-remotes"],"immediately":true},{"id":"@deepseek-ai/dsh-client-ui-theme","url":"/plugins/@deepseek-ai/dsh-client-ui-theme/client.js?rev=e19c47b60a1c","rev":"e19c47b60a1c","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes"],"immediately":true},{"id":"@deepseek-ai/dsh-client-locale","url":"/plugins/@deepseek-ai/dsh-client-locale/client.js?rev=2660ca3f6a00","rev":"2660ca3f6a00","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes"],"immediately":true},{"id":"@deepseek-ai/dsh-client-ui-layout","url":"/plugins/@deepseek-ai/dsh-client-ui-layout/client.js?rev=abdb7f55acba","rev":"abdb7f55acba","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-theme"]},{"id":"@deepseek-ai/dsh-client-ui-renderer","url":"/plugins/@deepseek-ai/dsh-client-ui-renderer/client.js?rev=79b59d365f3b","rev":"79b59d365f3b","inject":["@deepseek-ai/dsh-client-runtime"],"immediately":true},{"id":"@deepseek-ai/dsh-client-ui-sidebar","url":"/plugins/@deepseek-ai/dsh-client-ui-sidebar/client.js?rev=d1f4cbcb94e2","rev":"d1f4cbcb94e2","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-layout","@deepseek-ai/dsh-client-locale"]},{"id":"@deepseek-ai/dsh-client-ui-settings","url":"/plugins/@deepseek-ai/dsh-client-ui-settings/client.js?rev=5d1695c62b38","rev":"5d1695c62b38","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-settings-general","url":"/plugins/@deepseek-ai/dsh-client-ui-settings-general/client.js?rev=f733efde3f2f","rev":"f733efde3f2f","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-sidebar"]},{"id":"@deepseek-ai/dsh-client-ui-settings-models","url":"/plugins/@deepseek-ai/dsh-client-ui-settings-models/client.js?rev=f12fb342db3b","rev":"f12fb342db3b","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-conversation","url":"/plugins/@deepseek-ai/dsh-client-ui-conversation/client.js?rev=3bbe1845a0fd","rev":"3bbe1845a0fd","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-layout"]},{"id":"@deepseek-ai/dsh-client-ui-brand-official","url":"/plugins/@deepseek-ai/dsh-client-ui-brand-official/client.js?rev=c426d52ce216","rev":"c426d52ce216","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-sidebar"]},{"id":"@deepseek-ai/dsh-client-ui-attachment","url":"/plugins/@deepseek-ai/dsh-client-ui-attachment/client.js?rev=5349ce7aa495","rev":"5349ce7aa495","inject":["@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-tool","url":"/plugins/@deepseek-ai/dsh-client-ui-tool/client.js?rev=48c8d92e8828","rev":"48c8d92e8828","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-workflow-run","url":"/plugins/@deepseek-ai/dsh-client-ui-workflow-run/client.js?rev=60e130ad4f36","rev":"60e130ad4f36","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-deliverables","url":"/plugins/@deepseek-ai/dsh-client-ui-deliverables/client.js?rev=13a78ee19f2e","rev":"13a78ee19f2e","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-workspace","url":"/plugins/@deepseek-ai/dsh-client-ui-workspace/client.js?rev=c3b628226e01","rev":"c3b628226e01","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-sidebar"]},{"id":"@deepseek-ai/dsh-client-ui-input-trigger","url":"/plugins/@deepseek-ai/dsh-client-ui-input-trigger/client.js?rev=b9564b9138a7","rev":"b9564b9138a7","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale"]},{"id":"@deepseek-ai/dsh-client-ui-commands","url":"/plugins/@deepseek-ai/dsh-client-ui-commands/client.js?rev=887c0ca028a4","rev":"887c0ca028a4","inject":["@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-input-trigger","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-skill","url":"/plugins/@deepseek-ai/dsh-client-ui-skill/client.js?rev=f229a70eecce","rev":"f229a70eecce","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-tool","@deepseek-ai/dsh-client-ui-input-trigger","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-subagent","url":"/plugins/@deepseek-ai/dsh-client-ui-subagent/client.js?rev=0bb1ff842ae8","rev":"0bb1ff842ae8","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-primitives","@deepseek-ai/dsh-client-ui-input-trigger"]},{"id":"@deepseek-ai/dsh-client-ui-jobs","url":"/plugins/@deepseek-ai/dsh-client-ui-jobs/client.js?rev=ed0d04a8c154","rev":"ed0d04a8c154","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-primitives"]},{"id":"@deepseek-ai/dsh-client-ui-model-selection","url":"/plugins/@deepseek-ai/dsh-client-ui-model-selection/client.js?rev=639da97bfe66","rev":"639da97bfe66","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-commands","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-permission-presets","url":"/plugins/@deepseek-ai/dsh-client-ui-permission-presets/client.js?rev=6cbbb8ca6afc","rev":"6cbbb8ca6afc","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-commands","@deepseek-ai/dsh-api-remotes","@deepseek-ai/dsh-client-ui-settings"]},{"id":"@deepseek-ai/dsh-client-ui-agent-preset","url":"/plugins/@deepseek-ai/dsh-client-ui-agent-preset/client.js?rev=96dbaff92d41","rev":"96dbaff92d41","inject":["@deepseek-ai/dsh-client-connection","@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-api-remotes"]},{"id":"@deepseek-ai/dsh-client-ui-user-questions","url":"/plugins/@deepseek-ai/dsh-client-ui-user-questions/client.js?rev=350ccf0385ba","rev":"350ccf0385ba","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"@deepseek-ai/dsh-client-ui-trajectory","url":"/plugins/@deepseek-ai/dsh-client-ui-trajectory/client.js?rev=3345fd0d652c","rev":"3345fd0d652c","inject":["@deepseek-ai/dsh-client-locale","@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-conversation"]},{"id":"dsh-edge-client-ui","url":"/plugins/dsh-edge-client-ui/client.js?rev=015841184f9e","rev":"015841184f9e","inject":["@deepseek-ai/dsh-client-runtime","@deepseek-ai/dsh-client-ui-settings","@deepseek-ai/dsh-client-locale"]}]}</script>
|
|
43
43
|
<meta charset="utf-8" />
|
|
44
44
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
45
45
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
@@ -527,11 +527,14 @@ window.__ModuleLoader__.load({
|
|
|
527
527
|
const inject = [
|
|
528
528
|
"slots",
|
|
529
529
|
"locale",
|
|
530
|
-
"
|
|
530
|
+
"settingsScope"
|
|
531
531
|
];
|
|
532
532
|
function apply(ctx) {
|
|
533
|
-
const
|
|
534
|
-
if (
|
|
533
|
+
const mirror = ctx.settingsScope.describe();
|
|
534
|
+
if (mirror.persistence === "memory") {
|
|
535
|
+
mirror.persistence = "host";
|
|
536
|
+
mirror.load();
|
|
537
|
+
}
|
|
535
538
|
ctx.effect(() => ctx.locale.register("settings.edge", {
|
|
536
539
|
en,
|
|
537
540
|
zh
|
package/package.json
CHANGED
package/scripts/cli.mjs
CHANGED
|
@@ -206,7 +206,7 @@ export function createInstallerUi(
|
|
|
206
206
|
},
|
|
207
207
|
async deepSeekKey(validate) {
|
|
208
208
|
const mode = await requireAnswer(await clack.select(withOutput({
|
|
209
|
-
message: '
|
|
209
|
+
message: 'Configure provider key',
|
|
210
210
|
initialValue: 'enter',
|
|
211
211
|
signal,
|
|
212
212
|
options: [
|
package/worker/direct/index.js
CHANGED
|
@@ -709,7 +709,7 @@ ${n}`:""}`}});function NN(e){if(e.url.trim().length===0)throw new Error("url mus
|
|
|
709
709
|
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; }
|
|
710
710
|
.secondary { background: #29314b; color: #edf2ff; }
|
|
711
711
|
.error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
|
|
712
|
-
`}l(OR,"pageStyles");var tue="https://api.deepseek.com";var rue="deepseek-v4-flash",nue="high";var iue=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function lk(e){let t=e??tue,r;try{r=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(r.protocol!=="http:"&&r.protocol!=="https:"||r.username.length>0||r.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(lk,"resolveEdgeBaseURL");function sf(e){if(e===void 0)return rue;if(!iue.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(sf,"resolveEdgeModel");function ck(e){if(e===void 0)return nue;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(ck,"resolveEdgeReasoningEffort");function uk(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(uk,"resolveEdgeStreamIdleTimeoutMs");function dk(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(dk,"resolveEdgeMaxOutputTokens");var fk={name:"dsh-edge",version:"0.4.0-alpha.3",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.1","@deepseek-ai/dsh-attachment":"0.1.1-rc.1","@deepseek-ai/dsh-brand":"0.1.1-rc.1","@deepseek-ai/dsh-credentials":"0.1.1-rc.1","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.1","@deepseek-ai/dsh-llm":"0.1.1-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.1","@deepseek-ai/dsh-session":"0.1.1-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.1","@deepseek-ai/dsh-session-query":"0.1.1-rc.1","@deepseek-ai/dsh-session-title":"0.1.1-rc.1","@deepseek-ai/dsh-settings":"0.1.1-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.1","@deepseek-ai/dsh-tool-web":"0.1.1-rc.1","@deepseek-ai/dsh-tools":"0.1.1-rc.1","@deepseek-ai/dsh-web":"0.1.1-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.1","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Ng=fk.version,NR=fk.dshEdge.upstreamVersion;function oue(){return"dsh-edge@0.4.0-alpha.3/direct"}l(oue,"resolveEdgeDeploymentId");function Rg(e){return{baseURL:lk(e.DEEPSEEK_BASE_URL),maxTokens:dk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:sf(e.DEEPSEEK_MODEL),reasoningEffort:ck(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:yg(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:uk(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ef(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Rg,"resolveEdgeDeploymentConfig");function aue(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(aue,"edgeDeploymentApiKeyConfigured");function lue(e){let t=lk(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(lue,"projectedEdgeBaseURL");function pk(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:oue(),apiKeyConfigured:aue(e),baseURL:lue(e.DEEPSEEK_BASE_URL),maxTokens:dk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:sf(e.DEEPSEEK_MODEL),reasoningEffort:ck(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:yg(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:uk(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ef(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(pk,"resolveEdgeDeploymentProfile");function RR(e){Rg(e);let t=pk(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:Ng,upstreamVersion:NR,status:"ready"}}l(RR,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as uLe}from"cloudflare:workers";var El=ay(PR());var hk=l((e,t,r)=>{let n=e instanceof RegExp?DR(e,r):e,i=t instanceof RegExp?DR(t,r):t,s=n!==null&&i!=null&&cue(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"),DR=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),cue=l((e,t,r)=>{let n,i,s,o,a,c=r.indexOf(e),u=r.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(n=[],s=r.length;d>=0&&!a;){if(d===c)n.push(d),c=r.indexOf(e,d+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=r.indexOf(t,d+1);d=c<u&&c>=0?c:u}n.length&&o!==void 0&&(a=[s,o])}return a},"range");var LR="\0SLASH"+Math.random()+"\0",MR="\0OPEN"+Math.random()+"\0",yk="\0CLOSE"+Math.random()+"\0",FR="\0COMMA"+Math.random()+"\0",UR="\0PERIOD"+Math.random()+"\0",uue=new RegExp(LR,"g"),due=new RegExp(MR,"g"),fue=new RegExp(yk,"g"),pue=new RegExp(FR,"g"),hue=new RegExp(UR,"g"),mue=/\\\\/g,gue=/\\{/g,yue=/\\}/g,vue=/\\,/g,wue=/\\\./g,bue=1e5,xue=4e6;function mk(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(mk,"numeric");function Eue(e){return e.replace(mue,LR).replace(gue,MR).replace(yue,yk).replace(vue,FR).replace(wue,UR)}l(Eue,"escapeBraces");function Sue(e){return e.replace(uue,"\\").replace(due,"{").replace(fue,"}").replace(pue,",").replace(hue,".")}l(Sue,"unescapeBraces");function jR(e){if(!e)return[""];let t=[],r=hk("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=jR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(jR,"parseCommaParts");function zR(e,t={}){if(!e)return[];let{max:r=bue,maxLength:n=xue}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),gk(Eue(e),r,n,!0).map(Sue)}l(zR,"expand");function kue(e){return"{"+e+"}"}l(kue,"embrace");function Aue(e){return/^-?0\d/.test(e)}l(Aue,"isPadded");function Iue(e,t){return e<=t}l(Iue,"lte");function $ue(e,t){return e>=t}l($ue,"gte");function of(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(of,"combine");function _ue(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=mk(i[0]),a=mk(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(mk(i[2])),1):1,d=Iue;a<o&&(u*=-1,d=$ue);let p=i.some(Aue),h=0;for(let m=o;d(m,a)&&s.length<r;m+=u){let g;if(t)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),p){let y=c-g.length;if(y>0){let x=new Array(y+1).join("0");m<0?g="-"+x+g.slice(1):g=x+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(_ue,"expandSequence");function gk(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=hk("{","}",e);if(!a)return of(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=of(i,c+"{"+a.body+"}",[""],t,r,s&&!a.post.length),o=!1,!a.post.length)break;e=a.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),f=u||d,p=a.body.indexOf(",")>=0;if(!f&&!p){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+yk+a.post,n=!0;continue}return of(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!f,o=!1);let h;if(f)h=_ue(a.body,d,t,r);else{let m=jR(a.body);if(m.length===1&&m[0]!==void 0&&(m=gk(m[0],t,r,!1).map(kue),m.length===1)){if(i=of(i,c+m[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let g=s&&!a.post.length&&!c;for(let x=0;g&&x<i.length;x++)i[x]&&(g=!1);h=[];let y=0;e:for(let x=0;x<m.length;x++){let w=gk(m[x],t,r,!1);for(let b=0;b<w.length;b++){let k=w[b];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=of(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(gk,"expand_");var af=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Tue={"[: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]},lf=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Cue=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),BR=l(e=>e.join(""),"rangesToString"),WR=l((e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,u=!1,d=r,f="";e:for(;s<e.length;){let g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){u=!0,s++;continue}if(g==="]"&&o&&!c){d=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(let[y,[x,w,b]]of Object.entries(Tue))if(e.startsWith(y,s)){if(f)return["$.",!1,e.length-r,!0];s+=y.length,b?i.push(x):n.push(x),a=a||w;continue e}}if(c=!1,f){g>f?n.push(lf(f)+"-"+lf(g)):g===f&&n.push(lf(g)),f="",s++;continue}if(e.startsWith("-]",s+1)){n.push(lf(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=g,s+=2;continue}n.push(lf(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[Cue(g),!1,d-r,!1]}let p="["+(u?"^":"")+BR(n)+"]",h="["+(u?"":"^")+BR(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,a,d-r,!0]},"parseClass");var Ko=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var Hn,Oue=new Set(["!","?","+","*","@"]),vk=l(e=>Oue.has(e),"isExtglobType"),qR=l(e=>vk(e.type),"isExtglobAST"),Nue=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Rue=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Pue=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),HR=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Due="(?!(?:^|/)\\.\\.?(?:$|/))",Dg="(?!\\.)",Lue=new Set(["[","."]),Mue=new Set(["..","."]),Fue=new Set("().*{}+?[]^$\\!"),Uue=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),wk="[^/]",GR=wk+"*?",VR=wk+"+?",jue=0,Ha=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++jue;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#u&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Hn&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Hn&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new Hn(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#h(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let g=n,y="";for(;g<t.length;){let x=t.charAt(g++);if(a||x==="\\"){a=!a,y+=x;continue}if(c){g===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(g===u+2&&d)&&(c=!1),y+=x;continue}else if(x==="["){c=!0,u=g,d=!1,y+=x;continue}if(!i.noext&&vk(x)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let b=new Hn(x,r);g=Hn.#h(t,b,g,i,s+1),r.push(b);continue}y+=x}return r.push(y),g}let f=n+1,p=new Hn(null,r),h=[],m="";for(;f<t.length;){let g=t.charAt(f++);if(a||g==="\\"){a=!a,m+=g;continue}if(c){f===u+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(f===u+2&&d)&&(c=!1),m+=g;continue}else if(g==="["){c=!0,u=f,d=!1,m+=g;continue}if(!i.noext&&vk(g)&&t.charAt(f)==="("&&(s<=o||r&&r.#g(g))){let x=r&&r.#g(g)?0:1;p.push(m),m="";let w=new Hn(g,p);p.push(w),f=Hn.#h(t,w,f,i,s+x);continue}if(g==="|"){p.push(m),m="",h.push(p),p=new Hn(null,r);continue}if(g===")")return m===""&&r.#t.length===0&&(r.#c=!0),p.push(m),m="",r.push(...h,p),f;m+=g}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],f}#C(t){return this.#m(t,Rue)}#m(t,r=Nue){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=Pue){return!!r.get(this.type)?.includes(t)}#f(t,r){let n=t.#t[0],i=new Hn(null,n,this.options);i.#t.push(""),n.push(i),this.#E(t,r)}#E(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#S(t){return!!HR.get(this.type)?.has(t)}#O(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#S(r.type)}#y(t){let r=HR.get(this.type),n=t.#t[0],i=r?.get(n.type);if(!i)return!1;this.#t=n.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#o=void 0,this.#c=!1}static fromGlob(t,r={}){let n=new Hn(null,void 0,r);return Hn.#h(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!qR(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,x]=typeof h=="string"?Hn.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||x,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Mue.has(this.#t[0]))){let m=Lue,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?Due:y?Dg:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Ko(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,Ko(this.toString()),!1,!1]}let o=!n||t||r||!Dg?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Dg:"")+VR;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Dg:"")+GR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Ko(s),this.#r=!!this.#r,this.#n]}#p(){if(qR(this)){let t=0,r=!1;do{r=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#p(),this.#m(i)?(r=!1,this.#E(i,n)):this.#C(i)?(r=!1,this.#f(i,n)):this.#O(i)&&(r=!1,this.#y(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#v(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(t,r,n=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(Fue.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?VR:GR,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,f,p,h]=WR(t,c);if(p){s+=d,o=o||f,c+=p-1,r=r||h;continue}}if(u==="?"){s+=wk,r=!0;continue}s+=Uue(u)}return[s,Ko(t),!!r,o]}};Hn=Ha;var bk=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Xr=l((e,t,r={})=>(af(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Ac(t,r).match(e)),"minimatch"),zue=/^\*+([^+@!?*[(]*)$/,Bue=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),Wue=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),que=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Hue=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),Gue=/^\*+\.\*+$/,Vue=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Zue=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Kue=/^\.\*+$/,Yue=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Xue=/^\*+$/,Jue=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Que=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),ede=/^\?+([^+@!?*[(]*)?$/,tde=l(([e,t=""])=>{let r=YR([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),rde=l(([e,t=""])=>{let r=XR([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),nde=l(([e,t=""])=>{let r=XR([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),ide=l(([e,t=""])=>{let r=YR([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),YR=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),XR=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),JR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",ZR={win32:{sep:"\\"},posix:{sep:"/"}},sde=JR==="win32"?ZR.win32.sep:ZR.posix.sep;Xr.sep=sde;var vn=Symbol("globstar **");Xr.GLOBSTAR=vn;var ode="[^/]",ade=ode+"*?",lde="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",cde="(?:(?!(?:\\/|^)\\.).)*?",ude=l((e,t={})=>r=>Xr(r,e,t),"filter");Xr.filter=ude;var bi=l((e,t={})=>Object.assign({},e,t),"ext"),dde=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Xr;let t=Xr;return Object.assign(l((n,i,s={})=>t(n,i,bi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,bi(e,s))}static defaults(i){return t.defaults(bi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,bi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,bi(e,s))}},unescape:l((n,i={})=>t.unescape(n,bi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,bi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,bi(e,i)),"filter"),defaults:l(n=>t.defaults(bi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,bi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,bi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,bi(e,s)),"match"),sep:t.sep,GLOBSTAR:vn})},"defaults");Xr.defaults=dde;var QR=l((e,t={})=>(af(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:zR(e,{max:t.braceExpandMax})),"braceExpand");Xr.braceExpand=QR;var fde=l((e,t={})=>new Ac(e,t).makeRe(),"makeRe");Xr.makeRe=fde;var pde=l((e,t,r={})=>{let n=new Ac(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Xr.match=pde;var KR=/[?*]|[+@!]\(.*?\)|\[|\]/,hde=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Ac=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={}){af(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||JR,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]==="?"||!KR.test(s[2]))&&!KR.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n of t)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],u=n[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let d=n.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,s=0,o=[],a="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(a==="b"?r[s]:t[i]),i++,s++;else if(n&&t[i]==="**"&&r[s]===t[i+1])o.push(t[i]),i++;else if(n&&r[s]==="**"&&t[i]===r[s+1])o.push(r[s]),s++;else if(t[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=0,s=0;if(this.isWindows){let a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),f=c?3:a?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,m]=[t[f],r[p]];h.toLowerCase()===m.toLowerCase()&&(r[p]=h,s=p,i=f)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(vn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(vn,s),a=r.lastIndexOf(vn),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,a),r.slice(a+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#n(w,c,n,0,0))return!1;i+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#n(t,d,n,w,0))f=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#n(t,d,n,w,0)))return!1;f=d.length+1}}if(!u.length){let w=!!f;for(let b=i;b<t.length-f;b++){let k=String(t[b]);if(w=!0,k==="."||k===".."||!this.options.dot&&k.startsWith("."))return!1}return n||w}let p=[[[],0]],h=p[0],m=0,g=[0];for(let w of u)w===vn?(g.push(m),h=[[],0],p.push(h)):(h[0].push(w),m++);let y=p.length-1,x=t.length-f;for(let w of p)w[1]=x-(g[y--]+w[0].length);return!!this.#r(t,p,i,0,n,0,!!f)}#r(t,r,n,i,s,o,a){let c=r[i];if(!c){for(let f=n;f<t.length;f++){a=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return a}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(h!==!1)return h}let p=t[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(t,r,n,i,s){let o,a,c,u;for(o=i,a=s,u=t.length,c=r.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");let d=r[a],f=t[o];if(this.debug(r,d,f),d===!1||d===vn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return QR(this.pattern,this.options)}parse(t){af(t);let r=this.options;if(t==="**")return vn;if(t==="")return"";let n,i=null;(n=t.match(Xue))?i=r.dot?Que:Jue:(n=t.match(zue))?i=(r.nocase?r.dot?Hue:que:r.dot?Wue:Bue)(n[1]):(n=t.match(ede))?i=(r.nocase?r.dot?rde:tde:r.dot?nde:ide)(n):(n=t.match(Gue))?i=r.dot?Zue:Vue:(n=t.match(Kue))&&(i=Yue);let s=Ha.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?ade:r.dot?lde:cde,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))i.add(p);return typeof f=="string"?hde(f):f===vn?vn:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==vn||m===vn||(m===void 0?h!==void 0&&h!==vn?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=m+"(?:\\/|\\/"+n+")?":h!==vn&&(u[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=vn))});let d=u.filter(f=>f!==vn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a of s){let c=i;if(n.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return Xr.defaults(t).Minimatch}};Xr.AST=Ha;Xr.Minimatch=Ac;Xr.escape=bk;Xr.unescape=Ko;import{gunzipSync as hpe}from"node:zlib";var cf=class{static{l(this,"Diff")}diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=l(w=>{if(w=this.postProcess(w,n),i){setTimeout(function(){i(w)},0);return}else return w},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&m+1>=a)return o(this.buildValues(h[0].lastComponent,r,t));let g=-1/0,y=1/0,x=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let b,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let O=S.oldPos-w;A=S&&0<=O&&O<a}let $=k&&k.oldPos+1<c;if(!A&&!$){h[w]=void 0;continue}if(!$||A&&k.oldPos<S.oldPos?b=this.addToPath(S,!0,!1,0,n):b=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(b,r,t,w,n),b.oldPos+1>=c&&m+1>=a)return o(this.buildValues(b.lastComponent,r,t))||!0;h[w]=b,b.oldPos+1>=c&&(y=Math.min(y,w-1)),m+1>=a&&(g=Math.max(g,w+1))}u++},"execEditLength");if(i)l(function w(){setTimeout(function(){if(u>d||Date.now()>p)return i(void 0);x()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let w=x();if(w)return w}}addToPath(t,r,n,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){let o=r.length,a=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,a=0,c=0,u=0;for(;a<o;a++){let d=i[a];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=r.slice(c,c+d.count);f=f.map(function(p,h){let m=n[u+h];return m.length>p.length?m:p}),d.value=this.join(f)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var xk=class extends cf{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=gde}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
712
|
+
`}l(OR,"pageStyles");var tue="https://api.deepseek.com";var rue="deepseek-v4-flash",nue="high";var iue=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function lk(e){let t=e??tue,r;try{r=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(r.protocol!=="http:"&&r.protocol!=="https:"||r.username.length>0||r.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(lk,"resolveEdgeBaseURL");function sf(e){if(e===void 0)return rue;if(!iue.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(sf,"resolveEdgeModel");function ck(e){if(e===void 0)return nue;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(ck,"resolveEdgeReasoningEffort");function uk(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(uk,"resolveEdgeStreamIdleTimeoutMs");function dk(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(dk,"resolveEdgeMaxOutputTokens");var fk={name:"dsh-edge",version:"0.4.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.1","@deepseek-ai/dsh-attachment":"0.1.1-rc.1","@deepseek-ai/dsh-brand":"0.1.1-rc.1","@deepseek-ai/dsh-credentials":"0.1.1-rc.1","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.1","@deepseek-ai/dsh-llm":"0.1.1-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.1","@deepseek-ai/dsh-session":"0.1.1-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.1","@deepseek-ai/dsh-session-query":"0.1.1-rc.1","@deepseek-ai/dsh-session-title":"0.1.1-rc.1","@deepseek-ai/dsh-settings":"0.1.1-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.1","@deepseek-ai/dsh-tool-web":"0.1.1-rc.1","@deepseek-ai/dsh-tools":"0.1.1-rc.1","@deepseek-ai/dsh-web":"0.1.1-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.1","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Ng=fk.version,NR=fk.dshEdge.upstreamVersion;function oue(){return"dsh-edge@0.4.0/direct"}l(oue,"resolveEdgeDeploymentId");function Rg(e){return{baseURL:lk(e.DEEPSEEK_BASE_URL),maxTokens:dk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:sf(e.DEEPSEEK_MODEL),reasoningEffort:ck(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:yg(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:uk(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ef(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Rg,"resolveEdgeDeploymentConfig");function aue(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(aue,"edgeDeploymentApiKeyConfigured");function lue(e){let t=lk(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}l(lue,"projectedEdgeBaseURL");function pk(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:oue(),apiKeyConfigured:aue(e),baseURL:lue(e.DEEPSEEK_BASE_URL),maxTokens:dk(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:sf(e.DEEPSEEK_MODEL),reasoningEffort:ck(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:yg(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:uk(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ef(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(pk,"resolveEdgeDeploymentProfile");function RR(e){Rg(e);let t=pk(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:Ng,upstreamVersion:NR,status:"ready"}}l(RR,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as uLe}from"cloudflare:workers";var El=ay(PR());var hk=l((e,t,r)=>{let n=e instanceof RegExp?DR(e,r):e,i=t instanceof RegExp?DR(t,r):t,s=n!==null&&i!=null&&cue(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"),DR=l((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),cue=l((e,t,r)=>{let n,i,s,o,a,c=r.indexOf(e),u=r.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(n=[],s=r.length;d>=0&&!a;){if(d===c)n.push(d),c=r.indexOf(e,d+1);else if(n.length===1){let f=n.pop();f!==void 0&&(a=[f,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=r.indexOf(t,d+1);d=c<u&&c>=0?c:u}n.length&&o!==void 0&&(a=[s,o])}return a},"range");var LR="\0SLASH"+Math.random()+"\0",MR="\0OPEN"+Math.random()+"\0",yk="\0CLOSE"+Math.random()+"\0",FR="\0COMMA"+Math.random()+"\0",UR="\0PERIOD"+Math.random()+"\0",uue=new RegExp(LR,"g"),due=new RegExp(MR,"g"),fue=new RegExp(yk,"g"),pue=new RegExp(FR,"g"),hue=new RegExp(UR,"g"),mue=/\\\\/g,gue=/\\{/g,yue=/\\}/g,vue=/\\,/g,wue=/\\\./g,bue=1e5,xue=4e6;function mk(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(mk,"numeric");function Eue(e){return e.replace(mue,LR).replace(gue,MR).replace(yue,yk).replace(vue,FR).replace(wue,UR)}l(Eue,"escapeBraces");function Sue(e){return e.replace(uue,"\\").replace(due,"{").replace(fue,"}").replace(pue,",").replace(hue,".")}l(Sue,"unescapeBraces");function jR(e){if(!e)return[""];let t=[],r=hk("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let a=jR(s);return s.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),t.push.apply(t,o),t}l(jR,"parseCommaParts");function zR(e,t={}){if(!e)return[];let{max:r=bue,maxLength:n=xue}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),gk(Eue(e),r,n,!0).map(Sue)}l(zR,"expand");function kue(e){return"{"+e+"}"}l(kue,"embrace");function Aue(e){return/^-?0\d/.test(e)}l(Aue,"isPadded");function Iue(e,t){return e<=t}l(Iue,"lte");function $ue(e,t){return e>=t}l($ue,"gte");function of(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(of,"combine");function _ue(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=mk(i[0]),a=mk(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(mk(i[2])),1):1,d=Iue;a<o&&(u*=-1,d=$ue);let p=i.some(Aue),h=0;for(let m=o;d(m,a)&&s.length<r;m+=u){let g;if(t)g=String.fromCharCode(m),g==="\\"&&(g="");else if(g=String(m),p){let y=c-g.length;if(y>0){let x=new Array(y+1).join("0");m<0?g="-"+x+g.slice(1):g=x+g}}if(h+g.length>n)break;s.push(g),h+=g.length}return s}l(_ue,"expandSequence");function gk(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let a=hk("{","}",e);if(!a)return of(i,e,[""],t,r,s);let c=a.pre;if(/\$$/.test(c)){if(i=of(i,c+"{"+a.body+"}",[""],t,r,s&&!a.post.length),o=!1,!a.post.length)break;e=a.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),f=u||d,p=a.body.indexOf(",")>=0;if(!f&&!p){if(a.post.match(/,(?!,).*\}/)){e=a.pre+"{"+a.body+yk+a.post,n=!0;continue}return of(i,c+"{"+a.body+"}"+a.post,[""],t,r,s)}o&&(s=n&&!f,o=!1);let h;if(f)h=_ue(a.body,d,t,r);else{let m=jR(a.body);if(m.length===1&&m[0]!==void 0&&(m=gk(m[0],t,r,!1).map(kue),m.length===1)){if(i=of(i,c+m[0],[""],t,r,s&&!a.post.length),!a.post.length)break;e=a.post;continue}let g=s&&!a.post.length&&!c;for(let x=0;g&&x<i.length;x++)i[x]&&(g=!1);h=[];let y=0;e:for(let x=0;x<m.length;x++){let w=gk(m[x],t,r,!1);for(let b=0;b<w.length;b++){let k=w[b];if(!(g&&!k)){if(h.length>=t||y+k.length>r)break e;h.push(k),y+=k.length}}}}if(i=of(i,c,h,t,r,s&&!a.post.length),!a.post.length)break;e=a.post}return i}l(gk,"expand_");var af=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var Tue={"[: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]},lf=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),Cue=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),BR=l(e=>e.join(""),"rangesToString"),WR=l((e,t)=>{let r=t;if(e.charAt(r)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=r+1,o=!1,a=!1,c=!1,u=!1,d=r,f="";e:for(;s<e.length;){let g=e.charAt(s);if((g==="!"||g==="^")&&s===r+1){u=!0,s++;continue}if(g==="]"&&o&&!c){d=s+1;break}if(o=!0,g==="\\"&&!c){c=!0,s++;continue}if(g==="["&&!c){for(let[y,[x,w,b]]of Object.entries(Tue))if(e.startsWith(y,s)){if(f)return["$.",!1,e.length-r,!0];s+=y.length,b?i.push(x):n.push(x),a=a||w;continue e}}if(c=!1,f){g>f?n.push(lf(f)+"-"+lf(g)):g===f&&n.push(lf(g)),f="",s++;continue}if(e.startsWith("-]",s+1)){n.push(lf(g+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=g,s+=2;continue}n.push(lf(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[Cue(g),!1,d-r,!1]}let p="["+(u?"^":"")+BR(n)+"]",h="["+(u?"":"^")+BR(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,a,d-r,!0]},"parseClass");var Ko=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!0}={})=>r?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var Hn,Oue=new Set(["!","?","+","*","@"]),vk=l(e=>Oue.has(e),"isExtglobType"),qR=l(e=>vk(e.type),"isExtglobAST"),Nue=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Rue=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Pue=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),HR=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Due="(?!(?:^|/)\\.\\.?(?:$|/))",Dg="(?!\\.)",Lue=new Set(["[","."]),Mue=new Set(["..","."]),Fue=new Set("().*{}+?[]^$\\!"),Uue=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),wk="[^/]",GR=wk+"*?",VR=wk+"+?",jue=0,Ha=class{static{l(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#u=!1;#l;#o;#c=!1;id=++jue;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#u&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Hn&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Hn&&n.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let r=new Hn(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#h(t,r,n,i,s){let o=i.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(r.type===null){let g=n,y="";for(;g<t.length;){let x=t.charAt(g++);if(a||x==="\\"){a=!a,y+=x;continue}if(c){g===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(g===u+2&&d)&&(c=!1),y+=x;continue}else if(x==="["){c=!0,u=g,d=!1,y+=x;continue}if(!i.noext&&vk(x)&&t.charAt(g)==="("&&s<=o){r.push(y),y="";let b=new Hn(x,r);g=Hn.#h(t,b,g,i,s+1),r.push(b);continue}y+=x}return r.push(y),g}let f=n+1,p=new Hn(null,r),h=[],m="";for(;f<t.length;){let g=t.charAt(f++);if(a||g==="\\"){a=!a,m+=g;continue}if(c){f===u+1?(g==="^"||g==="!")&&(d=!0):g==="]"&&!(f===u+2&&d)&&(c=!1),m+=g;continue}else if(g==="["){c=!0,u=f,d=!1,m+=g;continue}if(!i.noext&&vk(g)&&t.charAt(f)==="("&&(s<=o||r&&r.#g(g))){let x=r&&r.#g(g)?0:1;p.push(m),m="";let w=new Hn(g,p);p.push(w),f=Hn.#h(t,w,f,i,s+x);continue}if(g==="|"){p.push(m),m="",h.push(p),p=new Hn(null,r);continue}if(g===")")return m===""&&r.#t.length===0&&(r.#c=!0),p.push(m),m="",r.push(...h,p),f;m+=g}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],f}#C(t){return this.#m(t,Rue)}#m(t,r=Nue){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=Pue){return!!r.get(this.type)?.includes(t)}#f(t,r){let n=t.#t[0],i=new Hn(null,n,this.options);i.#t.push(""),n.push(i),this.#E(t,r)}#E(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#S(t){return!!HR.get(this.type)?.has(t)}#O(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#S(r.type)}#y(t){let r=HR.get(this.type),n=t.#t[0],i=r?.get(n.type);if(!i)return!1;this.#t=n.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#o=void 0,this.#c=!1}static fromGlob(t,r={}){let n=new Hn(null,void 0,r);return Hn.#h(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let a=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,a),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!qR(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[m,g,y,x]=typeof h=="string"?Hn.#k(h,this.#r,c):h.toRegExpSource(t);return this.#r=this.#r||y,this.#n=this.#n||x,m}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&Mue.has(this.#t[0]))){let m=Lue,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?Due:y?Dg:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Ko(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,Ko(this.toString()),!1,!1]}let o=!n||t||r||!Dg?"":this.#v(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!r?Dg:"")+VR;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Dg:"")+GR+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+c}return[a,Ko(s),this.#r=!!this.#r,this.#n]}#p(){if(qR(this)){let t=0,r=!1;do{r=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#p(),this.#m(i)?(r=!1,this.#E(i,n)):this.#C(i)?(r=!1,this.#f(i,n)):this.#O(i)&&(r=!1,this.#y(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#o=void 0}#v(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#k(t,r,n=!1){let i=!1,s="",o=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(Fue.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,s+=n&&/^[*]+$/.test(t)?VR:GR,r=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,f,p,h]=WR(t,c);if(p){s+=d,o=o||f,c+=p-1,r=r||h;continue}}if(u==="?"){s+=wk,r=!0;continue}s+=Uue(u)}return[s,Ko(t),!!r,o]}};Hn=Ha;var bk=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Xr=l((e,t,r={})=>(af(t),!r.nocomment&&t.charAt(0)==="#"?!1:new Ac(t,r).match(e)),"minimatch"),zue=/^\*+([^+@!?*[(]*)$/,Bue=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),Wue=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),que=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),Hue=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),Gue=/^\*+\.\*+$/,Vue=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Zue=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),Kue=/^\.\*+$/,Yue=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),Xue=/^\*+$/,Jue=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),Que=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),ede=/^\?+([^+@!?*[(]*)?$/,tde=l(([e,t=""])=>{let r=YR([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),rde=l(([e,t=""])=>{let r=XR([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),nde=l(([e,t=""])=>{let r=XR([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),ide=l(([e,t=""])=>{let r=YR([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),YR=l(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),XR=l(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),JR=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",ZR={win32:{sep:"\\"},posix:{sep:"/"}},sde=JR==="win32"?ZR.win32.sep:ZR.posix.sep;Xr.sep=sde;var vn=Symbol("globstar **");Xr.GLOBSTAR=vn;var ode="[^/]",ade=ode+"*?",lde="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",cde="(?:(?!(?:\\/|^)\\.).)*?",ude=l((e,t={})=>r=>Xr(r,e,t),"filter");Xr.filter=ude;var bi=l((e,t={})=>Object.assign({},e,t),"ext"),dde=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Xr;let t=Xr;return Object.assign(l((n,i,s={})=>t(n,i,bi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(i,s={}){super(i,bi(e,s))}static defaults(i){return t.defaults(bi(e,i)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(i,s,o={}){super(i,s,bi(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,bi(e,s))}},unescape:l((n,i={})=>t.unescape(n,bi(e,i)),"unescape"),escape:l((n,i={})=>t.escape(n,bi(e,i)),"escape"),filter:l((n,i={})=>t.filter(n,bi(e,i)),"filter"),defaults:l(n=>t.defaults(bi(e,n)),"defaults"),makeRe:l((n,i={})=>t.makeRe(n,bi(e,i)),"makeRe"),braceExpand:l((n,i={})=>t.braceExpand(n,bi(e,i)),"braceExpand"),match:l((n,i,s={})=>t.match(n,i,bi(e,s)),"match"),sep:t.sep,GLOBSTAR:vn})},"defaults");Xr.defaults=dde;var QR=l((e,t={})=>(af(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:zR(e,{max:t.braceExpandMax})),"braceExpand");Xr.braceExpand=QR;var fde=l((e,t={})=>new Ac(e,t).makeRe(),"makeRe");Xr.makeRe=fde;var pde=l((e,t,r={})=>{let n=new Ac(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");Xr.match=pde;var KR=/[?*]|[+@!]\(.*?\)|\[|\]/,hde=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Ac=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={}){af(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||JR,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]==="?"||!KR.test(s[2]))&&!KR.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let n of t)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[i]="*");let{optimizationLevel:r=1}=this.options;return r>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):r>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(r=>{let n=-1;for(;(n=r.indexOf("**",n+1))!==-1;){let i=n;for(;r[i+1]==="**";)i++;i!==n&&r.splice(n,i-n)}return r})}levelOneOptimize(t){return t.map(r=>(r=r.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),r.length===0?[""]:r))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let r=!1;do{if(r=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(r=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(r=!0,t.pop())}let n=0;for(;(n=t.indexOf("..",n+1))!==-1;){let i=t[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(r=!0,t.splice(n-1,2),n-=2)}}while(r);return t.length===0?[""]:t}firstPhasePreProcess(t){let r=!1;do{r=!1;for(let n of t){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let a=n[i+1],c=n[i+2],u=n[i+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;r=!0,n.splice(i,1);let d=n.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let a=n[o];o===1&&a===""&&n[0]===""||(a==="."||a==="")&&(r=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(r=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){r=!0;let c=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...c),n.length===0&&n.push(""),s-=2}}}}while(r);return t}secondPhasePreProcess(t){for(let r=0;r<t.length-1;r++)for(let n=r+1;n<t.length;n++){let i=this.partsMatch(t[r],t[n],!this.preserveMultipleSlashes);if(i){t[r]=[],t[n]=i;break}}return t.filter(r=>r.length)}partsMatch(t,r,n=!1){let i=0,s=0,o=[],a="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(a==="b"?r[s]:t[i]),i++,s++;else if(n&&t[i]==="**"&&r[s]===t[i+1])o.push(t[i]),i++;else if(n&&r[s]==="**"&&t[i]===r[s+1])o.push(r[s]),s++;else if(t[i]==="*"&&r[s]&&(this.options.dot||!r[s].startsWith("."))&&r[s]!=="**"){if(a==="b")return!1;a="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(a==="a")return!1;a="b",o.push(r[s]),i++,s++}else return!1;return t.length===r.length&&o}parseNegate(){if(this.nonegate)return;let t=this.pattern,r=!1,n=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)r=!r,n++;n&&(this.pattern=t.slice(n)),this.negate=r}matchOne(t,r,n=!1){let i=0,s=0;if(this.isWindows){let a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),f=c?3:a?0:void 0,p=d?3:u?0:void 0;if(typeof f=="number"&&typeof p=="number"){let[h,m]=[t[f],r[p]];h.toLowerCase()===m.toLowerCase()&&(r[p]=h,s=p,i=f)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(vn)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(vn,s),a=r.lastIndexOf(vn),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,a),r.slice(a+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#n(w,c,n,0,0))return!1;i+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#n(t,d,n,w,0))f=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#n(t,d,n,w,0)))return!1;f=d.length+1}}if(!u.length){let w=!!f;for(let b=i;b<t.length-f;b++){let k=String(t[b]);if(w=!0,k==="."||k===".."||!this.options.dot&&k.startsWith("."))return!1}return n||w}let p=[[[],0]],h=p[0],m=0,g=[0];for(let w of u)w===vn?(g.push(m),h=[[],0],p.push(h)):(h[0].push(w),m++);let y=p.length-1,x=t.length-f;for(let w of p)w[1]=x-(g[y--]+w[0].length);return!!this.#r(t,p,i,0,n,0,!!f)}#r(t,r,n,i,s,o,a){let c=r[i];if(!c){for(let f=n;f<t.length;f++){a=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return a}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(t,r,n+u.length,i+1,s,o+1,a);if(h!==!1)return h}let p=t[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(t,r,n,i,s){let o,a,c,u;for(o=i,a=s,u=t.length,c=r.length;o<u&&a<c;o++,a++){this.debug("matchOne loop");let d=r[a],f=t[o];if(this.debug(r,d,f),d===!1||d===vn)return!1;let p;if(typeof d=="string"?(p=f===d,this.debug("string match",d,f,p)):(p=d.test(f),this.debug("pattern match",d,f,p)),!p)return!1}if(o===u&&a===c)return!0;if(o===u)return n;if(a===c)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return QR(this.pattern,this.options)}parse(t){af(t);let r=this.options;if(t==="**")return vn;if(t==="")return"";let n,i=null;(n=t.match(Xue))?i=r.dot?Que:Jue:(n=t.match(zue))?i=(r.nocase?r.dot?Hue:que:r.dot?Wue:Bue)(n[1]):(n=t.match(ede))?i=(r.nocase?r.dot?rde:tde:r.dot?nde:ide)(n):(n=t.match(Gue))?i=r.dot?Zue:Vue:(n=t.match(Kue))&&(i=Yue);let s=Ha.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?ade:r.dot?lde:cde,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))i.add(p);return typeof f=="string"?hde(f):f===vn?vn:f._src});u.forEach((f,p)=>{let h=u[p+1],m=u[p-1];f!==vn||m===vn||(m===void 0?h!==void 0&&h!==vn?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=m+"(?:\\/|\\/"+n+")?":h!==vn&&(u[p-1]=m+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=vn))});let d=u.filter(f=>f!==vn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[o,a]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+a+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,r=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&r)return!0;let n=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a of s){let c=i;if(n.matchBase&&a.length===1&&(c=[o]),this.matchOne(c,a,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return Xr.defaults(t).Minimatch}};Xr.AST=Ha;Xr.Minimatch=Ac;Xr.escape=bk;Xr.unescape=Ko;import{gunzipSync as hpe}from"node:zlib";var cf=class{static{l(this,"Diff")}diff(t,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(t,n),o=this.castInput(r,n),a=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(a,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=l(w=>{if(w=this.postProcess(w,n),i){setTimeout(function(){i(w)},0);return}else return w},"done"),a=r.length,c=t.length,u=1,d=a+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,t,0,n);if(h[0].oldPos+1>=c&&m+1>=a)return o(this.buildValues(h[0].lastComponent,r,t));let g=-1/0,y=1/0,x=l(()=>{for(let w=Math.max(g,-u);w<=Math.min(y,u);w+=2){let b,k=h[w-1],S=h[w+1];k&&(h[w-1]=void 0);let A=!1;if(S){let O=S.oldPos-w;A=S&&0<=O&&O<a}let $=k&&k.oldPos+1<c;if(!A&&!$){h[w]=void 0;continue}if(!$||A&&k.oldPos<S.oldPos?b=this.addToPath(S,!0,!1,0,n):b=this.addToPath(k,!1,!0,1,n),m=this.extractCommon(b,r,t,w,n),b.oldPos+1>=c&&m+1>=a)return o(this.buildValues(b.lastComponent,r,t))||!0;h[w]=b,b.oldPos+1>=c&&(y=Math.min(y,w-1)),m+1>=a&&(g=Math.max(g,w+1))}u++},"execEditLength");if(i)l(function w(){setTimeout(function(){if(u>d||Date.now()>p)return i(void 0);x()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let w=x();if(w)return w}}addToPath(t,r,n,i,s){let o=t.lastComponent;return o&&!s.oneChangePerToken&&o.added===r&&o.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:o.count+1,added:r,removed:n,previousComponent:o.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:o}}}extractCommon(t,r,n,i,s){let o=r.length,a=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<a&&this.equals(n[c+1],r[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,r,n){return n.comparator?n.comparator(t,r):t===r||!!n.ignoreCase&&t.toLowerCase()===r.toLowerCase()}removeEmpty(t){let r=[];for(let n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r}castInput(t,r){return t}tokenize(t,r){return Array.from(t)}join(t){return t.join("")}postProcess(t,r){return t}get useLongestToken(){return!1}buildValues(t,r,n){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let o=i.length,a=0,c=0,u=0;for(;a<o;a++){let d=i[a];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=r.slice(c,c+d.count);f=f.map(function(p,h){let m=n[u+h];return m.length>p.length?m:p}),d.value=this.join(f)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var xk=class extends cf{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=gde}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
713
713
|
`))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
|
|
714
714
|
`))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
|
|
715
715
|
`)&&(t=t.slice(0,-1)),r.endsWith(`
|
package/worker/isolated/index.js
CHANGED
|
@@ -709,7 +709,7 @@ ${i}`:""}`}});function TI(e){if(e.url.trim().length===0)throw new Error("url mus
|
|
|
709
709
|
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; }
|
|
710
710
|
.secondary { background: #29314b; color: #edf2ff; }
|
|
711
711
|
.error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
|
|
712
|
-
`}l(C$,"pageStyles");var Tee="https://api.deepseek.com";var Nee="deepseek-v4-flash",Ree="high";var Oee=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function qb(e){let t=e??Tee,n;try{n=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username.length>0||n.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(qb,"resolveEdgeBaseURL");function Kc(e){if(e===void 0)return Nee;if(!Oee.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(Kc,"resolveEdgeModel");function Hb(e){if(e===void 0)return Ree;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(Hb,"resolveEdgeReasoningEffort");function Gb(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(Gb,"resolveEdgeStreamIdleTimeoutMs");function Vb(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(Vb,"resolveEdgeMaxOutputTokens");var Zb={name:"dsh-edge",version:"0.4.0-alpha.3",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.1","@deepseek-ai/dsh-attachment":"0.1.1-rc.1","@deepseek-ai/dsh-brand":"0.1.1-rc.1","@deepseek-ai/dsh-credentials":"0.1.1-rc.1","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.1","@deepseek-ai/dsh-llm":"0.1.1-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.1","@deepseek-ai/dsh-session":"0.1.1-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.1","@deepseek-ai/dsh-session-query":"0.1.1-rc.1","@deepseek-ai/dsh-session-title":"0.1.1-rc.1","@deepseek-ai/dsh-settings":"0.1.1-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.1","@deepseek-ai/dsh-tool-web":"0.1.1-rc.1","@deepseek-ai/dsh-tools":"0.1.1-rc.1","@deepseek-ai/dsh-web":"0.1.1-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.1","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var rh=Zb.version,T$=Zb.dshEdge.upstreamVersion;function Dee(){return"dsh-edge@0.4.0-alpha.3/isolated"}l(Dee,"resolveEdgeDeploymentId");function ih(e){return{baseURL:qb(e.DEEPSEEK_BASE_URL),maxTokens:Vb(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Kc(e.DEEPSEEK_MODEL),reasoningEffort:Hb(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Bp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Gb(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Hc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(ih,"resolveEdgeDeploymentConfig");function Lee(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Lee,"edgeDeploymentApiKeyConfigured");function Mee(e){let t=qb(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(Mee,"projectedEdgeBaseURL");function Kb(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:Dee(),apiKeyConfigured:Lee(e),baseURL:Mee(e.DEEPSEEK_BASE_URL),maxTokens:Vb(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Kc(e.DEEPSEEK_MODEL),reasoningEffort:Hb(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Bp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Gb(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Hc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Kb,"resolveEdgeDeploymentProfile");function N$(e){ih(e);let t=Kb(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:rh,upstreamVersion:T$,status:"ready"}}l(N$,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as d7e}from"cloudflare:workers";var La=Bm(R$(),1);var Xb=l((e,t,n)=>{let i=e instanceof RegExp?O$(e,n):e,r=t instanceof RegExp?O$(t,n):t,s=i!==null&&r!=null&&jee(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"),O$=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),jee=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 P$="\0SLASH"+Math.random()+"\0",D$="\0OPEN"+Math.random()+"\0",Yb="\0CLOSE"+Math.random()+"\0",L$="\0COMMA"+Math.random()+"\0",M$="\0PERIOD"+Math.random()+"\0",Fee=new RegExp(P$,"g"),Uee=new RegExp(D$,"g"),zee=new RegExp(Yb,"g"),Bee=new RegExp(L$,"g"),Wee=new RegExp(M$,"g"),qee=/\\\\/g,Hee=/\\{/g,Gee=/\\}/g,Vee=/\\,/g,Zee=/\\\./g,Kee=1e5,Xee=4e6;function Jb(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(Jb,"numeric");function Jee(e){return e.replace(qee,P$).replace(Hee,D$).replace(Gee,Yb).replace(Vee,L$).replace(Zee,M$)}l(Jee,"escapeBraces");function Qee(e){return e.replace(Fee,"\\").replace(Uee,"{").replace(zee,"}").replace(Bee,",").replace(Wee,".")}l(Qee,"unescapeBraces");function j$(e){if(!e)return[""];let t=[],n=Xb("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=j$(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(j$,"parseCommaParts");function F$(e,t={}){if(!e)return[];let{max:n=Kee,maxLength:i=Xee}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Qb(Jee(e),n,i,!0).map(Qee)}l(F$,"expand");function Yee(e){return"{"+e+"}"}l(Yee,"embrace");function ete(e){return/^-?0\d/.test(e)}l(ete,"isPadded");function tte(e,t){return e<=t}l(tte,"lte");function nte(e,t){return e>=t}l(nte,"gte");function Xc(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(Xc,"combine");function rte(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=Jb(r[0]),o=Jb(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(Jb(r[2])),1):1,d=tte;o<a&&(u*=-1,d=nte);let p=r.some(ete),h=0;for(let g=a;d(g,o)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),p){let w=c-y.length;if(w>0){let x=new Array(w+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(rte,"expandSequence");function Qb(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=Xb("{","}",e);if(!o)return Xc(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=Xc(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+Yb+o.post,i=!0;continue}return Xc(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=rte(o.body,d,t,n);else{let g=j$(o.body);if(g.length===1&&g[0]!==void 0&&(g=Qb(g[0],t,n,!1).map(Yee),g.length===1)){if(r=Xc(r,c+g[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let x=0;y&&x<r.length;x++)r[x]&&(y=!1);h=[];let w=0;e:for(let x=0;x<g.length;x++){let k=Qb(g[x],t,n,!1);for(let E=0;E<k.length;E++){let A=k[E];if(!(y&&!A)){if(h.length>=t||w+A.length>n)break e;h.push(A),w+=A.length}}}}if(r=Xc(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(Qb,"expand_");var Jc=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var ite={"[: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]},Qc=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),ste=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),U$=l(e=>e.join(""),"rangesToString"),z$=l((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=n+1,a=!1,o=!1,c=!1,u=!1,d=n,f="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[w,[x,k,E]]of Object.entries(ite))if(e.startsWith(w,s)){if(f)return["$.",!1,e.length-n,!0];s+=w.length,E?r.push(x):i.push(x),o=o||k;continue e}}if(c=!1,f){y>f?i.push(Qc(f)+"-"+Qc(y)):y===f&&i.push(Qc(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(Qc(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(Qc(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[ste(y),!1,d-n,!1]}let p="["+(u?"^":"")+U$(i)+"]",h="["+(u?"":"^")+U$(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var Cs=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var ur,ate=new Set(["!","?","+","*","@"]),ex=l(e=>ate.has(e),"isExtglobType"),B$=l(e=>ex(e.type),"isExtglobAST"),ote=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),lte=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cte=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),W$=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ute="(?!(?:^|/)\\.\\.?(?:$|/))",ah="(?!\\.)",dte=new Set(["[","."]),fte=new Set(["..","."]),pte=new Set("().*{}+?[]^$\\!"),hte=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),tx="[^/]",q$=tx+"*?",H$=tx+"+?",mte=0,wa=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++mte;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,i={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?i:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#u&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,i=n.#i;for(;i;){for(let r=n.#s+1;!i.type&&r<i.#t.length;r++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#t[r])}n=i,i=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof ur&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let i=t.#t[n];if(!(i instanceof ur&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new ur(this.type,t);for(let i of this.#t)n.copyIn(i);return n}static#h(t,n,i,r,s){let a=r.maxExtglobRecursion??2,o=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=i,w="";for(;y<t.length;){let x=t.charAt(y++);if(o||x==="\\"){o=!o,w+=x;continue}if(c){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(c=!1),w+=x;continue}else if(x==="["){c=!0,u=y,d=!1,w+=x;continue}if(!r.noext&&ex(x)&&t.charAt(y)==="("&&s<=a){n.push(w),w="";let E=new ur(x,n);y=ur.#h(t,E,y,r,s+1),n.push(E);continue}w+=x}return n.push(w),y}let f=i+1,p=new ur(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&&ex(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let x=n&&n.#g(y)?0:1;p.push(g),g="";let k=new ur(y,p);p.push(k),f=ur.#h(t,k,f,r,s+x);continue}if(y==="|"){p.push(g),g="",h.push(p),p=new ur(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),p.push(g),g="",n.push(...h,p),f;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#T(t){return this.#m(t,lte)}#m(t,n=ote){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=cte){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new ur(null,i,this.options);r.#t.push(""),i.push(r),this.#E(t,n)}#E(t,n){let i=t.#t[0];this.#t.splice(n,1,...i.#t);for(let r of i.#t)typeof r=="object"&&(r.#i=this);this.#a=void 0}#S(t){return!!W$.get(this.type)?.has(t)}#N(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=W$.get(this.type),i=t.#t[0],r=n?.get(i.type);if(!r)return!1;this.#t=i.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=r,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let i=new ur(null,void 0,n);return ur.#h(t,i,0,n,0),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,i,r,s]=this.toRegExpSource();if(!(r||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let o=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!B$(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,w,x]=typeof h=="string"?ur.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||w,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&fte.has(this.#t[0]))){let g=dte,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),w=!n&&!t&&g.has(u.charAt(0));d=y?ute:w?ah:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Cs(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,Cs(this.toString()),!1,!1]}let a=!i||t||n||!ah?"":this.#v(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?ah:"")+H$;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?ah:"")+q$+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,Cs(s),this.#n=!!this.#n,this.#r]}#p(){if(B$(this)){let t=0,n=!1;do{n=!0;for(let i=0;i<this.#t.length;i++){let r=this.#t[i];typeof r=="object"&&(r.#p(),this.#m(r)?(n=!1,this.#E(r,i)):this.#T(r)?(n=!1,this.#f(r,i)):this.#N(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#a=void 0}#v(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[i,r,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,i}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#k(t,n,i=!1){let r=!1,s="",a=!1,o=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,s+=(pte.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?H$:q$,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=z$(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=tx,n=!0;continue}s+=hte(u)}return[s,Cs(t),!!n,a]}};ur=wa;var nx=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var En=l((e,t,n={})=>(Jc(t),!n.nocomment&&t.charAt(0)==="#"?!1:new zo(t,n).match(e)),"minimatch"),gte=/^\*+([^+@!?*[(]*)$/,yte=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),vte=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),wte=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),bte=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),xte=/^\*+\.\*+$/,Ete=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Ste=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),kte=/^\.\*+$/,Ate=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),_te=/^\*+$/,Ite=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),$te=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Cte=/^\?+([^+@!?*[(]*)?$/,Tte=l(([e,t=""])=>{let n=Z$([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),Nte=l(([e,t=""])=>{let n=K$([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),Rte=l(([e,t=""])=>{let n=K$([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),Ote=l(([e,t=""])=>{let n=Z$([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),Z$=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),K$=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),X$=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",G$={win32:{sep:"\\"},posix:{sep:"/"}},Pte=X$==="win32"?G$.win32.sep:G$.posix.sep;En.sep=Pte;var Fn=Symbol("globstar **");En.GLOBSTAR=Fn;var Dte="[^/]",Lte=Dte+"*?",Mte="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",jte="(?:(?!(?:\\/|^)\\.).)*?",Fte=l((e,t={})=>n=>En(n,e,t),"filter");En.filter=Fte;var Tr=l((e,t={})=>Object.assign({},e,t),"ext"),Ute=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return En;let t=En;return Object.assign(l((i,r,s={})=>t(i,r,Tr(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Tr(e,s))}static defaults(r){return t.defaults(Tr(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Tr(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Tr(e,s))}},unescape:l((i,r={})=>t.unescape(i,Tr(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Tr(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Tr(e,r)),"filter"),defaults:l(i=>t.defaults(Tr(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Tr(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Tr(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Tr(e,s)),"match"),sep:t.sep,GLOBSTAR:Fn})},"defaults");En.defaults=Ute;var J$=l((e,t={})=>(Jc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:F$(e,{max:t.braceExpandMax})),"braceExpand");En.braceExpand=J$;var zte=l((e,t={})=>new zo(e,t).makeRe(),"makeRe");En.makeRe=zte;var Bte=l((e,t,n={})=>{let i=new zo(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");En.match=Bte;var V$=/[?*]|[+@!]\(.*?\)|\[|\]/,Wte=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zo=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={}){Jc(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||X$,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]==="?"||!V$.test(s[2]))&&!V$.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(Fn)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(Fn,s),o=n.lastIndexOf(Fn),[c,u,d]=i?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,o),n.slice(o+1)];if(c.length){let k=t.slice(r,r+c.length);if(!this.#r(k,c,i,0,0))return!1;r+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+r>t.length)return!1;let k=t.length-d.length;if(this.#r(t,d,i,k,0))f=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(k--,!this.#r(t,d,i,k,0)))return!1;f=d.length+1}}if(!u.length){let k=!!f;for(let E=r;E<t.length-f;E++){let A=String(t[E]);if(k=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return i||k}let p=[[[],0]],h=p[0],g=0,y=[0];for(let k of u)k===Fn?(y.push(g),h=[[],0],p.push(h)):(h[0].push(k),g++);let w=p.length-1,x=t.length-f;for(let k of p)k[1]=x-(y[w--]+k[0].length);return!!this.#n(t,p,r,0,i,0,!!f)}#n(t,n,i,r,s,a,o){let c=n[r];if(!c){for(let f=i;f<t.length;f++){o=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[u,d]=c;for(;i<=d;){if(this.#r(t.slice(0,i+u.length),u,s,i,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,i+u.length,r+1,s,a+1,o);if(h!==!1)return h}let p=t[i];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;i++}return s||null}#r(t,n,i,r,s){let a,o,c,u;for(a=r,o=s,u=t.length,c=n.length;a<u&&o<c;a++,o++){this.debug("matchOne loop");let d=n[o],f=t[a];if(this.debug(n,d,f),d===!1||d===Fn)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 J$(this.pattern,this.options)}parse(t){Jc(t);let n=this.options;if(t==="**")return Fn;if(t==="")return"";let i,r=null;(i=t.match(_te))?r=n.dot?$te:Ite:(i=t.match(gte))?r=(n.nocase?n.dot?bte:wte:n.dot?vte:yte)(i[1]):(i=t.match(Cte))?r=(n.nocase?n.dot?Nte:Tte:n.dot?Rte:Ote)(i):(i=t.match(xte))?r=n.dot?Ste:Ete:(i=t.match(kte))&&(r=Ate);let s=wa.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?Lte:n.dot?Mte:jte,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"?Wte(f):f===Fn?Fn:f._src});u.forEach((f,p)=>{let h=u[p+1],g=u[p-1];f!==Fn||g===Fn||(g===void 0?h!==void 0&&h!==Fn?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=g+"(?:\\/|\\/"+i+")?":h!==Fn&&(u[p-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=Fn))});let d=u.filter(f=>f!==Fn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o of s){let c=r;if(i.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return En.defaults(t).Minimatch}};En.AST=wa;En.Minimatch=zo;En.escape=nx;En.unescape=Cs;import{gunzipSync as lie}from"node:zlib";var Yc=class{static{l(this,"Diff")}diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);let s=this.castInput(t,i),a=this.castInput(n,i),o=this.removeEmpty(this.tokenize(s,i)),c=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,c,i,r)}diffWithOptionsObj(t,n,i,r){var s;let a=l(k=>{if(k=this.postProcess(k,i),r){setTimeout(function(){r(k)},0);return}else return k},"done"),o=n.length,c=t.length,u=1,d=o+c;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&g+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,w=1/0,x=l(()=>{for(let k=Math.max(y,-u);k<=Math.min(w,u);k+=2){let E,A=h[k-1],S=h[k+1];A&&(h[k-1]=void 0);let _=!1;if(S){let L=S.oldPos-k;_=S&&0<=L&&L<o}let T=A&&A.oldPos+1<c;if(!_&&!T){h[k]=void 0;continue}if(!T||_&&A.oldPos<S.oldPos?E=this.addToPath(S,!0,!1,0,i):E=this.addToPath(A,!1,!0,1,i),g=this.extractCommon(E,n,t,k,i),E.oldPos+1>=c&&g+1>=o)return a(this.buildValues(E.lastComponent,n,t))||!0;h[k]=E,E.oldPos+1>=c&&(w=Math.min(w,k-1)),g+1>=o&&(y=Math.max(y,k+1))}u++},"execEditLength");if(r)l(function k(){setTimeout(function(){if(u>d||Date.now()>p)return r(void 0);x()||k()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let k=x();if(k)return k}}addToPath(t,n,i,r,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:a.count+1,added:n,removed:i,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:a}}}extractCommon(t,n,i,r,s){let a=n.length,o=i.length,c=t.oldPos,u=c-r,d=0;for(;u+1<a&&c+1<o&&this.equals(i[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){let r=[],s;for(;t;)r.push(t),s=t.previousComponent,delete t.previousComponent,t=s;r.reverse();let a=r.length,o=0,c=0,u=0;for(;o<a;o++){let d=r[o];if(d.removed)d.value=this.join(i.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){let g=i[u+h];return g.length>p.length?g:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return r}};var rx=class extends Yc{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Hte}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
712
|
+
`}l(C$,"pageStyles");var Tee="https://api.deepseek.com";var Nee="deepseek-v4-flash",Ree="high";var Oee=/^[a-zA-Z0-9][a-zA-Z0-9._:/-]{0,127}$/;function qb(e){let t=e??Tee,n;try{n=new URL(t)}catch{throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL")}if(n.protocol!=="http:"&&n.protocol!=="https:"||n.username.length>0||n.password.length>0)throw new Error("dsh-edge: DEEPSEEK_BASE_URL must be a valid HTTP(S) URL without credentials");return t}l(qb,"resolveEdgeBaseURL");function Kc(e){if(e===void 0)return Nee;if(!Oee.test(e))throw new Error("dsh-edge: DEEPSEEK_MODEL must be a valid model id of at most 128 characters");return e}l(Kc,"resolveEdgeModel");function Hb(e){if(e===void 0)return Ree;if(e!=="off"&&e!=="low"&&e!=="high"&&e!=="max")throw new Error("dsh-edge: DEEPSEEK_REASONING_EFFORT must be one of off, low, high, or max");return e}l(Hb,"resolveEdgeReasoningEffort");function Gb(e){if(e===void 0)return 12e4;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t)||t>2147483647)throw new Error("dsh-edge: DEEPSEEK_STREAM_IDLE_TIMEOUT_MS must be no greater than 2147483647");return t}l(Gb,"resolveEdgeStreamIdleTimeoutMs");function Vb(e){if(e===void 0)return 256e3;if(!/^[1-9]\d*$/.test(e))throw new Error("dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be a positive integer");let t=Number(e);if(!Number.isSafeInteger(t))throw new Error(`dsh-edge: DEEPSEEK_MAX_OUTPUT_TOKENS must be no greater than ${Number.MAX_SAFE_INTEGER}`);return t}l(Vb,"resolveEdgeMaxOutputTokens");var Zb={name:"dsh-edge",version:"0.4.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.1-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.0","jsonc-parser":"^3.3.1",wrangler:"4.123.0"},devDependencies:{"@cloudflare/computer":"0.2.0","@cloudflare/workers-types":"5.20260812.1","@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-agent":"0.1.1-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.1-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.1-rc.1","@deepseek-ai/dsh-attachment":"0.1.1-rc.1","@deepseek-ai/dsh-brand":"0.1.1-rc.1","@deepseek-ai/dsh-credentials":"0.1.1-rc.1","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.1-rc.1","@deepseek-ai/dsh-llm":"0.1.1-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.1-rc.1","@deepseek-ai/dsh-session":"0.1.1-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.1-rc.1","@deepseek-ai/dsh-session-query":"0.1.1-rc.1","@deepseek-ai/dsh-session-title":"0.1.1-rc.1","@deepseek-ai/dsh-settings":"0.1.1-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.1-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.1-rc.1","@deepseek-ai/dsh-tool-web":"0.1.1-rc.1","@deepseek-ai/dsh-tools":"0.1.1-rc.1","@deepseek-ai/dsh-web":"0.1.1-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.1-rc.1","just-bash":"3.3.0","fast-png":"8.0.0","jpeg-js":"0.4.4",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var rh=Zb.version,T$=Zb.dshEdge.upstreamVersion;function Dee(){return"dsh-edge@0.4.0/isolated"}l(Dee,"resolveEdgeDeploymentId");function ih(e){return{baseURL:qb(e.DEEPSEEK_BASE_URL),maxTokens:Vb(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Kc(e.DEEPSEEK_MODEL),reasoningEffort:Hb(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Bp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Gb(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Hc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(ih,"resolveEdgeDeploymentConfig");function Lee(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}l(Lee,"edgeDeploymentApiKeyConfigured");function Mee(e){let t=qb(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}l(Mee,"projectedEdgeBaseURL");function Kb(e,t){return{shell:e.LOADER===void 0?"just-bash-direct":"just-bash-isolated",storage:"durable-object-sqlite-vfs",attachmentStorage:t??(e.DSH_EDGE_ATTACHMENTS===void 0?"temporary-do":"private-r2"),deploymentId:Dee(),apiKeyConfigured:Lee(e),baseURL:Mee(e.DEEPSEEK_BASE_URL),maxTokens:Vb(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:Kc(e.DEEPSEEK_MODEL),reasoningEffort:Hb(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:Bp(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:Gb(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Hc(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}l(Kb,"resolveEdgeDeploymentProfile");function N$(e){ih(e);let t=Kb(e);return{ok:!0,service:"dsh-edge",storage:t.storage,attachmentStorage:t.attachmentStorage,shell:t.shell,agent:"upstream-react-loop-agent",access:"single-owner-cookie",deploymentId:t.deploymentId,version:rh,upstreamVersion:T$,status:"ready"}}l(N$,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as d7e}from"cloudflare:workers";var La=Bm(R$(),1);var Xb=l((e,t,n)=>{let i=e instanceof RegExp?O$(e,n):e,r=t instanceof RegExp?O$(t,n):t,s=i!==null&&r!=null&&jee(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"),O$=l((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),jee=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 P$="\0SLASH"+Math.random()+"\0",D$="\0OPEN"+Math.random()+"\0",Yb="\0CLOSE"+Math.random()+"\0",L$="\0COMMA"+Math.random()+"\0",M$="\0PERIOD"+Math.random()+"\0",Fee=new RegExp(P$,"g"),Uee=new RegExp(D$,"g"),zee=new RegExp(Yb,"g"),Bee=new RegExp(L$,"g"),Wee=new RegExp(M$,"g"),qee=/\\\\/g,Hee=/\\{/g,Gee=/\\}/g,Vee=/\\,/g,Zee=/\\\./g,Kee=1e5,Xee=4e6;function Jb(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}l(Jb,"numeric");function Jee(e){return e.replace(qee,P$).replace(Hee,D$).replace(Gee,Yb).replace(Vee,L$).replace(Zee,M$)}l(Jee,"escapeBraces");function Qee(e){return e.replace(Fee,"\\").replace(Uee,"{").replace(zee,"}").replace(Bee,",").replace(Wee,".")}l(Qee,"unescapeBraces");function j$(e){if(!e)return[""];let t=[],n=Xb("{","}",e);if(!n)return e.split(",");let{pre:i,body:r,post:s}=n,a=i.split(",");a[a.length-1]+="{"+r+"}";let o=j$(s);return s.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}l(j$,"parseCommaParts");function F$(e,t={}){if(!e)return[];let{max:n=Kee,maxLength:i=Xee}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),Qb(Jee(e),n,i,!0).map(Qee)}l(F$,"expand");function Yee(e){return"{"+e+"}"}l(Yee,"embrace");function ete(e){return/^-?0\d/.test(e)}l(ete,"isPadded");function tte(e,t){return e<=t}l(tte,"lte");function nte(e,t){return e>=t}l(nte,"gte");function Xc(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(Xc,"combine");function rte(e,t,n,i){let r=e.split(/\.\./),s=[];if(r[0]===void 0||r[1]===void 0)return s;let a=Jb(r[0]),o=Jb(r[1]),c=Math.max(r[0].length,r[1].length),u=r.length===3&&r[2]!==void 0?Math.max(Math.abs(Jb(r[2])),1):1,d=tte;o<a&&(u*=-1,d=nte);let p=r.some(ete),h=0;for(let g=a;d(g,o)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),p){let w=c-y.length;if(w>0){let x=new Array(w+1).join("0");g<0?y="-"+x+y.slice(1):y=x+y}}if(h+y.length>i)break;s.push(y),h+=y.length}return s}l(rte,"expandSequence");function Qb(e,t,n,i){let r=[""],s=!1,a=!0;for(;;){let o=Xb("{","}",e);if(!o)return Xc(r,e,[""],t,n,s);let c=o.pre;if(/\$$/.test(c)){if(r=Xc(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+Yb+o.post,i=!0;continue}return Xc(r,c+"{"+o.body+"}"+o.post,[""],t,n,s)}a&&(s=i&&!f,a=!1);let h;if(f)h=rte(o.body,d,t,n);else{let g=j$(o.body);if(g.length===1&&g[0]!==void 0&&(g=Qb(g[0],t,n,!1).map(Yee),g.length===1)){if(r=Xc(r,c+g[0],[""],t,n,s&&!o.post.length),!o.post.length)break;e=o.post;continue}let y=s&&!o.post.length&&!c;for(let x=0;y&&x<r.length;x++)r[x]&&(y=!1);h=[];let w=0;e:for(let x=0;x<g.length;x++){let k=Qb(g[x],t,n,!1);for(let E=0;E<k.length;E++){let A=k[E];if(!(y&&!A)){if(h.length>=t||w+A.length>n)break e;h.push(A),w+=A.length}}}}if(r=Xc(r,c,h,t,n,s&&!o.post.length),!o.post.length)break;e=o.post}return r}l(Qb,"expand_");var Jc=l(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var ite={"[: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]},Qc=l(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),ste=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),U$=l(e=>e.join(""),"rangesToString"),z$=l((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let i=[],r=[],s=n+1,a=!1,o=!1,c=!1,u=!1,d=n,f="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[w,[x,k,E]]of Object.entries(ite))if(e.startsWith(w,s)){if(f)return["$.",!1,e.length-n,!0];s+=w.length,E?r.push(x):i.push(x),o=o||k;continue e}}if(c=!1,f){y>f?i.push(Qc(f)+"-"+Qc(y)):y===f&&i.push(Qc(y)),f="",s++;continue}if(e.startsWith("-]",s+1)){i.push(Qc(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){f=y,s+=2;continue}i.push(Qc(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[ste(y),!1,d-n,!1]}let p="["+(u?"^":"")+U$(i)+"]",h="["+(u?"":"^")+U$(r)+"]";return[i.length&&r.length?"("+p+"|"+h+")":i.length?p:h,o,d-n,!0]},"parseClass");var Cs=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var ur,ate=new Set(["!","?","+","*","@"]),ex=l(e=>ate.has(e),"isExtglobType"),B$=l(e=>ex(e.type),"isExtglobAST"),ote=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),lte=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),cte=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),W$=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),ute="(?!(?:^|/)\\.\\.?(?:$|/))",ah="(?!\\.)",dte=new Set(["[","."]),fte=new Set(["..","."]),pte=new Set("().*{}+?[]^$\\!"),hte=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),tx="[^/]",q$=tx+"*?",H$=tx+"+?",mte=0,wa=class{static{l(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#u=!1;#l;#a;#c=!1;id=++mte;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,i={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?i:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#u&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#x(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,i=n.#i;for(;i;){for(let r=n.#s+1;!i.type&&r<i.#t.length;r++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(i.#t[r])}n=i,i=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof ur&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let i=t.#t[n];if(!(i instanceof ur&&i.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new ur(this.type,t);for(let i of this.#t)n.copyIn(i);return n}static#h(t,n,i,r,s){let a=r.maxExtglobRecursion??2,o=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=i,w="";for(;y<t.length;){let x=t.charAt(y++);if(o||x==="\\"){o=!o,w+=x;continue}if(c){y===u+1?(x==="^"||x==="!")&&(d=!0):x==="]"&&!(y===u+2&&d)&&(c=!1),w+=x;continue}else if(x==="["){c=!0,u=y,d=!1,w+=x;continue}if(!r.noext&&ex(x)&&t.charAt(y)==="("&&s<=a){n.push(w),w="";let E=new ur(x,n);y=ur.#h(t,E,y,r,s+1),n.push(E);continue}w+=x}return n.push(w),y}let f=i+1,p=new ur(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&&ex(y)&&t.charAt(f)==="("&&(s<=a||n&&n.#g(y))){let x=n&&n.#g(y)?0:1;p.push(g),g="";let k=new ur(y,p);p.push(k),f=ur.#h(t,k,f,r,s+x);continue}if(y==="|"){p.push(g),g="",h.push(p),p=new ur(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),p.push(g),g="",n.push(...h,p),f;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(i-1)],f}#T(t){return this.#m(t,lte)}#m(t,n=ote){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=cte){return!!n.get(this.type)?.includes(t)}#f(t,n){let i=t.#t[0],r=new ur(null,i,this.options);r.#t.push(""),i.push(r),this.#E(t,n)}#E(t,n){let i=t.#t[0];this.#t.splice(n,1,...i.#t);for(let r of i.#t)typeof r=="object"&&(r.#i=this);this.#a=void 0}#S(t){return!!W$.get(this.type)?.has(t)}#N(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=W$.get(this.type),i=t.#t[0],r=n?.get(i.type);if(!r)return!1;this.#t=i.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=r,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let i=new ur(null,void 0,n);return ur.#h(t,i,0,n,0),i}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,i,r,s]=this.toRegExpSource();if(!(r||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return i;let o=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,o),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#p(),this.#x()),!B$(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,w,x]=typeof h=="string"?ur.#k(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||w,this.#r=this.#r||x,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&fte.has(this.#t[0]))){let g=dte,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),w=!n&&!t&&g.has(u.charAt(0));d=y?ute:w?ah:""}let f="";return this.isEnd()&&this.#e.#u&&this.#i?.type==="!"&&(f="(?:$|\\/)"),[d+u+f,Cs(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,Cs(this.toString()),!1,!1]}let a=!i||t||n||!ah?"":this.#v(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let o="";if(this.type==="!"&&this.#c)o=(this.isStart()&&!n?ah:"")+H$;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?ah:"")+q$+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+s+c}return[o,Cs(s),this.#n=!!this.#n,this.#r]}#p(){if(B$(this)){let t=0,n=!1;do{n=!0;for(let i=0;i<this.#t.length;i++){let r=this.#t[i];typeof r=="object"&&(r.#p(),this.#m(r)?(n=!1,this.#E(r,i)):this.#T(r)?(n=!1,this.#f(r,i)):this.#N(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#p();this.#a=void 0}#v(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[i,r,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,i}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#k(t,n,i=!1){let r=!1,s="",a=!1,o=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,s+=(pte.has(u)?"\\":"")+u;continue}if(u==="*"){if(o)continue;o=!0,s+=i&&/^[*]+$/.test(t)?H$:q$,n=!0;continue}else o=!1;if(u==="\\"){c===t.length-1?s+="\\\\":r=!0;continue}if(u==="["){let[d,f,p,h]=z$(t,c);if(p){s+=d,a=a||f,c+=p-1,n=n||h;continue}}if(u==="?"){s+=tx,n=!0;continue}s+=hte(u)}return[s,Cs(t),!!n,a]}};ur=wa;var nx=l((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var En=l((e,t,n={})=>(Jc(t),!n.nocomment&&t.charAt(0)==="#"?!1:new zo(t,n).match(e)),"minimatch"),gte=/^\*+([^+@!?*[(]*)$/,yte=l(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),vte=l(e=>t=>t.endsWith(e),"starDotExtTestDot"),wte=l(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),bte=l(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),xte=/^\*+\.\*+$/,Ete=l(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),Ste=l(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),kte=/^\.\*+$/,Ate=l(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),_te=/^\*+$/,Ite=l(e=>e.length!==0&&!e.startsWith("."),"starTest"),$te=l(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),Cte=/^\?+([^+@!?*[(]*)?$/,Tte=l(([e,t=""])=>{let n=Z$([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),Nte=l(([e,t=""])=>{let n=K$([e]);return t?(t=t.toLowerCase(),i=>n(i)&&i.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),Rte=l(([e,t=""])=>{let n=K$([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTestDot"),Ote=l(([e,t=""])=>{let n=Z$([e]);return t?i=>n(i)&&i.endsWith(t):n},"qmarksTest"),Z$=l(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),K$=l(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),X$=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",G$={win32:{sep:"\\"},posix:{sep:"/"}},Pte=X$==="win32"?G$.win32.sep:G$.posix.sep;En.sep=Pte;var Fn=Symbol("globstar **");En.GLOBSTAR=Fn;var Dte="[^/]",Lte=Dte+"*?",Mte="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",jte="(?:(?!(?:\\/|^)\\.).)*?",Fte=l((e,t={})=>n=>En(n,e,t),"filter");En.filter=Fte;var Tr=l((e,t={})=>Object.assign({},e,t),"ext"),Ute=l(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return En;let t=En;return Object.assign(l((i,r,s={})=>t(i,r,Tr(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{l(this,"Minimatch")}constructor(r,s={}){super(r,Tr(e,s))}static defaults(r){return t.defaults(Tr(e,r)).Minimatch}},AST:class extends t.AST{static{l(this,"AST")}constructor(r,s,a={}){super(r,s,Tr(e,a))}static fromGlob(r,s={}){return t.AST.fromGlob(r,Tr(e,s))}},unescape:l((i,r={})=>t.unescape(i,Tr(e,r)),"unescape"),escape:l((i,r={})=>t.escape(i,Tr(e,r)),"escape"),filter:l((i,r={})=>t.filter(i,Tr(e,r)),"filter"),defaults:l(i=>t.defaults(Tr(e,i)),"defaults"),makeRe:l((i,r={})=>t.makeRe(i,Tr(e,r)),"makeRe"),braceExpand:l((i,r={})=>t.braceExpand(i,Tr(e,r)),"braceExpand"),match:l((i,r,s={})=>t.match(i,r,Tr(e,s)),"match"),sep:t.sep,GLOBSTAR:Fn})},"defaults");En.defaults=Ute;var J$=l((e,t={})=>(Jc(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:F$(e,{max:t.braceExpandMax})),"braceExpand");En.braceExpand=J$;var zte=l((e,t={})=>new zo(e,t).makeRe(),"makeRe");En.makeRe=zte;var Bte=l((e,t,n={})=>{let i=new zo(t,n);return e=e.filter(r=>i.match(r)),i.options.nonull&&!e.length&&e.push(t),e},"match");En.match=Bte;var V$=/[?*]|[+@!]\(.*?\)|\[|\]/,Wte=l(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),zo=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={}){Jc(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||X$,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]==="?"||!V$.test(s[2]))&&!V$.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(Fn)?this.#e(t,n,i,r,s):this.#r(t,n,i,r,s)}#e(t,n,i,r,s){let a=n.indexOf(Fn,s),o=n.lastIndexOf(Fn),[c,u,d]=i?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,o),n.slice(o+1)];if(c.length){let k=t.slice(r,r+c.length);if(!this.#r(k,c,i,0,0))return!1;r+=c.length,s+=c.length}let f=0;if(d.length){if(d.length+r>t.length)return!1;let k=t.length-d.length;if(this.#r(t,d,i,k,0))f=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(k--,!this.#r(t,d,i,k,0)))return!1;f=d.length+1}}if(!u.length){let k=!!f;for(let E=r;E<t.length-f;E++){let A=String(t[E]);if(k=!0,A==="."||A===".."||!this.options.dot&&A.startsWith("."))return!1}return i||k}let p=[[[],0]],h=p[0],g=0,y=[0];for(let k of u)k===Fn?(y.push(g),h=[[],0],p.push(h)):(h[0].push(k),g++);let w=p.length-1,x=t.length-f;for(let k of p)k[1]=x-(y[w--]+k[0].length);return!!this.#n(t,p,r,0,i,0,!!f)}#n(t,n,i,r,s,a,o){let c=n[r];if(!c){for(let f=i;f<t.length;f++){o=!0;let p=t[f];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return o}let[u,d]=c;for(;i<=d;){if(this.#r(t.slice(0,i+u.length),u,s,i,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,i+u.length,r+1,s,a+1,o);if(h!==!1)return h}let p=t[i];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;i++}return s||null}#r(t,n,i,r,s){let a,o,c,u;for(a=r,o=s,u=t.length,c=n.length;a<u&&o<c;a++,o++){this.debug("matchOne loop");let d=n[o],f=t[a];if(this.debug(n,d,f),d===!1||d===Fn)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 J$(this.pattern,this.options)}parse(t){Jc(t);let n=this.options;if(t==="**")return Fn;if(t==="")return"";let i,r=null;(i=t.match(_te))?r=n.dot?$te:Ite:(i=t.match(gte))?r=(n.nocase?n.dot?bte:wte:n.dot?vte:yte)(i[1]):(i=t.match(Cte))?r=(n.nocase?n.dot?Nte:Tte:n.dot?Rte:Ote)(i):(i=t.match(xte))?r=n.dot?Ste:Ete:(i=t.match(kte))&&(r=Ate);let s=wa.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?Lte:n.dot?Mte:jte,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"?Wte(f):f===Fn?Fn:f._src});u.forEach((f,p)=>{let h=u[p+1],g=u[p-1];f!==Fn||g===Fn||(g===void 0?h!==void 0&&h!==Fn?u[p+1]="(?:\\/|"+i+"\\/)?"+h:u[p]=i:h===void 0?u[p-1]=g+"(?:\\/|\\/"+i+")?":h!==Fn&&(u[p-1]=g+"(?:\\/|\\/"+i+"\\/)"+h,u[p+1]=Fn))});let d=u.filter(f=>f!==Fn);if(this.partial&&d.length>=1){let f=[];for(let p=1;p<=d.length;p++)f.push(d.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return d.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let s=this.set;this.debug(this.pattern,"set",s);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o of s){let c=r;if(i.matchBase&&o.length===1&&(c=[a]),this.matchOne(c,o,n))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(t){return En.defaults(t).Minimatch}};En.AST=wa;En.Minimatch=zo;En.escape=nx;En.unescape=Cs;import{gunzipSync as lie}from"node:zlib";var Yc=class{static{l(this,"Diff")}diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);let s=this.castInput(t,i),a=this.castInput(n,i),o=this.removeEmpty(this.tokenize(s,i)),c=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,c,i,r)}diffWithOptionsObj(t,n,i,r){var s;let a=l(k=>{if(k=this.postProcess(k,i),r){setTimeout(function(){r(k)},0);return}else return k},"done"),o=n.length,c=t.length,u=1,d=o+c;i.maxEditLength!=null&&(d=Math.min(d,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,p=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,i);if(h[0].oldPos+1>=c&&g+1>=o)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,w=1/0,x=l(()=>{for(let k=Math.max(y,-u);k<=Math.min(w,u);k+=2){let E,A=h[k-1],S=h[k+1];A&&(h[k-1]=void 0);let _=!1;if(S){let L=S.oldPos-k;_=S&&0<=L&&L<o}let T=A&&A.oldPos+1<c;if(!_&&!T){h[k]=void 0;continue}if(!T||_&&A.oldPos<S.oldPos?E=this.addToPath(S,!0,!1,0,i):E=this.addToPath(A,!1,!0,1,i),g=this.extractCommon(E,n,t,k,i),E.oldPos+1>=c&&g+1>=o)return a(this.buildValues(E.lastComponent,n,t))||!0;h[k]=E,E.oldPos+1>=c&&(w=Math.min(w,k-1)),g+1>=o&&(y=Math.max(y,k+1))}u++},"execEditLength");if(r)l(function k(){setTimeout(function(){if(u>d||Date.now()>p)return r(void 0);x()||k()},0)},"exec")();else for(;u<=d&&Date.now()<=p;){let k=x();if(k)return k}}addToPath(t,n,i,r,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:a.count+1,added:n,removed:i,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:a}}}extractCommon(t,n,i,r,s){let a=n.length,o=i.length,c=t.oldPos,u=c-r,d=0;for(;u+1<a&&c+1<o&&this.equals(i[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){let r=[],s;for(;t;)r.push(t),s=t.previousComponent,delete t.previousComponent,t=s;r.reverse();let a=r.length,o=0,c=0,u=0;for(;o<a;o++){let d=r[o];if(d.removed)d.value=this.join(i.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let f=n.slice(c,c+d.count);f=f.map(function(p,h){let g=i[u+h];return g.length>p.length?g:p}),d.value=this.join(f)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return r}};var rx=class extends Yc{static{l(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=Hte}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
|
|
713
713
|
`))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
|
|
714
714
|
`))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
|
|
715
715
|
`)&&(t=t.slice(0,-1)),n.endsWith(`
|