dsh-edge 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # last confirmed-consistent state. Both languages carry equal authority.
3
3
  # After editing either side, update both and re-record every pair with:
4
4
  # pnpm run doc-pairs -- --write
5
- README.md: f553d63c2fca4efb2886acbdafb44c90a33b8abb
6
- README.zh.md: 626c5f941dee82c0ec0ce4fa0278d2ccfa63c72a
5
+ README.md: b2b8697453e7e747c1934594b06466263579794b
6
+ README.zh.md: 3572c8a13af6280c296c0e7c178a27d913d9c133
package/README.md CHANGED
@@ -208,6 +208,7 @@ Invalid deployment configuration fails before session lookup or SSE response cre
208
208
  - The cookie carries no user data, is never forwarded to the Durable Object, and becomes invalid when the access key rotates.
209
209
  - Unauthenticated API and WebSocket requests return 401. Only an owner-authentication 401 carrying `WWW-Authenticate: DshEdgeOwner` makes the same-origin shell navigate to `/login`; provider/configuration 401 diagnostics remain visible.
210
210
  - Authenticated browser API and WebSocket requests from another origin return 403 even with a same-site cookie.
211
+ - The Web shell declares the browser transport as host-owning (`__DSH_TRANSPORT__.ownsHost`), so upstream's loopback-only trust tier, which gates host-persisted plugin settings and the settings document editor, applies to the authenticated owner on any origin.
211
212
  - The asset policy prevents framing through `/`, `/index.html`, or an SPA fallback. `/` redirects to `/login`; `/api/health` and immutable assets remain public.
212
213
 
213
214
  This deliberately is not an account system or multi-tenant boundary.
package/README.zh.md CHANGED
@@ -208,6 +208,7 @@ Cloudflare static assets -> upstream Web shell + client plugin graph
208
208
  - Cookie 不包含用户数据,不会转发给 Durable Object,并在 access key 轮换后失效。
209
209
  - 未认证的 API 与 WebSocket 请求返回 401。只有携带 `WWW-Authenticate: DshEdgeOwner` 的 owner-authentication 401 才会让同 origin shell 导航到 `/login`;provider/配置的 401 诊断仍然可见。
210
210
  - 来自其他 origin 的已认证浏览器 API 与 WebSocket 请求,即使携带 same-site cookie 也会返回 403。
211
+ - Web shell 会把浏览器传输层声明为拥有宿主(`__DSH_TRANSPORT__.ownsHost`),因此上游仅限 loopback 的信任层级(它决定宿主持久化的插件设置和设置文档编辑器是否可用)对任意 origin 上的已认证 owner 同样生效。
211
212
  - Asset policy 会阻止通过 `/`、`/index.html` 或 SPA fallback 进行 frame 嵌入。`/` 重定向到 `/login`;`/api/health` 与 immutable asset 保持公开。
212
213
 
213
214
  这里刻意不是 account system 或多租户边界。
package/dist/index.html CHANGED
@@ -1,6 +1,8 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
3
  <head><script>(() => {
4
+ const transport = globalThis.__DSH_TRANSPORT__
5
+ globalThis.__DSH_TRANSPORT__ = { ...(transport ?? {}), ownsHost: true }
4
6
  const originalFetch = window.fetch.bind(window)
5
7
  let redirecting = false
6
8
  window.fetch = async (...args) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-edge",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Your DeepSeek Harness, anywhere — deploy a persistent personal coding agent to Cloudflare Workers in one command",
5
5
  "author": "pawaca",
6
6
  "license": "MIT",
@@ -3393,7 +3393,7 @@ The web search request used endpoint ${JSON.stringify(e)}. Search endpoint confi
3393
3393
  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; }
3394
3394
  .secondary { background: #29314b; color: #edf2ff; }
3395
3395
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
3396
- `}a(SX,"pageStyles");var E7={name:"dsh-edge",version:"0.11.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.2-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Ob=E7.version,EX=E7.dshEdge.upstreamVersion;function EOe(){return"dsh-edge@0.11.0/direct"}a(EOe,"resolveEdgeDeploymentId");function Nb(e){return{baseURL:oC(e.DEEPSEEK_BASE_URL),maxTokens:cC(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:cu(e.DEEPSEEK_MODEL),reasoningEffort:aC(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:eb(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:lC(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ng(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(Nb,"resolveEdgeDeploymentConfig");function kOe(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}a(kOe,"edgeDeploymentApiKeyConfigured");function _Oe(e){let t=oC(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}a(_Oe,"projectedEdgeBaseURL");function k7(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:EOe(),apiKeyConfigured:kOe(e),baseURL:_Oe(e.DEEPSEEK_BASE_URL),maxTokens:cC(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:cu(e.DEEPSEEK_MODEL),reasoningEffort:aC(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:eb(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:lC(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ng(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(k7,"resolveEdgeDeploymentProfile");function kX(e){Nb(e);let t=k7(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:Ob,upstreamVersion:EX,status:"ready"}}a(kX,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Nyt}from"cloudflare:workers";var ad=dd(_X());var _7=a((e,t,r)=>{let n=e instanceof RegExp?AX(e,r):e,i=t instanceof RegExp?AX(t,r):t,s=n!==null&&i!=null&&AOe(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"),AX=a((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),AOe=a((e,t,r)=>{let n,i,s,o,l,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&&!l;){if(d===c)n.push(d),c=r.indexOf(e,d+1);else if(n.length===1){let p=n.pop();p!==void 0&&(l=[p,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=r.indexOf(t,d+1);d=c<u&&c>=0?c:u}n.length&&o!==void 0&&(l=[s,o])}return l},"range");var IX="\0SLASH"+Math.random()+"\0",TX="\0OPEN"+Math.random()+"\0",T7="\0CLOSE"+Math.random()+"\0",CX="\0COMMA"+Math.random()+"\0",RX="\0PERIOD"+Math.random()+"\0",IOe=new RegExp(IX,"g"),TOe=new RegExp(TX,"g"),COe=new RegExp(T7,"g"),ROe=new RegExp(CX,"g"),$Oe=new RegExp(RX,"g"),OOe=/\\\\/g,NOe=/\\{/g,POe=/\\}/g,DOe=/\\,/g,MOe=/\\\./g,LOe=1e5,FOe=4e6;function A7(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}a(A7,"numeric");function jOe(e){return e.replace(OOe,IX).replace(NOe,TX).replace(POe,T7).replace(DOe,CX).replace(MOe,RX)}a(jOe,"escapeBraces");function UOe(e){return e.replace(IOe,"\\").replace(TOe,"{").replace(COe,"}").replace(ROe,",").replace($Oe,".")}a(UOe,"unescapeBraces");function $X(e){if(!e)return[""];let t=[],r=_7("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let l=$X(s);return s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),t.push.apply(t,o),t}a($X,"parseCommaParts");function OX(e,t={}){if(!e)return[];let{max:r=LOe,maxLength:n=FOe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),I7(jOe(e),r,n,!0).map(UOe)}a(OX,"expand");function BOe(e){return"{"+e+"}"}a(BOe,"embrace");function qOe(e){return/^-?0\d/.test(e)}a(qOe,"isPadded");function zOe(e,t){return e<=t}a(zOe,"lte");function WOe(e,t){return e>=t}a(WOe,"gte");function og(e,t,r,n,i,s){let o=[],l=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(l+d.length>i)return o;o.push(d),l+=d.length}}return o}a(og,"combine");function HOe(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=A7(i[0]),l=A7(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(A7(i[2])),1):1,d=zOe;l<o&&(u*=-1,d=WOe);let h=i.some(qOe),f=0;for(let g=o;d(g,l)&&s.length<r;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),h){let v=c-y.length;if(v>0){let b=new Array(v+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(f+y.length>n)break;s.push(y),f+=y.length}return s}a(HOe,"expandSequence");function I7(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let l=_7("{","}",e);if(!l)return og(i,e,[""],t,r,s);let c=l.pre;if(/\$$/.test(c)){if(i=og(i,c+"{"+l.body+"}",[""],t,r,s&&!l.post.length),o=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,h=l.body.indexOf(",")>=0;if(!p&&!h){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+T7+l.post,n=!0;continue}return og(i,c+"{"+l.body+"}"+l.post,[""],t,r,s)}o&&(s=n&&!p,o=!1);let f;if(p)f=HOe(l.body,d,t,r);else{let g=$X(l.body);if(g.length===1&&g[0]!==void 0&&(g=I7(g[0],t,r,!1).map(BOe),g.length===1)){if(i=og(i,c+g[0],[""],t,r,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let b=0;y&&b<i.length;b++)i[b]&&(y=!1);f=[];let v=0;e:for(let b=0;b<g.length;b++){let x=I7(g[b],t,r,!1);for(let w=0;w<x.length;w++){let E=x[w];if(!(y&&!E)){if(f.length>=t||v+E.length>r)break e;f.push(E),v+=E.length}}}}if(i=og(i,c,f,t,r,s&&!l.post.length),!l.post.length)break;e=l.post}return i}a(I7,"expand_");var ag=a(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var GOe={"[: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]},lg=a(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VOe=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),NX=a(e=>e.join(""),"rangesToString"),PX=a((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,l=!1,c=!1,u=!1,d=r,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===r+1){u=!0,s++;continue}if(y==="]"&&o&&!c){d=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[b,x,w]]of Object.entries(GOe))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-r,!0];s+=v.length,w?i.push(b):n.push(b),l=l||x;continue e}}if(c=!1,p){y>p?n.push(lg(p)+"-"+lg(y)):y===p&&n.push(lg(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push(lg(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}n.push(lg(y)),s++}if(d<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let y=n[0].length===2?n[0].slice(-1):n[0];return[VOe(y),!1,d-r,!1]}let h="["+(u?"^":"")+NX(n)+"]",f="["+(u?"":"^")+NX(i)+"]";return[n.length&&i.length?"("+h+"|"+f+")":n.length?h:f,l,d-r,!0]},"parseClass");var Yl=a((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 Fi,ZOe=new Set(["!","?","+","*","@"]),C7=a(e=>ZOe.has(e),"isExtglobType"),DX=a(e=>C7(e.type),"isExtglobAST"),KOe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),JOe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),XOe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),MX=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),YOe="(?!(?:^|/)\\.\\.?(?:$|/))",Db="(?!\\.)",QOe=new Set(["[","."]),eNe=new Set(["..","."]),tNe=new Set("().*{}+?[]^$\\!"),rNe=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),R7="[^/]",LX=R7+"*?",FX=R7+"+?",nNe=0,Ru=class{static{a(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#d=!1;#l;#o;#c=!1;id=++nNe;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#d&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Fi&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Fi&&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 Fi(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#m(t,r,n,i,s){let o=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(r.type===null){let y=n,v="";for(;y<t.length;){let b=t.charAt(y++);if(l||b==="\\"){l=!l,v+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),v+=b;continue}else if(b==="["){c=!0,u=y,d=!1,v+=b;continue}if(!i.noext&&C7(b)&&t.charAt(y)==="("&&s<=o){r.push(v),v="";let w=new Fi(b,r);y=Fi.#m(t,w,y,i,s+1),r.push(w);continue}v+=b}return r.push(v),y}let p=n+1,h=new Fi(null,r),f=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&C7(y)&&t.charAt(p)==="("&&(s<=o||r&&r.#y(y))){let b=r&&r.#y(y)?0:1;h.push(g),g="";let x=new Fi(y,h);h.push(x),p=Fi.#m(t,x,p,i,s+b);continue}if(y==="|"){h.push(g),g="",f.push(h),h=new Fi(null,r);continue}if(y===")")return g===""&&r.#t.length===0&&(r.#c=!0),h.push(g),g="",r.push(...f,h),p;g+=y}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],p}#N(t){return this.#g(t,JOe)}#g(t,r=KOe){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#y(n.type,r)}#y(t,r=XOe){return!!r.get(this.type)?.includes(t)}#p(t,r){let n=t.#t[0],i=new Fi(null,n,this.options);i.#t.push(""),n.push(i),this.#_(t,r)}#_(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#A(t){return!!MX.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#A(r.type)}#v(t){let r=MX.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 Fi(null,void 0,r);return Fi.#m(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,l),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!DX(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(f=>typeof f!="string"),u=this.#t.map(f=>{let[g,y,v,b]=typeof f=="string"?Fi.#I(f,this.#r,c):f.toRegExpSource(t);return this.#r=this.#r||v,this.#n=this.#n||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&eNe.has(this.#t[0]))){let g=QOe,y=r&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!r&&!t&&g.has(u.charAt(0));d=y?YOe:v?Db:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,Yl(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#x(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,Yl(this.toString()),!1,!1]}let o=!n||t||r||!Db?"":this.#x(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!r?Db:"")+FX;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Db:"")+LX+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;l=i+s+c}return[l,Yl(s),this.#r=!!this.#r,this.#n]}#f(){if(DX(this)){let t=0,r=!1;do{r=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#f(),this.#g(i)?(r=!1,this.#_(i,n)):this.#N(i)?(r=!1,this.#p(i,n)):this.#P(i)&&(r=!1,this.#v(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#x(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#I(t,r,n=!1){let i=!1,s="",o=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(tNe.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=n&&/^[*]+$/.test(t)?FX:LX,r=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,h,f]=PX(t,c);if(h){s+=d,o=o||p,c+=h-1,r=r||f;continue}}if(u==="?"){s+=R7,r=!0;continue}s+=rNe(u)}return[s,Yl(t),!!r,o]}};Fi=Ru;var $7=a((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var zn=a((e,t,r={})=>(ag(t),!r.nocomment&&t.charAt(0)==="#"?!1:new qp(t,r).match(e)),"minimatch"),iNe=/^\*+([^+@!?*[(]*)$/,sNe=a(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),oNe=a(e=>t=>t.endsWith(e),"starDotExtTestDot"),aNe=a(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),lNe=a(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),cNe=/^\*+\.\*+$/,uNe=a(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),dNe=a(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),pNe=/^\.\*+$/,fNe=a(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),hNe=/^\*+$/,mNe=a(e=>e.length!==0&&!e.startsWith("."),"starTest"),gNe=a(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),yNe=/^\?+([^+@!?*[(]*)?$/,vNe=a(([e,t=""])=>{let r=BX([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),xNe=a(([e,t=""])=>{let r=qX([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),bNe=a(([e,t=""])=>{let r=qX([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),wNe=a(([e,t=""])=>{let r=BX([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),BX=a(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),qX=a(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),zX=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",jX={win32:{sep:"\\"},posix:{sep:"/"}},SNe=zX==="win32"?jX.win32.sep:jX.posix.sep;zn.sep=SNe;var pi=Symbol("globstar **");zn.GLOBSTAR=pi;var ENe="[^/]",kNe=ENe+"*?",_Ne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ANe="(?:(?!(?:\\/|^)\\.).)*?",INe=a((e,t={})=>r=>zn(r,e,t),"filter");zn.filter=INe;var _s=a((e,t={})=>Object.assign({},e,t),"ext"),TNe=a(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zn;let t=zn;return Object.assign(a((n,i,s={})=>t(n,i,_s(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,_s(e,s))}static defaults(i){return t.defaults(_s(e,i)).Minimatch}},AST:class extends t.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,_s(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,_s(e,s))}},unescape:a((n,i={})=>t.unescape(n,_s(e,i)),"unescape"),escape:a((n,i={})=>t.escape(n,_s(e,i)),"escape"),filter:a((n,i={})=>t.filter(n,_s(e,i)),"filter"),defaults:a(n=>t.defaults(_s(e,n)),"defaults"),makeRe:a((n,i={})=>t.makeRe(n,_s(e,i)),"makeRe"),braceExpand:a((n,i={})=>t.braceExpand(n,_s(e,i)),"braceExpand"),match:a((n,i,s={})=>t.match(n,i,_s(e,s)),"match"),sep:t.sep,GLOBSTAR:pi})},"defaults");zn.defaults=TNe;var WX=a((e,t={})=>(ag(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:OX(e,{max:t.braceExpandMax})),"braceExpand");zn.braceExpand=WX;var CNe=a((e,t={})=>new qp(e,t).makeRe(),"makeRe");zn.makeRe=CNe;var RNe=a((e,t,r={})=>{let n=new qp(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");zn.match=RNe;var UX=/[?*]|[+@!]\(.*?\)|\[|\]/,$Ne=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),qp=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,r={}){ag(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||zX,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,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!UX.test(s[2]))&&!UX.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 l=n[i+1],c=n[i+2],u=n[i+3];if(l!==".."||!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 l=n[o];o===1&&l===""&&n[0]===""||(l==="."||l==="")&&(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=[],l="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(l==="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(l==="b")return!1;l="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="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 l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),p=c?3:l?0:void 0,h=d?3:u?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,g]=[t[p],r[h]];f.toLowerCase()===g.toLowerCase()&&(r[h]=f,s=h,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(pi)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(pi,s),l=r.lastIndexOf(pi),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,l),r.slice(l+1)];if(c.length){let x=t.slice(i,i+c.length);if(!this.#n(x,c,n,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let x=t.length-d.length;if(this.#n(t,d,n,x,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(x--,!this.#n(t,d,n,x,0)))return!1;p=d.length+1}}if(!u.length){let x=!!p;for(let w=i;w<t.length-p;w++){let E=String(t[w]);if(x=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||x}let h=[[[],0]],f=h[0],g=0,y=[0];for(let x of u)x===pi?(y.push(g),f=[[],0],h.push(f)):(f[0].push(x),g++);let v=h.length-1,b=t.length-p;for(let x of h)x[1]=b-(y[v--]+x[0].length);return!!this.#r(t,h,i,0,n,0,!!p)}#r(t,r,n,i,s,o,l){let c=r[i];if(!c){for(let p=n;p<t.length;p++){l=!0;let h=t[p];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return l}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let f=this.#r(t,r,n+u.length,i+1,s,o+1,l);if(f!==!1)return f}let h=t[n];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;n++}return s||null}#n(t,r,n,i,s){let o,l,c,u;for(o=i,l=s,u=t.length,c=r.length;o<u&&l<c;o++,l++){this.debug("matchOne loop");let d=r[l],p=t[o];if(this.debug(r,d,p),d===!1||d===pi)return!1;let h;if(typeof d=="string"?(h=p===d,this.debug("string match",d,p,h)):(h=d.test(p),this.debug("pattern match",d,p,h)),!h)return!1}if(o===u&&l===c)return!0;if(o===u)return n;if(l===c)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return WX(this.pattern,this.options)}parse(t){ag(t);let r=this.options;if(t==="**")return pi;if(t==="")return"";let n,i=null;(n=t.match(hNe))?i=r.dot?gNe:mNe:(n=t.match(iNe))?i=(r.nocase?r.dot?lNe:aNe:r.dot?oNe:sNe)(n[1]):(n=t.match(yNe))?i=(r.nocase?r.dot?xNe:vNe:r.dot?bNe:wNe)(n):(n=t.match(cNe))?i=r.dot?dNe:uNe:(n=t.match(pNe))&&(i=fNe);let s=Ru.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?kNe:r.dot?_Ne:ANe,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let h of p.flags.split(""))i.add(h);return typeof p=="string"?$Ne(p):p===pi?pi:p._src});u.forEach((p,h)=>{let f=u[h+1],g=u[h-1];p!==pi||g===pi||(g===void 0?f!==void 0&&f!==pi?u[h+1]="(?:\\/|"+n+"\\/)?"+f:u[h]=n:f===void 0?u[h-1]=g+"(?:\\/|\\/"+n+")?":f!==pi&&(u[h-1]=g+"(?:\\/|\\/"+n+"\\/)"+f,u[h+1]=pi))});let d=u.filter(p=>p!==pi);if(this.partial&&d.length>=1){let p=[];for(let h=1;h<=d.length;h++)p.push(d.slice(0,h).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[o,l]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+l+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,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 l=i.length-2;!o&&l>=0;l--)o=i[l];for(let l of s){let c=i;if(n.matchBase&&l.length===1&&(c=[o]),this.matchOne(c,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return zn.defaults(t).Minimatch}};zn.AST=Ru;zn.Minimatch=qp;zn.escape=$7;zn.unescape=Yl;import{gunzipSync as M5e}from"node:zlib";var cg=class{static{a(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),l=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(l,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=a(x=>{if(x=this.postProcess(x,n),i){setTimeout(function(){i(x)},0);return}else return x},"done"),l=r.length,c=t.length,u=1,d=l+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let p=(s=n.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+p,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],r,t,0,n);if(f[0].oldPos+1>=c&&g+1>=l)return o(this.buildValues(f[0].lastComponent,r,t));let y=-1/0,v=1/0,b=a(()=>{for(let x=Math.max(y,-u);x<=Math.min(v,u);x+=2){let w,E=f[x-1],S=f[x+1];E&&(f[x-1]=void 0);let k=!1;if(S){let O=S.oldPos-x;k=S&&0<=O&&O<l}let _=E&&E.oldPos+1<c;if(!k&&!_){f[x]=void 0;continue}if(!_||k&&E.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,n):w=this.addToPath(E,!1,!0,1,n),g=this.extractCommon(w,r,t,x,n),w.oldPos+1>=c&&g+1>=l)return o(this.buildValues(w.lastComponent,r,t))||!0;f[x]=w,w.oldPos+1>=c&&(v=Math.min(v,x-1)),g+1>=l&&(y=Math.max(y,x+1))}u++},"execEditLength");if(i)a(function x(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);b()||x()},0)},"exec")();else for(;u<=d&&Date.now()<=h;){let x=b();if(x)return x}}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,l=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<l&&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,l=0,c=0,u=0;for(;l<o;l++){let d=i[l];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=r.slice(c,c+d.count);p=p.map(function(h,f){let g=n[u+f];return g.length>h.length?g:h}),d.value=this.join(p)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var O7=class extends cg{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=NNe}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
3396
+ `}a(SX,"pageStyles");var E7={name:"dsh-edge",version:"0.11.1",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.2-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var Ob=E7.version,EX=E7.dshEdge.upstreamVersion;function EOe(){return"dsh-edge@0.11.1/direct"}a(EOe,"resolveEdgeDeploymentId");function Nb(e){return{baseURL:oC(e.DEEPSEEK_BASE_URL),maxTokens:cC(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:cu(e.DEEPSEEK_MODEL),reasoningEffort:aC(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:eb(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:lC(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ng(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(Nb,"resolveEdgeDeploymentConfig");function kOe(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}a(kOe,"edgeDeploymentApiKeyConfigured");function _Oe(e){let t=oC(e),r=new URL(t);return r.search.length===0&&r.hash.length===0?t:(r.search="",r.hash="",r.href)}a(_Oe,"projectedEdgeBaseURL");function k7(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:EOe(),apiKeyConfigured:kOe(e),baseURL:_Oe(e.DEEPSEEK_BASE_URL),maxTokens:cC(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:cu(e.DEEPSEEK_MODEL),reasoningEffort:aC(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:eb(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:lC(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:ng(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}a(k7,"resolveEdgeDeploymentProfile");function kX(e){Nb(e);let t=k7(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:Ob,upstreamVersion:EX,status:"ready"}}a(kX,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Nyt}from"cloudflare:workers";var ad=dd(_X());var _7=a((e,t,r)=>{let n=e instanceof RegExp?AX(e,r):e,i=t instanceof RegExp?AX(t,r):t,s=n!==null&&i!=null&&AOe(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"),AX=a((e,t)=>{let r=t.match(e);return r?r[0]:null},"maybeMatch"),AOe=a((e,t,r)=>{let n,i,s,o,l,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&&!l;){if(d===c)n.push(d),c=r.indexOf(e,d+1);else if(n.length===1){let p=n.pop();p!==void 0&&(l=[p,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=r.indexOf(t,d+1);d=c<u&&c>=0?c:u}n.length&&o!==void 0&&(l=[s,o])}return l},"range");var IX="\0SLASH"+Math.random()+"\0",TX="\0OPEN"+Math.random()+"\0",T7="\0CLOSE"+Math.random()+"\0",CX="\0COMMA"+Math.random()+"\0",RX="\0PERIOD"+Math.random()+"\0",IOe=new RegExp(IX,"g"),TOe=new RegExp(TX,"g"),COe=new RegExp(T7,"g"),ROe=new RegExp(CX,"g"),$Oe=new RegExp(RX,"g"),OOe=/\\\\/g,NOe=/\\{/g,POe=/\\}/g,DOe=/\\,/g,MOe=/\\\./g,LOe=1e5,FOe=4e6;function A7(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}a(A7,"numeric");function jOe(e){return e.replace(OOe,IX).replace(NOe,TX).replace(POe,T7).replace(DOe,CX).replace(MOe,RX)}a(jOe,"escapeBraces");function UOe(e){return e.replace(IOe,"\\").replace(TOe,"{").replace(COe,"}").replace(ROe,",").replace($Oe,".")}a(UOe,"unescapeBraces");function $X(e){if(!e)return[""];let t=[],r=_7("{","}",e);if(!r)return e.split(",");let{pre:n,body:i,post:s}=r,o=n.split(",");o[o.length-1]+="{"+i+"}";let l=$X(s);return s.length&&(o[o.length-1]+=l.shift(),o.push.apply(o,l)),t.push.apply(t,o),t}a($X,"parseCommaParts");function OX(e,t={}){if(!e)return[];let{max:r=LOe,maxLength:n=FOe}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),I7(jOe(e),r,n,!0).map(UOe)}a(OX,"expand");function BOe(e){return"{"+e+"}"}a(BOe,"embrace");function qOe(e){return/^-?0\d/.test(e)}a(qOe,"isPadded");function zOe(e,t){return e<=t}a(zOe,"lte");function WOe(e,t){return e>=t}a(WOe,"gte");function og(e,t,r,n,i,s){let o=[],l=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(l+d.length>i)return o;o.push(d),l+=d.length}}return o}a(og,"combine");function HOe(e,t,r,n){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=A7(i[0]),l=A7(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(A7(i[2])),1):1,d=zOe;l<o&&(u*=-1,d=WOe);let h=i.some(qOe),f=0;for(let g=o;d(g,l)&&s.length<r;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),h){let v=c-y.length;if(v>0){let b=new Array(v+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(f+y.length>n)break;s.push(y),f+=y.length}return s}a(HOe,"expandSequence");function I7(e,t,r,n){let i=[""],s=!1,o=!0;for(;;){let l=_7("{","}",e);if(!l)return og(i,e,[""],t,r,s);let c=l.pre;if(/\$$/.test(c)){if(i=og(i,c+"{"+l.body+"}",[""],t,r,s&&!l.post.length),o=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,h=l.body.indexOf(",")>=0;if(!p&&!h){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+T7+l.post,n=!0;continue}return og(i,c+"{"+l.body+"}"+l.post,[""],t,r,s)}o&&(s=n&&!p,o=!1);let f;if(p)f=HOe(l.body,d,t,r);else{let g=$X(l.body);if(g.length===1&&g[0]!==void 0&&(g=I7(g[0],t,r,!1).map(BOe),g.length===1)){if(i=og(i,c+g[0],[""],t,r,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let b=0;y&&b<i.length;b++)i[b]&&(y=!1);f=[];let v=0;e:for(let b=0;b<g.length;b++){let x=I7(g[b],t,r,!1);for(let w=0;w<x.length;w++){let E=x[w];if(!(y&&!E)){if(f.length>=t||v+E.length>r)break e;f.push(E),v+=E.length}}}}if(i=og(i,c,f,t,r,s&&!l.post.length),!l.post.length)break;e=l.post}return i}a(I7,"expand_");var ag=a(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var GOe={"[: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]},lg=a(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),VOe=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),NX=a(e=>e.join(""),"rangesToString"),PX=a((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,l=!1,c=!1,u=!1,d=r,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===r+1){u=!0,s++;continue}if(y==="]"&&o&&!c){d=s+1;break}if(o=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[v,[b,x,w]]of Object.entries(GOe))if(e.startsWith(v,s)){if(p)return["$.",!1,e.length-r,!0];s+=v.length,w?i.push(b):n.push(b),l=l||x;continue e}}if(c=!1,p){y>p?n.push(lg(p)+"-"+lg(y)):y===p&&n.push(lg(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){n.push(lg(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}n.push(lg(y)),s++}if(d<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,e.length-r,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let y=n[0].length===2?n[0].slice(-1):n[0];return[VOe(y),!1,d-r,!1]}let h="["+(u?"^":"")+NX(n)+"]",f="["+(u?"":"^")+NX(i)+"]";return[n.length&&i.length?"("+h+"|"+f+")":n.length?h:f,l,d-r,!0]},"parseClass");var Yl=a((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 Fi,ZOe=new Set(["!","?","+","*","@"]),C7=a(e=>ZOe.has(e),"isExtglobType"),DX=a(e=>C7(e.type),"isExtglobAST"),KOe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),JOe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),XOe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),MX=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),YOe="(?!(?:^|/)\\.\\.?(?:$|/))",Db="(?!\\.)",QOe=new Set(["[","."]),eNe=new Set(["..","."]),tNe=new Set("().*{}+?[]^$\\!"),rNe=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),R7="[^/]",LX=R7+"*?",FX=R7+"+?",nNe=0,Ru=class{static{a(this,"AST")}type;#e;#r;#n=!1;#t=[];#i;#s;#a;#d=!1;#l;#o;#c=!1;id=++nNe;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,r,n={}){this.type=t,t&&(this.#r=!0),this.#i=r,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?n:this.#e.#l,this.#a=this.#e===this?[]:this.#e.#a,t==="!"&&!this.#e.#d&&this.#a.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#o!==void 0?this.#o:this.type?this.#o=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#o=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#a.pop();){if(t.type!=="!")continue;let r=t,n=r.#i;for(;n;){for(let i=r.#s+1;!n.type&&i<n.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#t[i])}r=n,n=r.#i}}return this}push(...t){for(let r of t)if(r!==""){if(typeof r!="string"&&!(r instanceof Fi&&r.#i===this))throw new Error("invalid part: "+r);this.#t.push(r)}}toJSON(){let t=this.type===null?this.#t.slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...this.#t.map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let r=0;r<this.#s;r++){let n=t.#t[r];if(!(n instanceof Fi&&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 Fi(this.type,t);for(let n of this.#t)r.copyIn(n);return r}static#m(t,r,n,i,s){let o=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(r.type===null){let y=n,v="";for(;y<t.length;){let b=t.charAt(y++);if(l||b==="\\"){l=!l,v+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),v+=b;continue}else if(b==="["){c=!0,u=y,d=!1,v+=b;continue}if(!i.noext&&C7(b)&&t.charAt(y)==="("&&s<=o){r.push(v),v="";let w=new Fi(b,r);y=Fi.#m(t,w,y,i,s+1),r.push(w);continue}v+=b}return r.push(v),y}let p=n+1,h=new Fi(null,r),f=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&C7(y)&&t.charAt(p)==="("&&(s<=o||r&&r.#y(y))){let b=r&&r.#y(y)?0:1;h.push(g),g="";let x=new Fi(y,h);h.push(x),p=Fi.#m(t,x,p,i,s+b);continue}if(y==="|"){h.push(g),g="",f.push(h),h=new Fi(null,r);continue}if(y===")")return g===""&&r.#t.length===0&&(r.#c=!0),h.push(g),g="",r.push(...f,h),p;g+=y}return r.type=null,r.#r=void 0,r.#t=[t.substring(n-1)],p}#N(t){return this.#g(t,JOe)}#g(t,r=KOe){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#y(n.type,r)}#y(t,r=XOe){return!!r.get(this.type)?.includes(t)}#p(t,r){let n=t.#t[0],i=new Fi(null,n,this.options);i.#t.push(""),n.push(i),this.#_(t,r)}#_(t,r){let n=t.#t[0];this.#t.splice(r,1,...n.#t);for(let i of n.#t)typeof i=="object"&&(i.#i=this);this.#o=void 0}#A(t){return!!MX.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#A(r.type)}#v(t){let r=MX.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 Fi(null,void 0,r);return Fi.#m(t,n,0,r,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[r,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${r}$`,l),{_src:r,_glob:t})}get options(){return this.#l}toRegExpSource(t){let r=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!DX(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(f=>typeof f!="string"),u=this.#t.map(f=>{let[g,y,v,b]=typeof f=="string"?Fi.#I(f,this.#r,c):f.toRegExpSource(t);return this.#r=this.#r||v,this.#n=this.#n||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&eNe.has(this.#t[0]))){let g=QOe,y=r&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),v=!r&&!t&&g.has(u.charAt(0));d=y?YOe:v?Db:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,Yl(u),this.#r=!!this.#r,this.#n]}let n=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#x(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,Yl(this.toString()),!1,!1]}let o=!n||t||r||!Db?"":this.#x(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!r?Db:"")+FX;else{let c=this.type==="!"?"))"+(this.isStart()&&!r&&!t?Db:"")+LX+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;l=i+s+c}return[l,Yl(s),this.#r=!!this.#r,this.#n]}#f(){if(DX(this)){let t=0,r=!1;do{r=!0;for(let n=0;n<this.#t.length;n++){let i=this.#t[n];typeof i=="object"&&(i.#f(),this.#g(i)?(r=!1,this.#_(i,n)):this.#N(i)?(r=!1,this.#p(i,n)):this.#P(i)&&(r=!1,this.#v(i)))}}while(!r&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#o=void 0}#x(t){return this.#t.map(r=>{if(typeof r=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=r.toRegExpSource(t);return this.#n=this.#n||o,n}).filter(r=>!(this.isStart()&&this.isEnd())||!!r).join("|")}static#I(t,r,n=!1){let i=!1,s="",o=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(tNe.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=n&&/^[*]+$/.test(t)?FX:LX,r=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,h,f]=PX(t,c);if(h){s+=d,o=o||p,c+=h-1,r=r||f;continue}}if(u==="?"){s+=R7,r=!0;continue}s+=rNe(u)}return[s,Yl(t),!!r,o]}};Fi=Ru;var $7=a((e,{windowsPathsNoEscape:t=!1,magicalBraces:r=!1}={})=>r?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var zn=a((e,t,r={})=>(ag(t),!r.nocomment&&t.charAt(0)==="#"?!1:new qp(t,r).match(e)),"minimatch"),iNe=/^\*+([^+@!?*[(]*)$/,sNe=a(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),oNe=a(e=>t=>t.endsWith(e),"starDotExtTestDot"),aNe=a(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),lNe=a(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),cNe=/^\*+\.\*+$/,uNe=a(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),dNe=a(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),pNe=/^\.\*+$/,fNe=a(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),hNe=/^\*+$/,mNe=a(e=>e.length!==0&&!e.startsWith("."),"starTest"),gNe=a(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),yNe=/^\?+([^+@!?*[(]*)?$/,vNe=a(([e,t=""])=>{let r=BX([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocase"),xNe=a(([e,t=""])=>{let r=qX([e]);return t?(t=t.toLowerCase(),n=>r(n)&&n.toLowerCase().endsWith(t)):r},"qmarksTestNocaseDot"),bNe=a(([e,t=""])=>{let r=qX([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTestDot"),wNe=a(([e,t=""])=>{let r=BX([e]);return t?n=>r(n)&&n.endsWith(t):r},"qmarksTest"),BX=a(([e])=>{let t=e.length;return r=>r.length===t&&!r.startsWith(".")},"qmarksTestNoExt"),qX=a(([e])=>{let t=e.length;return r=>r.length===t&&r!=="."&&r!==".."},"qmarksTestNoExtDot"),zX=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",jX={win32:{sep:"\\"},posix:{sep:"/"}},SNe=zX==="win32"?jX.win32.sep:jX.posix.sep;zn.sep=SNe;var pi=Symbol("globstar **");zn.GLOBSTAR=pi;var ENe="[^/]",kNe=ENe+"*?",_Ne="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ANe="(?:(?!(?:\\/|^)\\.).)*?",INe=a((e,t={})=>r=>zn(r,e,t),"filter");zn.filter=INe;var _s=a((e,t={})=>Object.assign({},e,t),"ext"),TNe=a(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zn;let t=zn;return Object.assign(a((n,i,s={})=>t(n,i,_s(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,_s(e,s))}static defaults(i){return t.defaults(_s(e,i)).Minimatch}},AST:class extends t.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,_s(e,o))}static fromGlob(i,s={}){return t.AST.fromGlob(i,_s(e,s))}},unescape:a((n,i={})=>t.unescape(n,_s(e,i)),"unescape"),escape:a((n,i={})=>t.escape(n,_s(e,i)),"escape"),filter:a((n,i={})=>t.filter(n,_s(e,i)),"filter"),defaults:a(n=>t.defaults(_s(e,n)),"defaults"),makeRe:a((n,i={})=>t.makeRe(n,_s(e,i)),"makeRe"),braceExpand:a((n,i={})=>t.braceExpand(n,_s(e,i)),"braceExpand"),match:a((n,i,s={})=>t.match(n,i,_s(e,s)),"match"),sep:t.sep,GLOBSTAR:pi})},"defaults");zn.defaults=TNe;var WX=a((e,t={})=>(ag(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:OX(e,{max:t.braceExpandMax})),"braceExpand");zn.braceExpand=WX;var CNe=a((e,t={})=>new qp(e,t).makeRe(),"makeRe");zn.makeRe=CNe;var RNe=a((e,t,r={})=>{let n=new qp(t,r);return e=e.filter(i=>n.match(i)),n.options.nonull&&!e.length&&e.push(t),e},"match");zn.match=RNe;var UX=/[?*]|[+@!]\(.*?\)|\[|\]/,$Ne=a(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),qp=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,r={}){ag(t),r=r||{},this.options=r,this.maxGlobstarRecursion=r.maxGlobstarRecursion??200,this.pattern=t,this.platform=r.platform||zX,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,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!UX.test(s[2]))&&!UX.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 l=n[i+1],c=n[i+2],u=n[i+3];if(l!==".."||!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 l=n[o];o===1&&l===""&&n[0]===""||(l==="."||l==="")&&(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=[],l="";for(;i<t.length&&s<r.length;)if(t[i]===r[s])o.push(l==="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(l==="b")return!1;l="a",o.push(t[i]),i++,s++}else if(r[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="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 l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof r[0]=="string"&&/^[a-z]:$/i.test(r[0]),d=!u&&r[0]===""&&r[1]===""&&r[2]==="?"&&typeof r[3]=="string"&&/^[a-z]:$/i.test(r[3]),p=c?3:l?0:void 0,h=d?3:u?0:void 0;if(typeof p=="number"&&typeof h=="number"){let[f,g]=[t[p],r[h]];f.toLowerCase()===g.toLowerCase()&&(r[h]=f,s=h,i=p)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(t=this.levelTwoFileOptimize(t)),r.includes(pi)?this.#e(t,r,n,i,s):this.#n(t,r,n,i,s)}#e(t,r,n,i,s){let o=r.indexOf(pi,s),l=r.lastIndexOf(pi),[c,u,d]=n?[r.slice(s,o),r.slice(o+1),[]]:[r.slice(s,o),r.slice(o+1,l),r.slice(l+1)];if(c.length){let x=t.slice(i,i+c.length);if(!this.#n(x,c,n,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let x=t.length-d.length;if(this.#n(t,d,n,x,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(x--,!this.#n(t,d,n,x,0)))return!1;p=d.length+1}}if(!u.length){let x=!!p;for(let w=i;w<t.length-p;w++){let E=String(t[w]);if(x=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||x}let h=[[[],0]],f=h[0],g=0,y=[0];for(let x of u)x===pi?(y.push(g),f=[[],0],h.push(f)):(f[0].push(x),g++);let v=h.length-1,b=t.length-p;for(let x of h)x[1]=b-(y[v--]+x[0].length);return!!this.#r(t,h,i,0,n,0,!!p)}#r(t,r,n,i,s,o,l){let c=r[i];if(!c){for(let p=n;p<t.length;p++){l=!0;let h=t[p];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return l}let[u,d]=c;for(;n<=d;){if(this.#n(t.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let f=this.#r(t,r,n+u.length,i+1,s,o+1,l);if(f!==!1)return f}let h=t[n];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;n++}return s||null}#n(t,r,n,i,s){let o,l,c,u;for(o=i,l=s,u=t.length,c=r.length;o<u&&l<c;o++,l++){this.debug("matchOne loop");let d=r[l],p=t[o];if(this.debug(r,d,p),d===!1||d===pi)return!1;let h;if(typeof d=="string"?(h=p===d,this.debug("string match",d,p,h)):(h=d.test(p),this.debug("pattern match",d,p,h)),!h)return!1}if(o===u&&l===c)return!0;if(o===u)return n;if(l===c)return o===u-1&&t[o]==="";throw new Error("wtf?")}braceExpand(){return WX(this.pattern,this.options)}parse(t){ag(t);let r=this.options;if(t==="**")return pi;if(t==="")return"";let n,i=null;(n=t.match(hNe))?i=r.dot?gNe:mNe:(n=t.match(iNe))?i=(r.nocase?r.dot?lNe:aNe:r.dot?oNe:sNe)(n[1]):(n=t.match(yNe))?i=(r.nocase?r.dot?xNe:vNe:r.dot?bNe:wNe)(n):(n=t.match(cNe))?i=r.dot?dNe:uNe:(n=t.match(pNe))&&(i=fNe);let s=Ru.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?kNe:r.dot?_Ne:ANe,i=new Set(r.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let h of p.flags.split(""))i.add(h);return typeof p=="string"?$Ne(p):p===pi?pi:p._src});u.forEach((p,h)=>{let f=u[h+1],g=u[h-1];p!==pi||g===pi||(g===void 0?f!==void 0&&f!==pi?u[h+1]="(?:\\/|"+n+"\\/)?"+f:u[h]=n:f===void 0?u[h-1]=g+"(?:\\/|\\/"+n+")?":f!==pi&&(u[h-1]=g+"(?:\\/|\\/"+n+"\\/)"+f,u[h+1]=pi))});let d=u.filter(p=>p!==pi);if(this.partial&&d.length>=1){let p=[];for(let h=1;h<=d.length;h++)p.push(d.slice(0,h).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[o,l]=t.length>1?["(?:",")"]:["",""];s="^"+o+s+l+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,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 l=i.length-2;!o&&l>=0;l--)o=i[l];for(let l of s){let c=i;if(n.matchBase&&l.length===1&&(c=[o]),this.matchOne(c,l,r))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(t){return zn.defaults(t).Minimatch}};zn.AST=Ru;zn.Minimatch=qp;zn.escape=$7;zn.unescape=Yl;import{gunzipSync as M5e}from"node:zlib";var cg=class{static{a(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),l=this.removeEmpty(this.tokenize(s,n)),c=this.removeEmpty(this.tokenize(o,n));return this.diffWithOptionsObj(l,c,n,i)}diffWithOptionsObj(t,r,n,i){var s;let o=a(x=>{if(x=this.postProcess(x,n),i){setTimeout(function(){i(x)},0);return}else return x},"done"),l=r.length,c=t.length,u=1,d=l+c;n.maxEditLength!=null&&(d=Math.min(d,n.maxEditLength));let p=(s=n.timeout)!==null&&s!==void 0?s:1/0,h=Date.now()+p,f=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(f[0],r,t,0,n);if(f[0].oldPos+1>=c&&g+1>=l)return o(this.buildValues(f[0].lastComponent,r,t));let y=-1/0,v=1/0,b=a(()=>{for(let x=Math.max(y,-u);x<=Math.min(v,u);x+=2){let w,E=f[x-1],S=f[x+1];E&&(f[x-1]=void 0);let k=!1;if(S){let O=S.oldPos-x;k=S&&0<=O&&O<l}let _=E&&E.oldPos+1<c;if(!k&&!_){f[x]=void 0;continue}if(!_||k&&E.oldPos<S.oldPos?w=this.addToPath(S,!0,!1,0,n):w=this.addToPath(E,!1,!0,1,n),g=this.extractCommon(w,r,t,x,n),w.oldPos+1>=c&&g+1>=l)return o(this.buildValues(w.lastComponent,r,t))||!0;f[x]=w,w.oldPos+1>=c&&(v=Math.min(v,x-1)),g+1>=l&&(y=Math.max(y,x+1))}u++},"execEditLength");if(i)a(function x(){setTimeout(function(){if(u>d||Date.now()>h)return i(void 0);b()||x()},0)},"exec")();else for(;u<=d&&Date.now()<=h;){let x=b();if(x)return x}}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,l=n.length,c=t.oldPos,u=c-i,d=0;for(;u+1<o&&c+1<l&&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,l=0,c=0,u=0;for(;l<o;l++){let d=i[l];if(d.removed)d.value=this.join(n.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=r.slice(c,c+d.count);p=p.map(function(h,f){let g=n[u+f];return g.length>h.length?g:h}),d.value=this.join(p)}else d.value=this.join(r.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var O7=class extends cg{static{a(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=NNe}equals(t,r,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
3397
3397
  `))&&(t=t.trim()),(!n.newlineIsToken||!r.includes(`
3398
3398
  `))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
3399
3399
  `)&&(t=t.slice(0,-1)),r.endsWith(`
@@ -3393,7 +3393,7 @@ The web search request used endpoint ${JSON.stringify(e)}. Search endpoint confi
3393
3393
  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; }
3394
3394
  .secondary { background: #29314b; color: #edf2ff; }
3395
3395
  .error { padding: .75rem; border-radius: .5rem; background: #461d2b; color: #ffd6df; }
3396
- `}o(vG,"pageStyles");var sA={name:"dsh-edge",version:"0.11.0",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.2-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var ry=sA.version,wG=sA.dshEdge.upstreamVersion;function Xke(){return"dsh-edge@0.11.0/isolated"}o(Xke,"resolveEdgeDeploymentId");function iy(e){return{baseURL:z5(e.DEEPSEEK_BASE_URL),maxTokens:H5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:jl(e.DEEPSEEK_MODEL),reasoningEffort:q5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_2(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:W5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Zf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(iy,"resolveEdgeDeploymentConfig");function Jke(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}o(Jke,"edgeDeploymentApiKeyConfigured");function Qke(e){let t=z5(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}o(Qke,"projectedEdgeBaseURL");function aA(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:Xke(),apiKeyConfigured:Jke(e),baseURL:Qke(e.DEEPSEEK_BASE_URL),maxTokens:H5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:jl(e.DEEPSEEK_MODEL),reasoningEffort:q5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_2(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:W5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Zf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(aA,"resolveEdgeDeploymentProfile");function SG(e){iy(e);let t=aA(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:ry,upstreamVersion:wG,status:"ready"}}o(SG,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Prt}from"cloudflare:workers";var Sc=Tc(EG(),1);var oA=o((e,t,n)=>{let r=e instanceof RegExp?kG(e,n):e,i=t instanceof RegExp?kG(t,n):t,s=r!==null&&i!=null&&Yke(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),kG=o((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Yke=o((e,t,n)=>{let r,i,s,a,l,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],s=n.length;d>=0&&!l;){if(d===c)r.push(d),c=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(l=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}r.length&&a!==void 0&&(l=[s,a])}return l},"range");var _G="\0SLASH"+Math.random()+"\0",AG="\0OPEN"+Math.random()+"\0",uA="\0CLOSE"+Math.random()+"\0",TG="\0COMMA"+Math.random()+"\0",IG="\0PERIOD"+Math.random()+"\0",e5e=new RegExp(_G,"g"),t5e=new RegExp(AG,"g"),n5e=new RegExp(uA,"g"),r5e=new RegExp(TG,"g"),i5e=new RegExp(IG,"g"),s5e=/\\\\/g,a5e=/\\{/g,o5e=/\\}/g,l5e=/\\,/g,c5e=/\\\./g,u5e=1e5,d5e=4e6;function lA(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}o(lA,"numeric");function p5e(e){return e.replace(s5e,_G).replace(a5e,AG).replace(o5e,uA).replace(l5e,TG).replace(c5e,IG)}o(p5e,"escapeBraces");function f5e(e){return e.replace(e5e,"\\").replace(t5e,"{").replace(n5e,"}").replace(r5e,",").replace(i5e,".")}o(f5e,"unescapeBraces");function CG(e){if(!e)return[""];let t=[],n=oA("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";let l=CG(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}o(CG,"parseCommaParts");function RG(e,t={}){if(!e)return[];let{max:n=u5e,maxLength:r=d5e}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),cA(p5e(e),n,r,!0).map(f5e)}o(RG,"expand");function h5e(e){return"{"+e+"}"}o(h5e,"embrace");function m5e(e){return/^-?0\d/.test(e)}o(m5e,"isPadded");function g5e(e,t){return e<=t}o(g5e,"lte");function y5e(e,t){return e>=t}o(y5e,"gte");function Jf(e,t,n,r,i,s){let a=[],l=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=r)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(l+d.length>i)return a;a.push(d),l+=d.length}}return a}o(Jf,"combine");function x5e(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let a=lA(i[0]),l=lA(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(lA(i[2])),1):1,d=g5e;l<a&&(u*=-1,d=y5e);let m=i.some(m5e),h=0;for(let g=a;d(g,l)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),m){let x=c-y.length;if(x>0){let b=new Array(x+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}o(x5e,"expandSequence");function cA(e,t,n,r){let i=[""],s=!1,a=!0;for(;;){let l=oA("{","}",e);if(!l)return Jf(i,e,[""],t,n,s);let c=l.pre;if(/\$$/.test(c)){if(i=Jf(i,c+"{"+l.body+"}",[""],t,n,s&&!l.post.length),a=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,m=l.body.indexOf(",")>=0;if(!p&&!m){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+uA+l.post,r=!0;continue}return Jf(i,c+"{"+l.body+"}"+l.post,[""],t,n,s)}a&&(s=r&&!p,a=!1);let h;if(p)h=x5e(l.body,d,t,n);else{let g=CG(l.body);if(g.length===1&&g[0]!==void 0&&(g=cA(g[0],t,n,!1).map(h5e),g.length===1)){if(i=Jf(i,c+g[0],[""],t,n,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let b=0;y&&b<i.length;b++)i[b]&&(y=!1);h=[];let x=0;e:for(let b=0;b<g.length;b++){let w=cA(g[b],t,n,!1);for(let v=0;v<w.length;v++){let E=w[v];if(!(y&&!E)){if(h.length>=t||x+E.length>n)break e;h.push(E),x+=E.length}}}}if(i=Jf(i,c,h,t,n,s&&!l.post.length),!l.post.length)break;e=l.post}return i}o(cA,"expand_");var Qf=o(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var b5e={"[: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]},Yf=o(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),v5e=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),NG=o(e=>e.join(""),"rangesToString"),OG=o((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,a=!1,l=!1,c=!1,u=!1,d=n,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[x,[b,w,v]]of Object.entries(b5e))if(e.startsWith(x,s)){if(p)return["$.",!1,e.length-n,!0];s+=x.length,v?i.push(b):r.push(b),l=l||w;continue e}}if(c=!1,p){y>p?r.push(Yf(p)+"-"+Yf(y)):y===p&&r.push(Yf(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(Yf(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(Yf(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[v5e(y),!1,d-n,!1]}let m="["+(u?"^":"")+NG(r)+"]",h="["+(u?"":"^")+NG(i)+"]";return[r.length&&i.length?"("+m+"|"+h+")":r.length?m:h,l,d-n,!0]},"parseClass");var $o=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var ri,w5e=new Set(["!","?","+","*","@"]),dA=o(e=>w5e.has(e),"isExtglobType"),$G=o(e=>dA(e.type),"isExtglobAST"),S5e=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),E5e=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),k5e=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),PG=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),_5e="(?!(?:^|/)\\.\\.?(?:$|/))",ay="(?!\\.)",A5e=new Set(["[","."]),T5e=new Set(["..","."]),I5e=new Set("().*{}+?[]^$\\!"),C5e=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),pA="[^/]",DG=pA+"*?",MG=pA+"+?",R5e=0,sc=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#d=!1;#l;#a;#c=!1;id=++R5e;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?r:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#d&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof ri&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let r=t.#t[n];if(!(r instanceof ri&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new ri(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let a=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=r,x="";for(;y<t.length;){let b=t.charAt(y++);if(l||b==="\\"){l=!l,x+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),x+=b;continue}else if(b==="["){c=!0,u=y,d=!1,x+=b;continue}if(!i.noext&&dA(b)&&t.charAt(y)==="("&&s<=a){n.push(x),x="";let v=new ri(b,n);y=ri.#m(t,v,y,i,s+1),n.push(v);continue}x+=b}return n.push(x),y}let p=r+1,m=new ri(null,n),h=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&dA(y)&&t.charAt(p)==="("&&(s<=a||n&&n.#y(y))){let b=n&&n.#y(y)?0:1;m.push(g),g="";let w=new ri(y,m);m.push(w),p=ri.#m(t,w,p,i,s+b);continue}if(y==="|"){m.push(g),g="",h.push(m),m=new ri(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),m.push(g),g="",n.push(...h,m),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#$(t){return this.#g(t,E5e)}#g(t,n=S5e){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=k5e){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new ri(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#a=void 0}#A(t){return!!PG.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#A(n.type)}#x(t){let n=PG.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let r=new ri(null,void 0,n);return ri.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,l),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!$G(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,x,b]=typeof h=="string"?ri.#T(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||x,this.#r=this.#r||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&T5e.has(this.#t[0]))){let g=A5e,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),x=!n&&!t&&g.has(u.charAt(0));d=y?_5e:x?ay:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,$o(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,$o(this.toString()),!1,!1]}let a=!r||t||n||!ay?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!n?ay:"")+MG;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?ay:"")+DG+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=i+s+c}return[l,$o(s),this.#n=!!this.#n,this.#r]}#f(){if($G(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#$(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#x(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#a=void 0}#b(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#T(t,n,r=!1){let i=!1,s="",a=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(I5e.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(t)?MG:DG,n=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,m,h]=OG(t,c);if(m){s+=d,a=a||p,c+=m-1,n=n||h;continue}}if(u==="?"){s+=pA,n=!0;continue}s+=C5e(u)}return[s,$o(t),!!n,a]}};ri=sc;var fA=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var fr=o((e,t,n={})=>(Qf(t),!n.nocomment&&t.charAt(0)==="#"?!1:new id(t,n).match(e)),"minimatch"),N5e=/^\*+([^+@!?*[(]*)$/,O5e=o(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),$5e=o(e=>t=>t.endsWith(e),"starDotExtTestDot"),P5e=o(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),D5e=o(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),M5e=/^\*+\.\*+$/,L5e=o(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),j5e=o(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),F5e=/^\.\*+$/,U5e=o(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),B5e=/^\*+$/,z5e=o(e=>e.length!==0&&!e.startsWith("."),"starTest"),q5e=o(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),W5e=/^\?+([^+@!?*[(]*)?$/,H5e=o(([e,t=""])=>{let n=FG([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),G5e=o(([e,t=""])=>{let n=UG([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),V5e=o(([e,t=""])=>{let n=UG([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),Z5e=o(([e,t=""])=>{let n=FG([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),FG=o(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),UG=o(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),BG=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",LG={win32:{sep:"\\"},posix:{sep:"/"}},K5e=BG==="win32"?LG.win32.sep:LG.posix.sep;fr.sep=K5e;var $r=Symbol("globstar **");fr.GLOBSTAR=$r;var X5e="[^/]",J5e=X5e+"*?",Q5e="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Y5e="(?:(?!(?:\\/|^)\\.).)*?",e7e=o((e,t={})=>n=>fr(n,e,t),"filter");fr.filter=e7e;var Pi=o((e,t={})=>Object.assign({},e,t),"ext"),t7e=o(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return fr;let t=fr;return Object.assign(o((r,i,s={})=>t(r,i,Pi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,Pi(e,s))}static defaults(i){return t.defaults(Pi(e,i)).Minimatch}},AST:class extends t.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,Pi(e,a))}static fromGlob(i,s={}){return t.AST.fromGlob(i,Pi(e,s))}},unescape:o((r,i={})=>t.unescape(r,Pi(e,i)),"unescape"),escape:o((r,i={})=>t.escape(r,Pi(e,i)),"escape"),filter:o((r,i={})=>t.filter(r,Pi(e,i)),"filter"),defaults:o(r=>t.defaults(Pi(e,r)),"defaults"),makeRe:o((r,i={})=>t.makeRe(r,Pi(e,i)),"makeRe"),braceExpand:o((r,i={})=>t.braceExpand(r,Pi(e,i)),"braceExpand"),match:o((r,i,s={})=>t.match(r,i,Pi(e,s)),"match"),sep:t.sep,GLOBSTAR:$r})},"defaults");fr.defaults=t7e;var zG=o((e,t={})=>(Qf(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:RG(e,{max:t.braceExpandMax})),"braceExpand");fr.braceExpand=zG;var n7e=o((e,t={})=>new id(e,t).makeRe(),"makeRe");fr.makeRe=n7e;var r7e=o((e,t,n={})=>{let r=new id(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");fr.match=r7e;var jG=/[?*]|[+@!]\(.*?\)|\[|\]/,i7e=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),id=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){Qf(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||BG,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!jG.test(s[2]))&&!jG.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let l=r[a];a===1&&l===""&&r[0]===""||(l==="."||l==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,a=[],l="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])a.push(l==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])a.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])a.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(l==="b")return!1;l="a",a.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="b",a.push(n[s]),i++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=c?3:l?0:void 0,m=d?3:u?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[h,g]=[t[p],n[m]];h.toLowerCase()===g.toLowerCase()&&(n[m]=h,s=m,i=p)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes($r)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let a=n.indexOf($r,s),l=n.lastIndexOf($r),[c,u,d]=r?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,l),n.slice(l+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#r(w,c,r,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#r(t,d,r,w,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#r(t,d,r,w,0)))return!1;p=d.length+1}}if(!u.length){let w=!!p;for(let v=i;v<t.length-p;v++){let E=String(t[v]);if(w=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||w}let m=[[[],0]],h=m[0],g=0,y=[0];for(let w of u)w===$r?(y.push(g),h=[[],0],m.push(h)):(h[0].push(w),g++);let x=m.length-1,b=t.length-p;for(let w of m)w[1]=b-(y[x--]+w[0].length);return!!this.#n(t,m,i,0,r,0,!!p)}#n(t,n,r,i,s,a,l){let c=n[i];if(!c){for(let p=r;p<t.length;p++){l=!0;let m=t[p];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return l}let[u,d]=c;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,r+u.length,i+1,s,a+1,l);if(h!==!1)return h}let m=t[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let a,l,c,u;for(a=i,l=s,u=t.length,c=n.length;a<u&&l<c;a++,l++){this.debug("matchOne loop");let d=n[l],p=t[a];if(this.debug(n,d,p),d===!1||d===$r)return!1;let m;if(typeof d=="string"?(m=p===d,this.debug("string match",d,p,m)):(m=d.test(p),this.debug("pattern match",d,p,m)),!m)return!1}if(a===u&&l===c)return!0;if(a===u)return r;if(l===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return zG(this.pattern,this.options)}parse(t){Qf(t);let n=this.options;if(t==="**")return $r;if(t==="")return"";let r,i=null;(r=t.match(B5e))?i=n.dot?q5e:z5e:(r=t.match(N5e))?i=(n.nocase?n.dot?D5e:P5e:n.dot?$5e:O5e)(r[1]):(r=t.match(W5e))?i=(n.nocase?n.dot?G5e:H5e:n.dot?V5e:Z5e)(r):(r=t.match(M5e))?i=n.dot?j5e:L5e:(r=t.match(F5e))&&(i=U5e);let s=sc.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?J5e:n.dot?Q5e:Y5e,i=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))i.add(m);return typeof p=="string"?i7e(p):p===$r?$r:p._src});u.forEach((p,m)=>{let h=u[m+1],g=u[m-1];p!==$r||g===$r||(g===void 0?h!==void 0&&h!==$r?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=g+"(?:\\/|\\/"+r+")?":h!==$r&&(u[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=$r))});let d=u.filter(p=>p!==$r);if(this.partial&&d.length>=1){let p=[];for(let m=1;m<=d.length;m++)p.push(d.slice(0,m).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+l+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return fr.defaults(t).Minimatch}};fr.AST=sc;fr.Minimatch=id;fr.escape=fA;fr.unescape=$o;import{gunzipSync as IAe}from"node:zlib";var eh=class{static{o(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),a=this.castInput(n,r),l=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(l,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;let a=o(w=>{if(w=this.postProcess(w,r),i){setTimeout(function(){i(w)},0);return}else return w},"done"),l=n.length,c=t.length,u=1,d=l+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&g+1>=l)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,x=1/0,b=o(()=>{for(let w=Math.max(y,-u);w<=Math.min(x,u);w+=2){let v,E=h[w-1],S=h[w+1];E&&(h[w-1]=void 0);let _=!1;if(S){let M=S.oldPos-w;_=S&&0<=M&&M<l}let I=E&&E.oldPos+1<c;if(!_&&!I){h[w]=void 0;continue}if(!I||_&&E.oldPos<S.oldPos?v=this.addToPath(S,!0,!1,0,r):v=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(v,n,t,w,r),v.oldPos+1>=c&&g+1>=l)return a(this.buildValues(v.lastComponent,n,t))||!0;h[w]=v,v.oldPos+1>=c&&(x=Math.min(x,w-1)),g+1>=l&&(y=Math.max(y,w+1))}u++},"execEditLength");if(i)o(function w(){setTimeout(function(){if(u>d||Date.now()>m)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=m;){let w=b();if(w)return w}}addToPath(t,n,r,i,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){let a=n.length,l=r.length,c=t.oldPos,u=c-i,d=0;for(;u+1<a&&c+1<l&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let a=i.length,l=0,c=0,u=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(c,c+d.count);p=p.map(function(m,h){let g=r[u+h];return g.length>m.length?g:m}),d.value=this.join(p)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var hA=class extends eh{static{o(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=a7e}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
3396
+ `}o(vG,"pageStyles");var sA={name:"dsh-edge",version:"0.11.1",description:"Your DeepSeek Harness, anywhere \u2014 deploy a persistent personal coding agent to Cloudflare Workers in one command",author:"pawaca",license:"MIT",type:"module",bin:{"dsh-edge":"scripts/cli.mjs"},files:["dist","worker","scripts/*.d.mts","scripts/*.mjs","wrangler.jsonc","README.md","README.zh.md","LICENSE","THIRD_PARTY_NOTICES.md"],repository:{type:"git",url:"git+https://github.com/pawaca/dsh-edge.git",directory:"apps/dsh-edge"},homepage:"https://github.com/pawaca/dsh-edge#readme",bugs:{url:"https://github.com/pawaca/dsh-edge/issues"},keywords:["deepseek","deepseek-harness","ai-agents","byok","cloudflare-workers","durable-objects","self-hosted"],engines:{node:">=22.14.0"},publishConfig:{access:"public"},dshEdge:{upstreamVersion:"0.1.2-rc.1"},scripts:{"bundle:direct":"pnpm run web:build && pnpm --dir standalone run build:worker:direct && node standalone/scripts/promote.mjs direct","bundle:isolated":"pnpm run web:build && pnpm --dir standalone run build:worker:isolated && node standalone/scripts/promote.mjs isolated","bundle:workers":"pnpm --dir standalone run build && pnpm --dir standalone run verify && node standalone/scripts/promote.mjs all",dev:"pnpm run bundle:direct && node scripts/dev.mjs direct","dev:isolated":"pnpm run bundle:isolated && node scripts/dev.mjs isolated","dsh-edge":"node scripts/cli.mjs","example:install":"node examples/install-keyless.mjs","install:cloudflare":"pnpm run bundle:workers && node scripts/cli.mjs install","legal:write":"node scripts/legal-files.mjs write","pack:verify":"node scripts/verify-packed.mjs",prepack:"node scripts/legal-files.mjs verify && pnpm run bundle:workers","web:build":"pnpm --dir standalone run build:web && node standalone/scripts/promote.mjs web",test:"vitest run --root ../.. --project edge-runtime","test:integration":"pnpm run bundle:workers && node tests/run-session-integration.mjs","test:snapshot":"vitest run --root ../.. --config apps/dsh-edge/vitest.snapshot.config.ts",typecheck:"tsc --noEmit"},dependencies:{"@clack/prompts":"1.7.0","compare-versions":"6.1.1",execa:"^10.0.1","jsonc-parser":"^3.3.1",wrangler:"4.129.0"},devDependencies:{"@cloudflare/computer":"0.2.1","@cloudflare/workers-types":"5.20260904.1","@deepseek-ai/cordis":"4.0.2","@deepseek-ai/dsh-agent":"0.1.2-rc.1","@deepseek-ai/dsh-agent-loop":"0.1.2-rc.1","@deepseek-ai/dsh-anonymous-user-id":"0.1.2-rc.1","@deepseek-ai/dsh-api-gateway":"0.1.2-rc.1","@deepseek-ai/dsh-api-remotes":"0.1.2-rc.1","@deepseek-ai/dsh-api-session-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-settings-controller":"0.1.2-rc.1","@deepseek-ai/dsh-api-workspace-controller":"0.1.2-rc.1","@deepseek-ai/dsh-attachment":"0.1.2-rc.1","@deepseek-ai/dsh-brand":"0.1.2-rc.1","@deepseek-ai/dsh-client-store":"0.1.2-rc.1","@deepseek-ai/dsh-commands":"0.1.2-rc.1","@deepseek-ai/dsh-compaction":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-basic":"0.1.2-rc.1","@deepseek-ai/dsh-compaction-tool-result-pruner":"0.1.2-rc.1","@deepseek-ai/dsh-credentials":"0.1.2-rc.1","@deepseek-ai/dsh-file-reference":"0.1.2-rc.1","@deepseek-ai/dsh-fs":"0.1.2-rc.1","@deepseek-ai/dsh-goal":"0.1.2-rc.1","@deepseek-ai/dsh-goal-round-driver":"0.1.2-rc.1","@deepseek-ai/dsh-host-directory-picker":"0.1.2-rc.1","@deepseek-ai/dsh-host-plugin-inventory":"0.1.2-rc.1","@deepseek-ai/dsh-launch-environment":"0.1.2-rc.1","@deepseek-ai/dsh-llm":"0.1.2-rc.1","@deepseek-ai/dsh-llm-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-message-feedback":"0.1.2-rc.1","@deepseek-ai/dsh-output-retention":"0.1.2-rc.1","@deepseek-ai/dsh-plan-mode":"0.1.2-rc.1","@deepseek-ai/dsh-sandbox":"0.1.2-rc.1","@deepseek-ai/dsh-scope":"0.1.2-rc.1","@deepseek-ai/dsh-session":"0.1.2-rc.1","@deepseek-ai/dsh-session-persistence":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection":"0.1.2-rc.1","@deepseek-ai/dsh-session-projection-cache":"0.1.2-rc.1","@deepseek-ai/dsh-session-query":"0.1.2-rc.1","@deepseek-ai/dsh-session-reference":"0.1.2-rc.1","@deepseek-ai/dsh-session-title":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-first-prompt-llm":"0.1.2-rc.1","@deepseek-ai/dsh-session-title-llm":"0.1.2-rc.1","@deepseek-ai/dsh-settings":"0.1.2-rc.1","@deepseek-ai/dsh-skill":"0.1.2-rc.1","@deepseek-ai/dsh-spill":"0.1.2-rc.1","@deepseek-ai/dsh-spill-policy":"0.1.2-rc.1","@deepseek-ai/dsh-storage":"0.1.2-rc.1","@deepseek-ai/dsh-storage-domain":"0.1.2-rc.1","@deepseek-ai/dsh-system-prompt":"0.1.2-rc.1","@deepseek-ai/dsh-timeout":"0.1.2-rc.1","@deepseek-ai/dsh-token-meter":"0.1.2-rc.1","@deepseek-ai/dsh-tool-ask-user":"0.1.2-rc.1","@deepseek-ai/dsh-tool-call-timeout-policy":"0.1.2-rc.1","@deepseek-ai/dsh-tool-fs":"0.1.2-rc.1","@deepseek-ai/dsh-tool-goal":"0.1.2-rc.1","@deepseek-ai/dsh-tool-skill":"0.1.2-rc.1","@deepseek-ai/dsh-tool-web":"0.1.2-rc.1","@deepseek-ai/dsh-tools":"0.1.2-rc.1","@deepseek-ai/dsh-typert-protocol":"0.1.2-rc.1","@deepseek-ai/dsh-typert-registry":"0.1.2-rc.1","@deepseek-ai/dsh-user-questions":"0.1.2-rc.1","@deepseek-ai/dsh-util-values":"0.1.2-rc.1","@deepseek-ai/dsh-web":"0.1.2-rc.1","@deepseek-ai/dsh-web-fetch-http":"0.1.2-rc.1","@deepseek-ai/dsh-web-search-deepseek":"0.1.2-rc.1","@deepseek-ai/dsh-workspace":"0.1.2-rc.1","@mixmark-io/domino":"2.2.0","fast-png":"8.0.0","jpeg-js":"0.4.4","just-bash":"3.4.2",playwright:"^1.49.0",typescript:"^6.0.3",vitest:"^4.1.8",ws:"^8.21.0"}};var ry=sA.version,wG=sA.dshEdge.upstreamVersion;function Xke(){return"dsh-edge@0.11.1/isolated"}o(Xke,"resolveEdgeDeploymentId");function iy(e){return{baseURL:z5(e.DEEPSEEK_BASE_URL),maxTokens:H5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:jl(e.DEEPSEEK_MODEL),reasoningEffort:q5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_2(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:W5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Zf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(iy,"resolveEdgeDeploymentConfig");function Jke(e){return typeof e.DEEPSEEK_API_KEY=="string"&&e.DEEPSEEK_API_KEY.trim().length>0}o(Jke,"edgeDeploymentApiKeyConfigured");function Qke(e){let t=z5(e),n=new URL(t);return n.search.length===0&&n.hash.length===0?t:(n.search="",n.hash="",n.href)}o(Qke,"projectedEdgeBaseURL");function aA(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:Xke(),apiKeyConfigured:Jke(e),baseURL:Qke(e.DEEPSEEK_BASE_URL),maxTokens:H5(e.DEEPSEEK_MAX_OUTPUT_TOKENS),model:jl(e.DEEPSEEK_MODEL),reasoningEffort:q5(e.DEEPSEEK_REASONING_EFFORT),searchBaseURL:_2(e.DEEPSEEK_SEARCH_BASE_URL),streamIdleTimeoutMs:W5(e.DEEPSEEK_STREAM_IDLE_TIMEOUT_MS),commandTimeoutPolicy:Zf(e.DSH_EDGE_DEFAULT_COMMAND_TIMEOUT_MS,e.DSH_EDGE_MAX_COMMAND_TIMEOUT_MS)}}o(aA,"resolveEdgeDeploymentProfile");function SG(e){iy(e);let t=aA(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:ry,upstreamVersion:wG,status:"ready"}}o(SG,"resolveEdgeDeploymentHealth");import{WorkerEntrypoint as Prt}from"cloudflare:workers";var Sc=Tc(EG(),1);var oA=o((e,t,n)=>{let r=e instanceof RegExp?kG(e,n):e,i=t instanceof RegExp?kG(t,n):t,s=r!==null&&i!=null&&Yke(r,i,n);return s&&{start:s[0],end:s[1],pre:n.slice(0,s[0]),body:n.slice(s[0]+r.length,s[1]),post:n.slice(s[1]+i.length)}},"balanced"),kG=o((e,t)=>{let n=t.match(e);return n?n[0]:null},"maybeMatch"),Yke=o((e,t,n)=>{let r,i,s,a,l,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(r=[],s=n.length;d>=0&&!l;){if(d===c)r.push(d),c=n.indexOf(e,d+1);else if(r.length===1){let p=r.pop();p!==void 0&&(l=[p,u])}else i=r.pop(),i!==void 0&&i<s&&(s=i,a=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}r.length&&a!==void 0&&(l=[s,a])}return l},"range");var _G="\0SLASH"+Math.random()+"\0",AG="\0OPEN"+Math.random()+"\0",uA="\0CLOSE"+Math.random()+"\0",TG="\0COMMA"+Math.random()+"\0",IG="\0PERIOD"+Math.random()+"\0",e5e=new RegExp(_G,"g"),t5e=new RegExp(AG,"g"),n5e=new RegExp(uA,"g"),r5e=new RegExp(TG,"g"),i5e=new RegExp(IG,"g"),s5e=/\\\\/g,a5e=/\\{/g,o5e=/\\}/g,l5e=/\\,/g,c5e=/\\\./g,u5e=1e5,d5e=4e6;function lA(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}o(lA,"numeric");function p5e(e){return e.replace(s5e,_G).replace(a5e,AG).replace(o5e,uA).replace(l5e,TG).replace(c5e,IG)}o(p5e,"escapeBraces");function f5e(e){return e.replace(e5e,"\\").replace(t5e,"{").replace(n5e,"}").replace(r5e,",").replace(i5e,".")}o(f5e,"unescapeBraces");function CG(e){if(!e)return[""];let t=[],n=oA("{","}",e);if(!n)return e.split(",");let{pre:r,body:i,post:s}=n,a=r.split(",");a[a.length-1]+="{"+i+"}";let l=CG(s);return s.length&&(a[a.length-1]+=l.shift(),a.push.apply(a,l)),t.push.apply(t,a),t}o(CG,"parseCommaParts");function RG(e,t={}){if(!e)return[];let{max:n=u5e,maxLength:r=d5e}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),cA(p5e(e),n,r,!0).map(f5e)}o(RG,"expand");function h5e(e){return"{"+e+"}"}o(h5e,"embrace");function m5e(e){return/^-?0\d/.test(e)}o(m5e,"isPadded");function g5e(e,t){return e<=t}o(g5e,"lte");function y5e(e,t){return e>=t}o(y5e,"gte");function Jf(e,t,n,r,i,s){let a=[],l=0;for(let c=0;c<e.length;c++)for(let u=0;u<n.length;u++){if(a.length>=r)return a;let d=e[c]+t+n[u];if(!(s&&!d)){if(l+d.length>i)return a;a.push(d),l+=d.length}}return a}o(Jf,"combine");function x5e(e,t,n,r){let i=e.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let a=lA(i[0]),l=lA(i[1]),c=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(lA(i[2])),1):1,d=g5e;l<a&&(u*=-1,d=y5e);let m=i.some(m5e),h=0;for(let g=a;d(g,l)&&s.length<n;g+=u){let y;if(t)y=String.fromCharCode(g),y==="\\"&&(y="");else if(y=String(g),m){let x=c-y.length;if(x>0){let b=new Array(x+1).join("0");g<0?y="-"+b+y.slice(1):y=b+y}}if(h+y.length>r)break;s.push(y),h+=y.length}return s}o(x5e,"expandSequence");function cA(e,t,n,r){let i=[""],s=!1,a=!0;for(;;){let l=oA("{","}",e);if(!l)return Jf(i,e,[""],t,n,s);let c=l.pre;if(/\$$/.test(c)){if(i=Jf(i,c+"{"+l.body+"}",[""],t,n,s&&!l.post.length),a=!1,!l.post.length)break;e=l.post;continue}let u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(l.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(l.body),p=u||d,m=l.body.indexOf(",")>=0;if(!p&&!m){if(l.post.match(/,(?!,).*\}/)){e=l.pre+"{"+l.body+uA+l.post,r=!0;continue}return Jf(i,c+"{"+l.body+"}"+l.post,[""],t,n,s)}a&&(s=r&&!p,a=!1);let h;if(p)h=x5e(l.body,d,t,n);else{let g=CG(l.body);if(g.length===1&&g[0]!==void 0&&(g=cA(g[0],t,n,!1).map(h5e),g.length===1)){if(i=Jf(i,c+g[0],[""],t,n,s&&!l.post.length),!l.post.length)break;e=l.post;continue}let y=s&&!l.post.length&&!c;for(let b=0;y&&b<i.length;b++)i[b]&&(y=!1);h=[];let x=0;e:for(let b=0;b<g.length;b++){let w=cA(g[b],t,n,!1);for(let v=0;v<w.length;v++){let E=w[v];if(!(y&&!E)){if(h.length>=t||x+E.length>n)break e;h.push(E),x+=E.length}}}}if(i=Jf(i,c,h,t,n,s&&!l.post.length),!l.post.length)break;e=l.post}return i}o(cA,"expand_");var Qf=o(e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var b5e={"[: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]},Yf=o(e=>e.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),v5e=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),NG=o(e=>e.join(""),"rangesToString"),OG=o((e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=n+1,a=!1,l=!1,c=!1,u=!1,d=n,p="";e:for(;s<e.length;){let y=e.charAt(s);if((y==="!"||y==="^")&&s===n+1){u=!0,s++;continue}if(y==="]"&&a&&!c){d=s+1;break}if(a=!0,y==="\\"&&!c){c=!0,s++;continue}if(y==="["&&!c){for(let[x,[b,w,v]]of Object.entries(b5e))if(e.startsWith(x,s)){if(p)return["$.",!1,e.length-n,!0];s+=x.length,v?i.push(b):r.push(b),l=l||w;continue e}}if(c=!1,p){y>p?r.push(Yf(p)+"-"+Yf(y)):y===p&&r.push(Yf(y)),p="",s++;continue}if(e.startsWith("-]",s+1)){r.push(Yf(y+"-")),s+=2;continue}if(e.startsWith("-",s+1)){p=y,s+=2;continue}r.push(Yf(y)),s++}if(d<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let y=r[0].length===2?r[0].slice(-1):r[0];return[v5e(y),!1,d-n,!1]}let m="["+(u?"^":"")+NG(r)+"]",h="["+(u?"":"^")+NG(i)+"]";return[r.length&&i.length?"("+m+"|"+h+")":r.length?m:h,l,d-n,!0]},"parseClass");var $o=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape");var ri,w5e=new Set(["!","?","+","*","@"]),dA=o(e=>w5e.has(e),"isExtglobType"),$G=o(e=>dA(e.type),"isExtglobAST"),S5e=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),E5e=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),k5e=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),PG=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),_5e="(?!(?:^|/)\\.\\.?(?:$|/))",ay="(?!\\.)",A5e=new Set(["[","."]),T5e=new Set(["..","."]),I5e=new Set("().*{}+?[]^$\\!"),C5e=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),pA="[^/]",DG=pA+"*?",MG=pA+"+?",R5e=0,sc=class{static{o(this,"AST")}type;#e;#n;#r=!1;#t=[];#i;#s;#o;#d=!1;#l;#a;#c=!1;id=++R5e;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#t.length,parts:this.#t}}constructor(t,n,r={}){this.type=t,t&&(this.#n=!0),this.#i=n,this.#e=this.#i?this.#i.#e:this,this.#l=this.#e===this?r:this.#e.#l,this.#o=this.#e===this?[]:this.#e.#o,t==="!"&&!this.#e.#d&&this.#o.push(this),this.#s=this.#i?this.#i.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let t of this.#t)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#t.map(t=>String(t)).join("|")+")":this.#a=this.#t.map(t=>String(t)).join("")}#k(){if(this!==this.#e)throw new Error("should only call on root");if(this.#d)return this;this.toString(),this.#d=!0;let t;for(;t=this.#o.pop();){if(t.type!=="!")continue;let n=t,r=n.#i;for(;r;){for(let i=n.#s+1;!r.type&&i<r.#t.length;i++)for(let s of t.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}n=r,r=n.#i}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof ri&&n.#i===this))throw new Error("invalid part: "+n);this.#t.push(n)}}toJSON(){let t=this.type===null?this.#t.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#t.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#d&&this.#i?.type==="!")&&t.push({}),t}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#s===0)return!0;let t=this.#i;for(let n=0;n<this.#s;n++){let r=t.#t[n];if(!(r instanceof ri&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let t=this.#i?this.#i.#t.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new ri(this.type,t);for(let r of this.#t)n.copyIn(r);return n}static#m(t,n,r,i,s){let a=i.maxExtglobRecursion??2,l=!1,c=!1,u=-1,d=!1;if(n.type===null){let y=r,x="";for(;y<t.length;){let b=t.charAt(y++);if(l||b==="\\"){l=!l,x+=b;continue}if(c){y===u+1?(b==="^"||b==="!")&&(d=!0):b==="]"&&!(y===u+2&&d)&&(c=!1),x+=b;continue}else if(b==="["){c=!0,u=y,d=!1,x+=b;continue}if(!i.noext&&dA(b)&&t.charAt(y)==="("&&s<=a){n.push(x),x="";let v=new ri(b,n);y=ri.#m(t,v,y,i,s+1),n.push(v);continue}x+=b}return n.push(x),y}let p=r+1,m=new ri(null,n),h=[],g="";for(;p<t.length;){let y=t.charAt(p++);if(l||y==="\\"){l=!l,g+=y;continue}if(c){p===u+1?(y==="^"||y==="!")&&(d=!0):y==="]"&&!(p===u+2&&d)&&(c=!1),g+=y;continue}else if(y==="["){c=!0,u=p,d=!1,g+=y;continue}if(!i.noext&&dA(y)&&t.charAt(p)==="("&&(s<=a||n&&n.#y(y))){let b=n&&n.#y(y)?0:1;m.push(g),g="";let w=new ri(y,m);m.push(w),p=ri.#m(t,w,p,i,s+b);continue}if(y==="|"){m.push(g),g="",h.push(m),m=new ri(null,n);continue}if(y===")")return g===""&&n.#t.length===0&&(n.#c=!0),m.push(g),g="",n.push(...h,m),p;g+=y}return n.type=null,n.#n=void 0,n.#t=[t.substring(r-1)],p}#$(t){return this.#g(t,E5e)}#g(t,n=S5e){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null)return!1;let r=t.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,n)}#y(t,n=k5e){return!!n.get(this.type)?.includes(t)}#p(t,n){let r=t.#t[0],i=new ri(null,r,this.options);i.#t.push(""),r.push(i),this.#_(t,n)}#_(t,n){let r=t.#t[0];this.#t.splice(n,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#i=this);this.#a=void 0}#A(t){return!!PG.get(this.type)?.has(t)}#P(t){if(!t||typeof t!="object"||t.type!==null||t.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let n=t.#t[0];return!n||typeof n!="object"||n.type===null?!1:this.#A(n.type)}#x(t){let n=PG.get(this.type),r=t.#t[0],i=n?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#i=this);this.type=i,this.#a=void 0,this.#c=!1}static fromGlob(t,n={}){let r=new ri(null,void 0,n);return ri.#m(t,r,0,n,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let t=this.toString(),[n,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#l.nocase&&!this.#l.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let l=(this.#l.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,l),{_src:n,_glob:t})}get options(){return this.#l}toRegExpSource(t){let n=t??!!this.#l.dot;if(this.#e===this&&(this.#f(),this.#k()),!$G(this)){let c=this.isStart()&&this.isEnd()&&!this.#t.some(h=>typeof h!="string"),u=this.#t.map(h=>{let[g,y,x,b]=typeof h=="string"?ri.#T(h,this.#n,c):h.toRegExpSource(t);return this.#n=this.#n||x,this.#r=this.#r||b,g}).join(""),d="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&T5e.has(this.#t[0]))){let g=A5e,y=n&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),x=!n&&!t&&g.has(u.charAt(0));d=y?_5e:x?ay:""}let p="";return this.isEnd()&&this.#e.#d&&this.#i?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,$o(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#t=[c],u.type=null,u.#n=void 0,[c,$o(this.toString()),!1,!1]}let a=!r||t||n||!ay?"":this.#b(!0);a===s&&(a=""),a&&(s=`(?:${s})(?:${a})*?`);let l="";if(this.type==="!"&&this.#c)l=(this.isStart()&&!n?ay:"")+MG;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?ay:"")+DG+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;l=i+s+c}return[l,$o(s),this.#n=!!this.#n,this.#r]}#f(){if($G(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#f(),this.#g(i)?(n=!1,this.#_(i,r)):this.#$(i)?(n=!1,this.#p(i,r)):this.#P(i)&&(n=!1,this.#x(i)))}}while(!n&&++t<10)}else for(let t of this.#t)typeof t=="object"&&t.#f();this.#a=void 0}#b(t){return this.#t.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,i,s,a]=n.toRegExpSource(t);return this.#r=this.#r||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#T(t,n,r=!1){let i=!1,s="",a=!1,l=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(i){i=!1,s+=(I5e.has(u)?"\\":"")+u;continue}if(u==="*"){if(l)continue;l=!0,s+=r&&/^[*]+$/.test(t)?MG:DG,n=!0;continue}else l=!1;if(u==="\\"){c===t.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[d,p,m,h]=OG(t,c);if(m){s+=d,a=a||p,c+=m-1,n=n||h;continue}}if(u==="?"){s+=pA,n=!0;continue}s+=C5e(u)}return[s,$o(t),!!n,a]}};ri=sc;var fA=o((e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var fr=o((e,t,n={})=>(Qf(t),!n.nocomment&&t.charAt(0)==="#"?!1:new id(t,n).match(e)),"minimatch"),N5e=/^\*+([^+@!?*[(]*)$/,O5e=o(e=>t=>!t.startsWith(".")&&t.endsWith(e),"starDotExtTest"),$5e=o(e=>t=>t.endsWith(e),"starDotExtTestDot"),P5e=o(e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),"starDotExtTestNocase"),D5e=o(e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),"starDotExtTestNocaseDot"),M5e=/^\*+\.\*+$/,L5e=o(e=>!e.startsWith(".")&&e.includes("."),"starDotStarTest"),j5e=o(e=>e!=="."&&e!==".."&&e.includes("."),"starDotStarTestDot"),F5e=/^\.\*+$/,U5e=o(e=>e!=="."&&e!==".."&&e.startsWith("."),"dotStarTest"),B5e=/^\*+$/,z5e=o(e=>e.length!==0&&!e.startsWith("."),"starTest"),q5e=o(e=>e.length!==0&&e!=="."&&e!=="..","starTestDot"),W5e=/^\?+([^+@!?*[(]*)?$/,H5e=o(([e,t=""])=>{let n=FG([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocase"),G5e=o(([e,t=""])=>{let n=UG([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},"qmarksTestNocaseDot"),V5e=o(([e,t=""])=>{let n=UG([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTestDot"),Z5e=o(([e,t=""])=>{let n=FG([e]);return t?r=>n(r)&&r.endsWith(t):n},"qmarksTest"),FG=o(([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},"qmarksTestNoExt"),UG=o(([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},"qmarksTestNoExtDot"),BG=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",LG={win32:{sep:"\\"},posix:{sep:"/"}},K5e=BG==="win32"?LG.win32.sep:LG.posix.sep;fr.sep=K5e;var $r=Symbol("globstar **");fr.GLOBSTAR=$r;var X5e="[^/]",J5e=X5e+"*?",Q5e="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Y5e="(?:(?!(?:\\/|^)\\.).)*?",e7e=o((e,t={})=>n=>fr(n,e,t),"filter");fr.filter=e7e;var Pi=o((e,t={})=>Object.assign({},e,t),"ext"),t7e=o(e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return fr;let t=fr;return Object.assign(o((r,i,s={})=>t(r,i,Pi(e,s)),"m"),{Minimatch:class extends t.Minimatch{static{o(this,"Minimatch")}constructor(i,s={}){super(i,Pi(e,s))}static defaults(i){return t.defaults(Pi(e,i)).Minimatch}},AST:class extends t.AST{static{o(this,"AST")}constructor(i,s,a={}){super(i,s,Pi(e,a))}static fromGlob(i,s={}){return t.AST.fromGlob(i,Pi(e,s))}},unescape:o((r,i={})=>t.unescape(r,Pi(e,i)),"unescape"),escape:o((r,i={})=>t.escape(r,Pi(e,i)),"escape"),filter:o((r,i={})=>t.filter(r,Pi(e,i)),"filter"),defaults:o(r=>t.defaults(Pi(e,r)),"defaults"),makeRe:o((r,i={})=>t.makeRe(r,Pi(e,i)),"makeRe"),braceExpand:o((r,i={})=>t.braceExpand(r,Pi(e,i)),"braceExpand"),match:o((r,i,s={})=>t.match(r,i,Pi(e,s)),"match"),sep:t.sep,GLOBSTAR:$r})},"defaults");fr.defaults=t7e;var zG=o((e,t={})=>(Qf(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:RG(e,{max:t.braceExpandMax})),"braceExpand");fr.braceExpand=zG;var n7e=o((e,t={})=>new id(e,t).makeRe(),"makeRe");fr.makeRe=n7e;var r7e=o((e,t,n={})=>{let r=new id(t,n);return e=e.filter(i=>r.match(i)),r.options.nonull&&!e.length&&e.push(t),e},"match");fr.match=r7e;var jG=/[?*]|[+@!]\(.*?\)|\[|\]/,i7e=o(e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),id=class{static{o(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){Qf(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||BG,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,a,l)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!jG.test(s[2]))&&!jG.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(d=>this.parse(d))];if(u)return[s[0],...s.slice(1).map(d=>this.parse(d))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let a=this.set[s];a[0]===""&&a[1]===""&&this.globParts[s][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r of t)for(let i=0;i<r.length;i++)r[i]==="**"&&(r[i]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let i=r;for(;n[i+1]==="**";)i++;i!==r&&n.splice(r,i-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){let s=t[i];i===1&&s===""&&t[0]===""||(s==="."||s==="")&&(n=!0,t.splice(i,1),i--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let i=t[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let a=i;for(;r[a+1]==="**";)a++;a>i&&r.splice(i+1,a-i);let l=r[i+1],c=r[i+2],u=r[i+3];if(l!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(i,1);let d=r.slice(0);d[i]="**",t.push(d),i--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let l=r[a];a===1&&l===""&&r[0]===""||(l==="."||l==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let a=r[s-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let i=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(i){t[n]=[],t[r]=i;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let i=0,s=0,a=[],l="";for(;i<t.length&&s<n.length;)if(t[i]===n[s])a.push(l==="b"?n[s]:t[i]),i++,s++;else if(r&&t[i]==="**"&&n[s]===t[i+1])a.push(t[i]),i++;else if(r&&n[s]==="**"&&t[i]===n[s+1])a.push(n[s]),s++;else if(t[i]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(l==="b")return!1;l="a",a.push(t[i]),i++,s++}else if(n[s]==="*"&&t[i]&&(this.options.dot||!t[i].startsWith("."))&&t[i]!=="**"){if(l==="a")return!1;l="b",a.push(n[s]),i++,s++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let i=0;i<t.length&&t.charAt(i)==="!";i++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let i=0,s=0;if(this.isWindows){let l=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!l&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=c?3:l?0:void 0,m=d?3:u?0:void 0;if(typeof p=="number"&&typeof m=="number"){let[h,g]=[t[p],n[m]];h.toLowerCase()===g.toLowerCase()&&(n[m]=h,s=m,i=p)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes($r)?this.#e(t,n,r,i,s):this.#r(t,n,r,i,s)}#e(t,n,r,i,s){let a=n.indexOf($r,s),l=n.lastIndexOf($r),[c,u,d]=r?[n.slice(s,a),n.slice(a+1),[]]:[n.slice(s,a),n.slice(a+1,l),n.slice(l+1)];if(c.length){let w=t.slice(i,i+c.length);if(!this.#r(w,c,r,0,0))return!1;i+=c.length,s+=c.length}let p=0;if(d.length){if(d.length+i>t.length)return!1;let w=t.length-d.length;if(this.#r(t,d,r,w,0))p=d.length;else{if(t[t.length-1]!==""||i+d.length===t.length||(w--,!this.#r(t,d,r,w,0)))return!1;p=d.length+1}}if(!u.length){let w=!!p;for(let v=i;v<t.length-p;v++){let E=String(t[v]);if(w=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return r||w}let m=[[[],0]],h=m[0],g=0,y=[0];for(let w of u)w===$r?(y.push(g),h=[[],0],m.push(h)):(h[0].push(w),g++);let x=m.length-1,b=t.length-p;for(let w of m)w[1]=b-(y[x--]+w[0].length);return!!this.#n(t,m,i,0,r,0,!!p)}#n(t,n,r,i,s,a,l){let c=n[i];if(!c){for(let p=r;p<t.length;p++){l=!0;let m=t[p];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1}return l}let[u,d]=c;for(;r<=d;){if(this.#r(t.slice(0,r+u.length),u,s,r,0)&&a<this.maxGlobstarRecursion){let h=this.#n(t,n,r+u.length,i+1,s,a+1,l);if(h!==!1)return h}let m=t[r];if(m==="."||m===".."||!this.options.dot&&m.startsWith("."))return!1;r++}return s||null}#r(t,n,r,i,s){let a,l,c,u;for(a=i,l=s,u=t.length,c=n.length;a<u&&l<c;a++,l++){this.debug("matchOne loop");let d=n[l],p=t[a];if(this.debug(n,d,p),d===!1||d===$r)return!1;let m;if(typeof d=="string"?(m=p===d,this.debug("string match",d,p,m)):(m=d.test(p),this.debug("pattern match",d,p,m)),!m)return!1}if(a===u&&l===c)return!0;if(a===u)return r;if(l===c)return a===u-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return zG(this.pattern,this.options)}parse(t){Qf(t);let n=this.options;if(t==="**")return $r;if(t==="")return"";let r,i=null;(r=t.match(B5e))?i=n.dot?q5e:z5e:(r=t.match(N5e))?i=(n.nocase?n.dot?D5e:P5e:n.dot?$5e:O5e)(r[1]):(r=t.match(W5e))?i=(n.nocase?n.dot?G5e:H5e:n.dot?V5e:Z5e)(r):(r=t.match(M5e))?i=n.dot?j5e:L5e:(r=t.match(F5e))&&(i=U5e);let s=sc.fromGlob(t,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?J5e:n.dot?Q5e:Y5e,i=new Set(n.nocase?["i"]:[]),s=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let m of p.flags.split(""))i.add(m);return typeof p=="string"?i7e(p):p===$r?$r:p._src});u.forEach((p,m)=>{let h=u[m+1],g=u[m-1];p!==$r||g===$r||(g===void 0?h!==void 0&&h!==$r?u[m+1]="(?:\\/|"+r+"\\/)?"+h:u[m]=r:h===void 0?u[m-1]=g+"(?:\\/|\\/"+r+")?":h!==$r&&(u[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+h,u[m+1]=$r))});let d=u.filter(p=>p!==$r);if(this.partial&&d.length>=1){let p=[];for(let m=1;m<=d.length;m++)p.push(d.slice(0,m).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[a,l]=t.length>1?["(?:",")"]:["",""];s="^"+a+s+l+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+l+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let i=this.slashSplit(t);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let a=i[i.length-1];if(!a)for(let l=i.length-2;!a&&l>=0;l--)a=i[l];for(let l of s){let c=i;if(r.matchBase&&l.length===1&&(c=[a]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return fr.defaults(t).Minimatch}};fr.AST=sc;fr.Minimatch=id;fr.escape=fA;fr.unescape=$o;import{gunzipSync as IAe}from"node:zlib";var eh=class{static{o(this,"Diff")}diff(t,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);let s=this.castInput(t,r),a=this.castInput(n,r),l=this.removeEmpty(this.tokenize(s,r)),c=this.removeEmpty(this.tokenize(a,r));return this.diffWithOptionsObj(l,c,r,i)}diffWithOptionsObj(t,n,r,i){var s;let a=o(w=>{if(w=this.postProcess(w,r),i){setTimeout(function(){i(w)},0);return}else return w},"done"),l=n.length,c=t.length,u=1,d=l+c;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));let p=(s=r.timeout)!==null&&s!==void 0?s:1/0,m=Date.now()+p,h=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(h[0],n,t,0,r);if(h[0].oldPos+1>=c&&g+1>=l)return a(this.buildValues(h[0].lastComponent,n,t));let y=-1/0,x=1/0,b=o(()=>{for(let w=Math.max(y,-u);w<=Math.min(x,u);w+=2){let v,E=h[w-1],S=h[w+1];E&&(h[w-1]=void 0);let _=!1;if(S){let M=S.oldPos-w;_=S&&0<=M&&M<l}let I=E&&E.oldPos+1<c;if(!_&&!I){h[w]=void 0;continue}if(!I||_&&E.oldPos<S.oldPos?v=this.addToPath(S,!0,!1,0,r):v=this.addToPath(E,!1,!0,1,r),g=this.extractCommon(v,n,t,w,r),v.oldPos+1>=c&&g+1>=l)return a(this.buildValues(v.lastComponent,n,t))||!0;h[w]=v,v.oldPos+1>=c&&(x=Math.min(x,w-1)),g+1>=l&&(y=Math.max(y,w+1))}u++},"execEditLength");if(i)o(function w(){setTimeout(function(){if(u>d||Date.now()>m)return i(void 0);b()||w()},0)},"exec")();else for(;u<=d&&Date.now()<=m;){let w=b();if(w)return w}}addToPath(t,n,r,i,s){let a=t.lastComponent;return a&&!s.oneChangePerToken&&a.added===n&&a.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:n,removed:r,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:a}}}extractCommon(t,n,r,i,s){let a=n.length,l=r.length,c=t.oldPos,u=c-i,d=0;for(;u+1<a&&c+1<l&&this.equals(r[c+1],n[u+1],s);)u++,c++,d++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return d&&!s.oneChangePerToken&&(t.lastComponent={count:d,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=c,u}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let i=[],s;for(;t;)i.push(t),s=t.previousComponent,delete t.previousComponent,t=s;i.reverse();let a=i.length,l=0,c=0,u=0;for(;l<a;l++){let d=i[l];if(d.removed)d.value=this.join(r.slice(u,u+d.count)),u+=d.count;else{if(!d.added&&this.useLongestToken){let p=n.slice(c,c+d.count);p=p.map(function(m,h){let g=r[u+h];return g.length>m.length?g:m}),d.value=this.join(p)}else d.value=this.join(n.slice(c,c+d.count));c+=d.count,d.added||(u+=d.count)}}return i}};var hA=class extends eh{static{o(this,"LineDiff")}constructor(){super(...arguments),this.tokenize=a7e}equals(t,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!t.includes(`
3397
3397
  `))&&(t=t.trim()),(!r.newlineIsToken||!n.includes(`
3398
3398
  `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(t.endsWith(`
3399
3399
  `)&&(t=t.slice(0,-1)),n.endsWith(`