werkmeister 0.91.0 → 0.91.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{budget-AH6CFJIP.js → budget-U55QJ6RQ.js} +2 -2
- package/dist/{cache-4Z67QJ73.js → cache-277X2VN7.js} +2 -2
- package/dist/{chunk-NJRFNCYS.js → chunk-26NE2TKQ.js} +2 -2
- package/dist/{chunk-HWJCGLMH.js → chunk-2CNYFUAA.js} +2 -2
- package/dist/{chunk-WFXTRHX2.js → chunk-2OZ3J23R.js} +2 -2
- package/dist/{chunk-7YPA7VJQ.js → chunk-2X6AXXB5.js} +3 -3
- package/dist/{chunk-WPCAHRQF.js → chunk-3SM7OPFC.js} +2 -2
- package/dist/{chunk-5LAKVBXK.js → chunk-46BQCITV.js} +2 -2
- package/dist/{chunk-3BXCMPNT.js → chunk-6NINBBUQ.js} +2 -2
- package/dist/{chunk-F7E6QXJV.js → chunk-BRUQFOAI.js} +2 -2
- package/dist/{chunk-BCFVKR67.js → chunk-BTAUC2FI.js} +2 -2
- package/dist/{chunk-W43BCA3V.js → chunk-CDNW6ZDD.js} +2 -2
- package/dist/{chunk-YSRY4GFI.js → chunk-CKVMBB4O.js} +2 -2
- package/dist/{chunk-RS67Y76B.js → chunk-DHJOVWA4.js} +2 -2
- package/dist/{chunk-QXFF3FTK.js → chunk-EC3BKOYR.js} +2 -2
- package/dist/{chunk-FFKCNRUN.js → chunk-EDQ6YISN.js} +2 -2
- package/dist/{chunk-FMFXF76I.js → chunk-EJIKMENG.js} +2 -2
- package/dist/{chunk-HUKXMFHW.js → chunk-EP4XTUSC.js} +2 -2
- package/dist/{chunk-U3GM2WSU.js → chunk-F7NAUYQY.js} +2 -2
- package/dist/{chunk-7IZXOVO4.js → chunk-FAAX2QYX.js} +2 -2
- package/dist/{chunk-FJ2TYM7L.js → chunk-FIX7P5QJ.js} +2 -2
- package/dist/{chunk-LEX7JGFG.js → chunk-FO3OSGDP.js} +2 -2
- package/dist/{chunk-BJMRSW3U.js → chunk-FU2B23KJ.js} +2 -2
- package/dist/{chunk-GGU75XPS.js → chunk-FYQS5A6E.js} +2 -2
- package/dist/chunk-GJ4YZGEB.js +4 -0
- package/dist/{chunk-UYESNXMS.js → chunk-H7BNP4O4.js} +3 -3
- package/dist/{chunk-OYYD7LS6.js → chunk-HEZZDBJL.js} +2 -2
- package/dist/{chunk-DH4MVYEK.js → chunk-HKYWS6BI.js} +2 -2
- package/dist/{chunk-7H4RTP3H.js → chunk-HXML4LA3.js} +2 -2
- package/dist/{chunk-SO5EJ5QK.js → chunk-INLAFMQV.js} +3 -3
- package/dist/{chunk-F4XGTOHP.js → chunk-IZX4HGHP.js} +2 -2
- package/dist/{chunk-CEDTL7DC.js → chunk-J6MK2HTK.js} +2 -2
- package/dist/{chunk-LBESQTHU.js → chunk-JDLDACTO.js} +8 -8
- package/dist/{chunk-XYBYBXWX.js → chunk-JDTI4XFH.js} +2 -2
- package/dist/{chunk-NJC72QTE.js → chunk-JET6M6FJ.js} +2 -2
- package/dist/{chunk-RJT2NOJY.js → chunk-JWQPWWEN.js} +2 -2
- package/dist/{chunk-2NSHZRMP.js → chunk-LGUAVZVV.js} +2 -2
- package/dist/{chunk-WZARSTL6.js → chunk-MHWK63YA.js} +2 -2
- package/dist/{chunk-VH2ZJ777.js → chunk-MLDID3L3.js} +2 -2
- package/dist/{chunk-MSMCUTHU.js → chunk-MM4H553O.js} +2 -2
- package/dist/{chunk-3LKKRHDW.js → chunk-MQXD4BF7.js} +2 -2
- package/dist/{chunk-BY643VNH.js → chunk-MYYQTERC.js} +2 -2
- package/dist/{chunk-Z6XPYFMK.js → chunk-NGCQLNYL.js} +2 -2
- package/dist/{chunk-AF2X5LK6.js → chunk-NI4SD5KN.js} +2 -2
- package/dist/{chunk-DRKGMFUU.js → chunk-NW56IEMZ.js} +2 -2
- package/dist/{chunk-WUN4UKLJ.js → chunk-O3AIZBOX.js} +2 -2
- package/dist/{chunk-D5K4YE7K.js → chunk-PWV3BTBD.js} +2 -2
- package/dist/{chunk-J7LLXIFD.js → chunk-Q3RQIGZV.js} +2 -2
- package/dist/{chunk-GFFE3SM3.js → chunk-Q4LPPRPK.js} +2 -2
- package/dist/{chunk-HY2HFZ2W.js → chunk-QIP6ITHV.js} +2 -2
- package/dist/{chunk-VXRMWVGY.js → chunk-QPK726UX.js} +2 -2
- package/dist/{chunk-5LHHJX46.js → chunk-R4GF3HDY.js} +2 -2
- package/dist/{chunk-T5NBS5HI.js → chunk-RDY6H5F3.js} +2 -2
- package/dist/{chunk-Z2IIHFSA.js → chunk-T4SXN77U.js} +2 -2
- package/dist/{chunk-4ZFUVHBF.js → chunk-TIYYMZBR.js} +2 -2
- package/dist/{chunk-E37YZI3X.js → chunk-TSEX5HWM.js} +2 -2
- package/dist/{chunk-NTE446SO.js → chunk-U2DV5VKH.js} +2 -2
- package/dist/{chunk-NW2W4JZ3.js → chunk-UHGPFFNJ.js} +3 -3
- package/dist/{chunk-Z4M36MYI.js → chunk-V36JN3L2.js} +2 -2
- package/dist/{chunk-6BHGSAA6.js → chunk-V56745JI.js} +2 -2
- package/dist/{chunk-BEA6MZ6Y.js → chunk-WNCT54BF.js} +2 -2
- package/dist/{chunk-5NJTUKCB.js → chunk-X65MW2WW.js} +2 -2
- package/dist/{chunk-C237CVXE.js → chunk-XKJSMEDK.js} +2 -2
- package/dist/{chunk-NDYJNCRQ.js → chunk-Y2R57EVU.js} +2 -2
- package/dist/{chunk-GTKK3LKS.js → chunk-Z5B5JN3T.js} +2 -2
- package/dist/{chunk-RON372LM.js → chunk-Z5EZBADB.js} +2 -2
- package/dist/{chunk-BTVL6SPA.js → chunk-ZKGQH7TE.js} +2 -2
- package/dist/{chunk-S32UWSU5.js → chunk-ZNPNJ6PV.js} +2 -2
- package/dist/clean-3IKRKL36.js +8 -0
- package/dist/close_out-YIJIEPMM.js +8 -0
- package/dist/code-RIKLE3JZ.js +4 -0
- package/dist/{config-3B7LQP2N.js → config-E4W34GGD.js} +2 -2
- package/dist/{connect-HCYG3NJ7.js → connect-Q4G5BJIU.js} +2 -2
- package/dist/{daemon-IHP5WRNJ.js → daemon-WDAVVUDV.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-5BVFIYEP.js → detect-VWL55GB5.js} +2 -2
- package/dist/{down-S3M6DUVQ.js → down-LN22LX5G.js} +3 -3
- package/dist/{fixture-GSAV775J.js → fixture-XAKYLZA6.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-4AMWNS57.js +4 -0
- package/dist/{hooks_gen-YUHXEAJX.js → hooks_gen-IIBLEWJC.js} +2 -2
- package/dist/infra-O3PETZQO.js +4 -0
- package/dist/init_workspace-EVWQSFKB.js +4 -0
- package/dist/{intercept-XZJQT2BX.js → intercept-FDNNXBUS.js} +2 -2
- package/dist/{issue-QUTDCRBA.js → issue-ULF5DUOO.js} +2 -2
- package/dist/lib/agent_state.js +1 -1
- package/dist/lib/gate.js +1 -1
- package/dist/lib/pr_guard.js +1 -1
- package/dist/list_workspaces-OAKHLTGW.js +7 -0
- package/dist/logs-2IF6GKX7.js +6 -0
- package/dist/main.js +39 -37
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-IYVPJKA4.js → migrate-LTTAMFKZ.js} +2 -2
- package/dist/notes-CWUFFJPM.js +4 -0
- package/dist/{open-ZACT4ASO.js → open-JGBUCTSB.js} +2 -2
- package/dist/{optimize-VLC5NDWL.js → optimize-7MN2UM5F.js} +2 -2
- package/dist/pause-VR4KFRX3.js +4 -0
- package/dist/pr-C5JL663A.js +5 -0
- package/dist/proxy_reload-TS7B7K5W.js +6 -0
- package/dist/{registry-BPYTNZRL.js → registry-L42L4E4M.js} +2 -2
- package/dist/remove-5IYFVTE2.js +7 -0
- package/dist/remove_workspace-QW565D5D.js +8 -0
- package/dist/restart-UHOD6XFM.js +8 -0
- package/dist/resume-6TSQFS4I.js +8 -0
- package/dist/{safari-QQKR4VS5.js → safari-NTMZA4NA.js} +2 -2
- package/dist/{sandbox-RLKFTSZC.js → sandbox-HPZXCIHM.js} +2 -2
- package/dist/{services-ZTOYBCFU.js → services-PZWN25SA.js} +2 -2
- package/dist/{setup-WXXMUIDN.js → setup-XCRDWY2G.js} +2 -2
- package/dist/skills-VXA6S2S3.js +4 -0
- package/dist/{slots-QVKF6YHF.js → slots-7ZI2WWHU.js} +2 -2
- package/dist/{standards-DXP3VO2P.js → standards-YZXIXLNF.js} +2 -2
- package/dist/start_args-Q4NFUBDM.js +4 -0
- package/dist/starting_prompt-ZY6VYVVZ.js +4 -0
- package/dist/stats-WKLRE37U.js +4 -0
- package/dist/{status-TORFUFHN.js → status-ZNJ7IIXZ.js} +2 -2
- package/dist/{stop-JKK27I5M.js → stop-O64ROXRA.js} +2 -2
- package/dist/{telepresence-7TW5NQ6L.js → telepresence-4GSYLVMJ.js} +2 -2
- package/dist/{test-UIL5VHV4.js → test-B26WZAMO.js} +2 -2
- package/dist/{tokens-EQZUMIQN.js → tokens-CSMWT5QF.js} +2 -2
- package/dist/{up-TFRMI33E.js → up-2UM6MBOF.js} +3 -3
- package/dist/{v4-65AMGY3J.js → v4-BO6ZQGAM.js} +2 -2
- package/dist/wait_load-XSZ2QX44.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-TGYO5CGW.js → workspace-UYFKZFUJ.js} +2 -2
- package/package.json +4 -4
- package/dist/chunk-ZJ6HW6TS.js +0 -4
- package/dist/clean-ICDNIE7C.js +0 -8
- package/dist/close_out-7SKM4KLE.js +0 -8
- package/dist/code-4K7JX3W7.js +0 -4
- package/dist/hooks-YOQI5Q77.js +0 -4
- package/dist/infra-KLDVSAUY.js +0 -4
- package/dist/init_workspace-E2LRNEOF.js +0 -4
- package/dist/list_workspaces-MU74HMKL.js +0 -7
- package/dist/logs-ER3Z7X6L.js +0 -6
- package/dist/notes-2RU4VPLB.js +0 -4
- package/dist/pause-RUWK4VPN.js +0 -4
- package/dist/pr-NXC6G2QO.js +0 -5
- package/dist/proxy_reload-EYKYJ5X3.js +0 -6
- package/dist/remove-WCMJYPBV.js +0 -7
- package/dist/remove_workspace-YFMDYF22.js +0 -8
- package/dist/restart-Y6YZCZQR.js +0 -8
- package/dist/resume-7PQ575JW.js +0 -8
- package/dist/skills-HDZUITGO.js +0 -4
- package/dist/start_args-JQPS2CJU.js +0 -4
- package/dist/starting_prompt-BNPFSYW7.js +0 -4
- package/dist/stats-3IHYQAXW.js +0 -4
- package/dist/wait_load-5QCJ7CSQ.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{c as v,k as L}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=budget-
|
|
3
|
+
import{c as v,k as L}from"./chunk-H7BNP4O4.js";import"./chunk-NGCQLNYL.js";import"./chunk-HEZZDBJL.js";import"./chunk-46BQCITV.js";import"./chunk-PWV3BTBD.js";import"./chunk-F7NAUYQY.js";import"./chunk-LGUAVZVV.js";import"./chunk-FIX7P5QJ.js";import"./chunk-WNCT54BF.js";import"./chunk-26NE2TKQ.js";import"./chunk-MLDID3L3.js";import"./chunk-T4SXN77U.js";import"./chunk-CDNW6ZDD.js";import"./chunk-J6MK2HTK.js";import"./chunk-FO3OSGDP.js";import"./chunk-INLAFMQV.js";import"./chunk-FU2B23KJ.js";import"./chunk-JDTI4XFH.js";import{A as h,B as w,H as b,K as y,P as k,v as f,w as $}from"./chunk-JDLDACTO.js";import"./chunk-2CNYFUAA.js";import"./chunk-V36JN3L2.js";import"./chunk-NI4SD5KN.js";import"./chunk-R4GF3HDY.js";import{o as d}from"./chunk-CKVMBB4O.js";import"./chunk-FAAX2QYX.js";import"./chunk-HXML4LA3.js";import"./chunk-O3AIZBOX.js";import"./chunk-ZKGQH7TE.js";import"./chunk-Z5B5JN3T.js";import"./chunk-MM4H553O.js";import"./chunk-RDY6H5F3.js";import"./chunk-TSEX5HWM.js";import{a as c,f as g}from"./chunk-NW56IEMZ.js";g();import N from"node:os";var M=2**30,x=c((r,t)=>Number.isFinite(r)?`${Number(r.toFixed(1))}${t}`:"no limit","limit");async function P(r){let t=await h(),m=w(N.cpus().length),u=$(),l=await k(),n=L(),a=f(y(l,n??[])).map((o,e)=>{let s=u[o.feature]?.workspace,i=s&&d(s)?.services||null,B=s?b(s,i??void 0):null;return{...o,position:e+1,services:i,cost:B}});if(r.json){let o=c(e=>Number.isFinite(e)?e:null,"n");console.log(JSON.stringify({budget:{memory:o(t.memory),cpus:o(t.cpus),preempt:t.preempt},host_load:m,leases:u,waiting:l,running:n?.map(e=>({feature:e.feature,cpus:e.cost.cpus,memory:e.cost.memory,rank:e.rank,busy:e.busy}))??null,waiters:a.map(e=>({feature:e.feature,position:e.position,services:e.services,cpus:e.cost?.cpus??null,memory:e.cost?.memory??null,waited_ms:e.waitedMs,gate:e.gate}))}));return}console.log(`Budget: ${x(t.memory/M," GiB")} memory, ${x(t.cpus," CPUs")}, host load ${m||"unchecked"}, preemption ${t.preempt?"on":"off"}`);let p=Object.entries(u).sort(([,o],[,e])=>o.slot-e.slot);console.log(p.length?"Slots:":"Slots: none held");for(let[o,e]of p)console.log(` ${e.slot} ${o}${e.workspace?` ${e.workspace}`:""}`);console.log(n?n.length?"Running:":"Running: none":"Running: docker unavailable");for(let o of[...n??[]].sort((e,s)=>s.cost.cpus-e.cost.cpus))console.log(` ${v(o)}`);console.log(a.length?"Waiting:":"Waiting: none");for(let o of a){let e=o.services?`${o.services.join(", ")}${o.gate?" for a running feature":""}`:"whole feature",s=o.cost?` (${Number(o.cost.cpus.toFixed(1))} CPUs, ${(o.cost.memory/M).toFixed(1)} GiB)`:"",i=o.waitedMs?` waited ${Math.round(o.waitedMs/6e4)} min${o.position===1&&o.waitedMs>=3e5?", gets the next free room":""}`:"";console.log(` ${o.position}. ${o.feature} ${e}${s}${i}`)}}c(P,"run");export{P as run};
|
|
4
|
+
//# sourceMappingURL=budget-U55QJ6RQ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import"./chunk-
|
|
4
|
-
//# sourceMappingURL=cache-
|
|
3
|
+
import"./chunk-GJ4YZGEB.js";import{c as s}from"./chunk-F7NAUYQY.js";import"./chunk-FO3OSGDP.js";import"./chunk-2CNYFUAA.js";import"./chunk-NI4SD5KN.js";import"./chunk-MM4H553O.js";import{h as e,l as c}from"./chunk-RDY6H5F3.js";import"./chunk-TSEX5HWM.js";import{a as r,f as i}from"./chunk-NW56IEMZ.js";i();async function u(o){o.action!=="prune"&&(c(`Unknown action \`${String(o.action)}\` \u2014 the only action is \`prune\`.`),process.exit(2));let t=await s({name:typeof o.name=="string"?o.name:void 0,reset:!!o.reset,force:!!o.force,dryRun:!!o.dry_run});t.length||console.log("No caches in the registry.");for(let n of t){let a=n.ok?`${e.GREEN}\u2713${e.RESET}`:`${e.RED}\u2717${e.RESET}`;console.log(`${a} ${n.name} (${n.action}): ${n.detail}`)}t.some(n=>!n.ok)&&process.exit(1)}r(u,"run");export{u as run};
|
|
4
|
+
//# sourceMappingURL=cache-277X2VN7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{h as Ze}from"./chunk-
|
|
3
|
+
import{h as Ze}from"./chunk-MLDID3L3.js";import{b as ne}from"./chunk-CDNW6ZDD.js";import{h as te}from"./chunk-J6MK2HTK.js";import{c as Xe,e as Ye,f as Ve,g as Qe,i as ze}from"./chunk-FO3OSGDP.js";import{C as oe,D as se,F as et,G as re,Z as tt,b as T,c as F,ca as ie,d as We,e as Je,f as Ke,g as qe,i as I}from"./chunk-INLAFMQV.js";import{a as Re,b as U,e as Ue,h as Fe,j as Le,k as g}from"./chunk-NI4SD5KN.js";import{c as Ge,e as He}from"./chunk-CKVMBB4O.js";import{b as R,c as je}from"./chunk-O3AIZBOX.js";import{b as Be,c as k}from"./chunk-MM4H553O.js";import{G as Ie,M as Pe,R as De,S as Me,j as be,k as $e,l as C,t as Ne}from"./chunk-RDY6H5F3.js";import{b as Te}from"./chunk-TSEX5HWM.js";import{a as r,f as u}from"./chunk-NW56IEMZ.js";u();import*as m from"node:fs";import*as f from"node:path";u();var Jt=["mcp__plugin_werkmeister_werkmeister__"],ae=r(e=>Jt.map(t=>`${t}${e}`),"pluginTool"),Gt=["werkmeister","w9r"],A=r(e=>Gt.map(t=>`Bash(${t} ${e})`),"cli"),L=["Bash(git -c:*)","Bash(git config:*)",...["--config","--exec-path","--template"].flatMap(e=>[`Bash(git ${e}*)`,`Bash(git * ${e}*)`]),"Bash(git --git-dir*)","Bash(node:*)","Bash(python3:*)",...["proxy-reload","down","remove","remove-workspace","clean","setup","registry","connect","intercept","notes graduate","up infra","restart infra","stop infra","infra proxy-reload","feature down","infra down","feature drop","machine clean","machine setup","infra connect","infra intercept","workspace new","ws new","infra up","infra restart","infra stop","daemon install","daemon uninstall","daemon restart"].flatMap(e=>A(`${e}:*`)),...["stop","kill","rm","rmi","compose down","system prune","volume rm","network rm"].map(e=>`Bash(docker ${e}:*)`),...["npm","pnpm"].flatMap(e=>["publish","link","unlink","install -g","install --global","i -g","i --global","uninstall -g","uninstall --global"].map(t=>`Bash(${e} ${t}:*)`)),...["add -g","add --global","remove -g","remove --global"].map(e=>`Bash(pnpm ${e}:*)`),"Bash(gh pr merge:*)",...["kube-switch","up","stop","restart","down","create-workspace","create-workspace-form","pr-approve","ask-pr-review","claude-send","claude-resume","connect","proxy-reload","remove-service","intercept"].flatMap(ae)];u();import*as O from"node:fs";import*as J from"node:path";u();var W={id:"mcp",instructionsFile:"AGENTS.md",skillsDir:".agents/skills",hooks:{available:!1,reason:"a generic MCP harness has no hooks adapter; use harness: codex for Codex"},agents:!1,notice:r(()=>`
|
|
4
4
|
## Harness
|
|
5
5
|
|
|
6
6
|
This workspace was generated for the \`mcp\` harness. Werkmeister's tools come from the MCP server \`werkmeister\` at ${je()}/mcp (how to register it: docs/harnesses.md in the werkmeister repo). Hooks are unavailable on this harness: werkmeister's session-start context, standards gate, PR guard and agent state do not run here (Codex: use \`harness: codex\`). Open PRs only with \`werkmeister pr open\`.
|
|
@@ -143,4 +143,4 @@ export default {
|
|
|
143
143
|
`);return}m.rmSync(e,{force:!0});try{m.rmdirSync(f.dirname(e))}catch{}}r(Q,"_saveSettings");function z(e,t){let n=j(e),o=Oe(n);if(o===null)return n;"hooks"in o||(o.hooks={});let s=o.hooks;if(typeof s!="object"||s===null||Array.isArray(s))return n;for(let[a,i,c]of t)if(!jn(s,a,i,c))return n;return Q(n,o),n}r(z,"_writeManaged");function er(e){return z(e,[["SessionStart",In(),q],["PreToolUse",Pn(B(e)),X],["PreToolUse",jt(),Y]])}r(er,"writeWorkspaceHooks");function Dt(e){let t=B(e);return z(e,(t?bn:Tn).map(n=>[n,Mn(t),V]))}r(Dt,"writeAgentStateHooks");function tr(e){return z(e,[["PreToolUse",jt(),Y]])}r(tr,"writePrGuardHook");function nr(e){return Ut(e,[["SessionStart",q],["PreToolUse",X]])}r(nr,"removeWorkspaceHooks");function Mt(e,t){return t?z(e,[["SessionEnd",Dn(B(e)),K]]):(Ut(e,[["SessionEnd",K]]),j(e))}r(Mt,"writeAutoStopHook");function Ut(e,t){let n=j(e),o;try{o=JSON.parse(m.readFileSync(n,"utf8"))}catch{return[]}let s=o?.hooks;if(typeof s!="object"||s===null||Array.isArray(s))return[];let a=[];for(let[i,c]of t){let l=s[i];if(!Array.isArray(l))continue;let d=l.filter(h=>!Rt(h,c));for(let h of l)d.includes(h)||a.push(...h.hooks.map(p=>String(p.command)));d.length?s[i]=d:delete s[i]}return a.length?(Object.keys(s).length||delete o.hooks,Q(n,o),a):[]}r(Ut,"_removeManaged");var Rn=["Bash(git diff:*)","Bash(git status:*)","Bash(git ls-files:*)"],Bt=["Bash(git:*)",...["pr view","pr checks","pr diff","pr list","issue view","run view","run list"].map(e=>`Bash(gh ${e}:*)`),...["up","restart","feature up","feature restart"].flatMap(A),...A("feature up --service:*"),...["status","feature status","infra status","pr","issue view","issue start","init-workspace","workspace init","skills","standards","notes context"].flatMap(e=>A(`${e}:*`)),"Bash(docker ps:*)","Bash(claude plugin validate:*)","Bash(claude plugin test:*)",...["issue","issue-statuses","status","workspace-prs","kube-context","k8s-forwards-status"].flatMap(ae)];function Un(e,t){return e?[...Bt,...["up","restart","feature up","feature restart"].flatMap(n=>A(`${n} ${e}`)),...A(`feature up ${e} --service:*`),...["logs","test","services","feature logs","feature test","feature services"].flatMap(n=>A(`${n} ${e}:*`)),...t.flatMap(n=>[`Bash(docker logs ${e}-${n}:*)`,`Bash(docker restart ${e}-${n})`])]:Bt}r(Un,"autonomousRules");var Ft=r(e=>f.join(Te(e),"claude-permissions.json"),"permissionsRecord");function Fn(e,t,n,o,s="",a=[],i=[],c={}){let l=[],d=r(p=>p.split(/\s*&&\s*/).filter(Boolean),"segments");for(let p of[...t,...i]){let S=Xe(p,n[p],o);if(!S||(t.includes(p)&&(l.push(`Bash(${Ye(e,p,S)})`),Ve(S)&&l.push(...d(S).map(y=>`Bash(${y}:*)`))),!s))continue;let w=c[String(n[p]?.repo??"")]?.lint,_=Qe(s,S,w);l.push(_.startsWith(`${s} sh -c '`)?`Bash(${_})`:`Bash(${_}:*)`)}if(s)for(let p of a)l.push(`Bash(${s} ${p}:*)`);s&&a.length&&l.push(`Bash(${f.join(f.dirname(s),"with-fixture-workspace")}:*)`);let h=`Bash(${s} `;return s&&l.push(...l.filter(p=>p.startsWith(h)).map(p=>`${h}--no-wait ${p.slice(h.length)}`)),[...new Set([...l,...Rn])]}r(Fn,"buildAllowRules");function Ln(e){let t;try{t=m.readFileSync(f.join(e,".env"),"utf8")}catch{return{}}let n={};for(let o of t.split(`
|
|
144
144
|
`)){let s=o.indexOf("=");s>0&&(n[o.slice(0,s).trim()]=o.slice(s+1).trim())}return n}r(Ln,"_readEnv");function Wn(e,t=oe(e)){let n=Ln(e),o=n.FEATURE??"",s=(n.SERVICES??"").split(",").map(y=>y.trim()).filter(Boolean),a=ne(e),i=Lt(e),c=te(e).map(y=>f.basename(y)),l=[],d={};try{(c.length||s.length)&&(d=De(),l=ze(c,d))}catch{}let h=l.filter(y=>!s.includes(y)),p=s.length>0||h.length>0,S=Fn(p?o:"",s,p?Pe():{},p?Me():{},a,i,h,d);if(!t)return S;let w=Ie(),_=c.flatMap(y=>Ze(v=>m.existsSync(f.join(w,y,v))).map(v=>`Bash(${v})`));return[...new Set([...S,...Un(o,s),..._])]}r(Wn,"workspaceAllowRules");function Lt(e){return te(e).map(t=>f.join(t,"apps","cli","werkmeister")).filter(t=>m.existsSync(t))}r(Lt,"builtCliWrappers");function Jn(e){let t=ne(e),n=[`Bash(${t} env WERKMEISTER_ROOT=* node --test:*)`,`Bash(${t} --no-wait env WERKMEISTER_ROOT=* node --test:*)`,`Bash(${t} node --test*)`,`Bash(${t} --no-wait node --test*)`,`Bash(docker exec * ${t} node --test*)`,`Bash(docker exec * ${t} --no-wait node --test*)`],o=Lt(e);if(!o.length)return n;let s=f.join(f.dirname(t),"with-fixture-workspace");return[`Bash(${s} --exec-runs:*)`,`Bash(${s} --no-wait --exec-runs:*)`,...o.flatMap(a=>[`Bash(${t} ${a} internal fixture --exec-runs:*)`,`Bash(${t} --no-wait ${a} internal fixture --exec-runs:*)`]),...n]}r(Jn,"workspaceAskRules");function Gn(e,t=oe(e)){return t?L:[]}r(Gn,"workspaceDenyRules");var _e=r(e=>Array.isArray(e)?e.filter(t=>typeof t=="string"):[],"_strings");function ve(e){try{let t=JSON.parse(m.readFileSync(e,"utf8"));return Ae(t)?{allow:_e(t.allow),deny:_e(t.deny),ask:_e(t.ask),model:typeof t.model=="string"?t.model:null}:{allow:[],deny:[],ask:[],model:null}}catch{return{allow:[],deny:[],ask:[],model:null}}}r(ve,"_readRecord");function Ee(e,t){let n={...t.allow.length?{allow:t.allow}:{},...t.deny.length?{deny:t.deny}:{},...t.ask.length?{ask:t.ask}:{},...t.model?{model:t.model}:{}},o=ve(e);JSON.stringify(t)!==JSON.stringify(o)&&(Object.keys(n).length?(m.mkdirSync(f.dirname(e),{recursive:!0}),m.writeFileSync(e,`${JSON.stringify(n,null,2)}
|
|
145
145
|
`)):m.rmSync(e,{force:!0}))}r(Ee,"_writeRecord");function Wt(e,t,n=[],o=[]){let s=j(e),a=Oe(s);if(a===null)return s;let i=a.permissions??{};if(!Ae(i))return s;let c={allow:t,deny:n,ask:o},l=["allow","deny","ask"];if(l.some(w=>!Array.isArray(i[w]??[])))return s;let d=Ft(e),h=ve(d),p={...h},S=!1;for(let w of l){let _=i[w]??[],y=new Set(h[w]),v=[...new Set(c[w])],Z=_.filter(E=>!(typeof E=="string"&&y.has(E)&&!v.includes(E))),ee=v.filter(E=>!Z.includes(E));if(p[w]=v.filter(E=>y.has(E)||ee.includes(E)),Z.length===_.length&&!ee.length)continue;S=!0;let Ce=[...Z,...ee];Ce.length?i[w]=Ce:delete i[w]}return S&&(Object.keys(i).length?a.permissions=i:delete a.permissions,Q(s,a)),Ee(d,p),s}r(Wt,"writeWorkspacePermissions");function or(e){return Wt(e,[],[],[])}r(or,"removeWorkspacePermissions");function Hn(e,t){let n=j(e),o=Oe(n);if(o===null)return n;let s=Ft(e),a=ve(s),i=o.model;return i!==void 0&&i!==a.model?(Ee(s,{...a,model:null}),n):(i!==(t??void 0)&&(t?o.model=t:delete o.model,Q(n,o)),Ee(s,{...a,model:t}),n)}r(Hn,"writeWorkspaceModel");function sr(e){if(B(e)){Mt(e,se(e)),Dt(e),st(e),be(`codex: trust this folder in Codex, approve its hooks with /hooks, and start it as \`${P}\` (docs/harnesses.md \xA7 Codex)`);return}Wt(e,Wn(e),Gn(e),Jn(e)),Hn(e,et(e)),Mt(e,se(e)),Dt(e)}r(sr,"writeWorkspaceSettings");export{L as a,P as b,Pt as c,ke as d,gn as e,Us as f,Fs as g,_n as h,En as i,An as j,On as k,vn as l,Cn as m,Tn as n,bn as o,In as p,Pn as q,jt as r,Dn as s,Mn as t,er as u,Dt as v,tr as w,nr as x,Mt as y,Rn as z,Bt as A,Un as B,Fn as C,Wn as D,Jn as E,Gn as F,Wt as G,or as H,Hn as I,sr as J};
|
|
146
|
-
//# sourceMappingURL=chunk-
|
|
146
|
+
//# sourceMappingURL=chunk-26NE2TKQ.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{l as cr,m as hr}from"./chunk-AF2X5LK6.js";import{b as or,c as ar,d as sr,e as ur,f as fr,g as lr}from"./chunk-T5NBS5HI.js";import{a as i,b as L,c as S,e as Pi,f as c}from"./chunk-DRKGMFUU.js";var mr=S((Gs,vr)=>{"use strict";c();var C=L("fs"),re=L("path"),ki=C.lchown?"lchown":"chown",Ni=C.lchownSync?"lchownSync":"chownSync",pr=C.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),dr=i((e,t,r)=>{try{return C[Ni](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"lchownSync"),Mi=i((e,t,r)=>{try{return C.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"chownSync"),Ai=pr?(e,t,r,n)=>o=>{!o||o.code!=="EISDIR"?n(o):C.chown(e,t,r,n)}:(e,t,r,n)=>n,ht=pr?(e,t,r)=>{try{return dr(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;Mi(e,t,r)}}:(e,t,r)=>dr(e,t,r),Di=process.version,yr=i((e,t,r)=>C.readdir(e,t,r),"readdir"),qi=i((e,t)=>C.readdirSync(e,t),"readdirSync");/^v4\./.test(Di)&&(yr=i((e,t,r)=>C.readdir(e,r),"readdir"));var Be=i((e,t,r,n)=>{C[ki](e,t,r,Ai(e,t,r,o=>{n(o&&o.code!=="ENOENT"?o:null)}))},"chown"),gr=i((e,t,r,n,o)=>{if(typeof t=="string")return C.lstat(re.resolve(e,t),(a,s)=>{if(a)return o(a.code!=="ENOENT"?a:null);s.name=t,gr(e,s,r,n,o)});if(t.isDirectory())dt(re.resolve(e,t.name),r,n,a=>{if(a)return o(a);let s=re.resolve(e,t.name);Be(s,r,n,o)});else{let a=re.resolve(e,t.name);Be(a,r,n,o)}},"chownrKid"),dt=i((e,t,r,n)=>{yr(e,{withFileTypes:!0},(o,a)=>{if(o){if(o.code==="ENOENT")return n();if(o.code!=="ENOTDIR"&&o.code!=="ENOTSUP")return n(o)}if(o||!a.length)return Be(e,t,r,n);let s=a.length,u=null,f=i(l=>{if(!u){if(l)return n(u=l);if(--s===0)return Be(e,t,r,n)}},"then");a.forEach(l=>gr(e,l,t,r,f))})},"chownr"),Ii=i((e,t,r,n)=>{if(typeof t=="string")try{let o=C.lstatSync(re.resolve(e,t));o.name=t,t=o}catch(o){if(o.code==="ENOENT")return;throw o}t.isDirectory()&&_r(re.resolve(e,t.name),r,n),ht(re.resolve(e,t.name),r,n)},"chownrKidSync"),_r=i((e,t,r)=>{let n;try{n=qi(e,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return ht(e,t,r);throw o}return n&&n.length&&n.forEach(o=>Ii(e,o,t,r)),ht(e,t,r)},"chownrSync");vr.exports=dt;dt.sync=_r});var pt=S((Ys,wr)=>{c();wr.exports=L("stream")});var Or=S((Js,Tr)=>{"use strict";c();function br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(br,"ownKeys");function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?br(Object(r),!0).forEach(function(n){Ci(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(Er,"_objectSpread");function Ci(e,t,r){return t=Rr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(Ci,"_defineProperty");function ji(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i(ji,"_classCallCheck");function Sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rr(n.key),n)}}i(Sr,"_defineProperties");function Bi(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}i(Bi,"_createClass");function Rr(e){var t=Fi(e,"string");return typeof t=="symbol"?t:String(t)}i(Rr,"_toPropertyKey");function Fi(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Fi,"_toPrimitive");var Ui=L("buffer"),Fe=Ui.Buffer,Wi=L("util"),yt=Wi.inspect,Hi=yt&&yt.custom||"inspect";function $i(e,t,r){Fe.prototype.copy.call(e,t,r)}i($i,"copyBuffer");Tr.exports=function(){function e(){ji(this,e),this.head=null,this.tail=null,this.length=0}return i(e,"BufferList"),Bi(e,[{key:"push",value:i(function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},"push")},{key:"unshift",value:i(function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},"unshift")},{key:"shift",value:i(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:i(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:i(function(r){if(this.length===0)return"";for(var n=this.head,o=""+n.data;n=n.next;)o+=r+n.data;return o},"join")},{key:"concat",value:i(function(r){if(this.length===0)return Fe.alloc(0);for(var n=Fe.allocUnsafe(r>>>0),o=this.head,a=0;o;)$i(o.data,n,a),a+=o.data.length,o=o.next;return n},"concat")},{key:"consume",value:i(function(r,n){var o;return r<this.head.data.length?(o=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?o=this.shift():o=n?this._getString(r):this._getBuffer(r),o},"consume")},{key:"first",value:i(function(){return this.head.data},"first")},{key:"_getString",value:i(function(r){var n=this.head,o=1,a=n.data;for(r-=a.length;n=n.next;){var s=n.data,u=r>s.length?s.length:r;if(u===s.length?a+=s:a+=s.slice(0,r),r-=u,r===0){u===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++o}return this.length-=o,a},"_getString")},{key:"_getBuffer",value:i(function(r){var n=Fe.allocUnsafe(r),o=this.head,a=1;for(o.data.copy(n),r-=o.data.length;o=o.next;){var s=o.data,u=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,u),r-=u,r===0){u===s.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=s.slice(u));break}++a}return this.length-=a,n},"_getBuffer")},{key:Hi,value:i(function(r,n){return yt(this,Er(Er({},n),{},{depth:0,customInspect:!1}))},"value")}]),e}()});var _t=S((eu,Lr)=>{"use strict";c();function zi(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(gt,this,e)):process.nextTick(gt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(Ue,r):(r._writableState.errorEmitted=!0,process.nextTick(xr,r,a)):process.nextTick(xr,r,a):t?(process.nextTick(Ue,r),t(a)):process.nextTick(Ue,r)}),this)}i(zi,"destroy");function xr(e,t){gt(e,t),Ue(e)}i(xr,"emitErrorAndCloseNT");function Ue(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}i(Ue,"emitCloseNT");function Gi(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}i(Gi,"undestroy");function gt(e,t){e.emit("error",t)}i(gt,"emitErrorNT");function Vi(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}i(Vi,"errorOrDestroy");Lr.exports={destroy:zi,undestroy:Gi,errorOrDestroy:Vi}});var K=S((nu,Nr)=>{"use strict";c();var kr={};function j(e,t,r){r||(r=Error);function n(a,s,u){return typeof t=="string"?t:t(a,s,u)}i(n,"getMessage");class o extends r{static{i(this,"NodeError")}constructor(s,u,f){super(n(s,u,f))}}o.prototype.name=r.name,o.prototype.code=e,kr[e]=o}i(j,"createErrorType");function Pr(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}i(Pr,"oneOf");function Ki(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}i(Ki,"startsWith");function Yi(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}i(Yi,"endsWith");function Xi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}i(Xi,"includes");j("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);j("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Ki(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o;if(Yi(e," argument"))o=`The ${e} ${n} ${Pr(t,"type")}`;else{let a=Xi(e,".")?"property":"argument";o=`The "${e}" ${a} ${n} ${Pr(t,"type")}`}return o+=`. Received type ${typeof r}`,o},TypeError);j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");j("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});j("ERR_STREAM_PREMATURE_CLOSE","Premature close");j("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});j("ERR_MULTIPLE_CALLBACK","Callback called multiple times");j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");j("ERR_STREAM_WRITE_AFTER_END","write after end");j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);j("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Nr.exports.codes=kr});var vt=S((au,Mr)=>{"use strict";c();var Ji=K().codes.ERR_INVALID_OPT_VALUE;function Zi(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}i(Zi,"highWaterMarkFrom");function Qi(e,t,r,n){var o=Zi(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=n?r:"highWaterMark";throw new Ji(a,o)}return Math.floor(o)}return e.objectMode?16:16*1024}i(Qi,"getHighWaterMark");Mr.exports={getHighWaterMark:Qi}});var Ar=S((fu,mt)=>{c();typeof Object.create=="function"?mt.exports=i(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):mt.exports=i(function(t,r){if(r){t.super_=r;var n=i(function(){},"TempCtor");n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}},"inherits")});var Y=S((hu,bt)=>{c();try{if(wt=L("util"),typeof wt.inherits!="function")throw"";bt.exports=wt.inherits}catch{bt.exports=Ar()}var wt});var qr=S((pu,Dr)=>{c();Dr.exports=L("util").deprecate});var Rt=S((gu,Ur)=>{"use strict";c();Ur.exports=k;function Cr(e){var t=this;this.next=null,this.entry=null,this.finish=function(){xo(t,e)}}i(Cr,"CorkedRequest");var le;k.WritableState=Ee;var eo={deprecate:qr()},jr=pt(),He=L("buffer").Buffer,to=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ro(e){return He.from(e)}i(ro,"_uint8ArrayToBuffer");function no(e){return He.isBuffer(e)||e instanceof to}i(no,"_isUint8Array");var St=_t(),io=vt(),oo=io.getHighWaterMark,X=K().codes,ao=X.ERR_INVALID_ARG_TYPE,so=X.ERR_METHOD_NOT_IMPLEMENTED,uo=X.ERR_MULTIPLE_CALLBACK,fo=X.ERR_STREAM_CANNOT_PIPE,lo=X.ERR_STREAM_DESTROYED,co=X.ERR_STREAM_NULL_VALUES,ho=X.ERR_STREAM_WRITE_AFTER_END,po=X.ERR_UNKNOWN_ENCODING,ce=St.errorOrDestroy;Y()(k,jr);function yo(){}i(yo,"nop");function Ee(e,t,r){le=le||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof le),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=oo(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Eo(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Cr(this)}i(Ee,"WritableState");Ee.prototype.getBuffer=i(function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},"getBuffer");(function(){try{Object.defineProperty(Ee.prototype,"buffer",{get:eo.deprecate(i(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var We;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(We=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:i(function(t){return We.call(this,t)?!0:this!==k?!1:t&&t._writableState instanceof Ee},"value")})):We=i(function(t){return t instanceof this},"realHasInstance");function k(e){le=le||ne();var t=this instanceof le;if(!t&&!We.call(k,this))return new k(e);this._writableState=new Ee(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),jr.call(this)}i(k,"Writable");k.prototype.pipe=function(){ce(this,new fo)};function go(e,t){var r=new ho;ce(e,r),process.nextTick(t,r)}i(go,"writeAfterEnd");function _o(e,t,r,n){var o;return r===null?o=new co:typeof r!="string"&&!t.objectMode&&(o=new ao("chunk",["string","Buffer"],r)),o?(ce(e,o),process.nextTick(n,o),!1):!0}i(_o,"validChunk");k.prototype.write=function(e,t,r){var n=this._writableState,o=!1,a=!n.objectMode&&no(e);return a&&!He.isBuffer(e)&&(e=ro(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=yo),n.ending?go(this,r):(a||_o(this,n,e,r))&&(n.pendingcb++,o=mo(this,n,a,e,t,r)),o};k.prototype.cork=function(){this._writableState.corked++};k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&Br(this,e))};k.prototype.setDefaultEncoding=i(function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new po(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function vo(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=He.from(t,r)),t}i(vo,"decodeChunk");Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});function mo(e,t,r,n,o,a){if(!r){var s=vo(t,n,o);n!==s&&(r=!0,o="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Et(e,t,!1,u,n,o,a);return f}i(mo,"writeOrBuffer");function Et(e,t,r,n,o,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lo("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}i(Et,"doWrite");function wo(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(be,e,t),e._writableState.errorEmitted=!0,ce(e,n)):(o(n),e._writableState.errorEmitted=!0,ce(e,n),be(e,t))}i(wo,"onwriteError");function bo(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}i(bo,"onwriteStateUpdate");function Eo(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(typeof o!="function")throw new uo;if(bo(r),t)wo(e,r,n,t,o);else{var a=Fr(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Br(e,r),n?process.nextTick(Ir,e,r,a,o):Ir(e,r,a,o)}}i(Eo,"onwrite");function Ir(e,t,r,n){r||So(e,t),t.pendingcb--,n(),be(e,t)}i(Ir,"afterWrite");function So(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}i(So,"onwriteDrain");function Br(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,Et(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Cr(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,l=r.encoding,g=r.callback,d=t.objectMode?1:f.length;if(Et(e,t,!1,d,f,l,g),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}i(Br,"clearBuffer");k.prototype._write=function(e,t,r){r(new so("_write()"))};k.prototype._writev=null;k.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Oo(this,n,r),this};Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Fr(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}i(Fr,"needFinish");function Ro(e,t){e._final(function(r){t.pendingcb--,r&&ce(e,r),t.prefinished=!0,e.emit("prefinish"),be(e,t)})}i(Ro,"callFinal");function To(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(Ro,e,t)):(t.prefinished=!0,e.emit("prefinish")))}i(To,"prefinish");function be(e,t){var r=Fr(t);if(r&&(To(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}i(be,"finishMaybe");function Oo(e,t,r){t.ending=!0,be(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}i(Oo,"endWritable");function xo(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}i(xo,"onCorkedFinish");Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:i(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")});k.prototype.destroy=St.destroy;k.prototype._undestroy=St.undestroy;k.prototype._destroy=function(e,t){t(e)}});var ne=S((mu,Hr)=>{"use strict";c();var Lo=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Hr.exports=U;var Wr=xt(),Ot=Rt();Y()(U,Wr);for(Tt=Lo(Ot.prototype),$e=0;$e<Tt.length;$e++)ze=Tt[$e],U.prototype[ze]||(U.prototype[ze]=Ot.prototype[ze]);var Tt,ze,$e;function U(e){if(!(this instanceof U))return new U(e);Wr.call(this,e),Ot.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Po)))}i(U,"Duplex");Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Po(){this._writableState.ended||process.nextTick(ko,this)}i(Po,"onend");function ko(e){e.end()}i(ko,"onEndNT");Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:i(function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")})});var Gr=S((Lt,zr)=>{c();var Ge=L("buffer"),W=Ge.Buffer;function $r(e,t){for(var r in e)t[r]=e[r]}i($r,"copyProps");W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow?zr.exports=Ge:($r(Ge,Lt),Lt.Buffer=ie);function ie(e,t,r){return W(e,t,r)}i(ie,"SafeBuffer");ie.prototype=Object.create(W.prototype);$r(W,ie);ie.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return W(e,t,r)};ie.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=W(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};ie.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return W(e)};ie.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ge.SlowBuffer(e)}});var Nt=S(Kr=>{"use strict";c();var kt=Gr().Buffer,Vr=kt.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function No(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}i(No,"_normalizeEncoding");function Mo(e){var t=No(e);if(typeof t!="string"&&(kt.isEncoding===Vr||!Vr(e)))throw new Error("Unknown encoding: "+e);return t||e}i(Mo,"normalizeEncoding");Kr.StringDecoder=Se;function Se(e){this.encoding=Mo(e);var t;switch(this.encoding){case"utf16le":this.text=jo,this.end=Bo,t=4;break;case"utf8":this.fillLast=qo,t=4;break;case"base64":this.text=Fo,this.end=Uo,t=3;break;default:this.write=Wo,this.end=Ho;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=kt.allocUnsafe(t)}i(Se,"StringDecoder");Se.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Se.prototype.end=Co;Se.prototype.text=Io;Se.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Pt(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}i(Pt,"utf8CheckByte");function Ao(e,t,r){var n=t.length-1;if(n<r)return 0;var o=Pt(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}i(Ao,"utf8CheckIncomplete");function Do(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}i(Do,"utf8CheckExtraBytes");function qo(e){var t=this.lastTotal-this.lastNeed,r=Do(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}i(qo,"utf8FillLast");function Io(e,t){var r=Ao(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}i(Io,"utf8Text");function Co(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}i(Co,"utf8End");function jo(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}i(jo,"utf16Text");function Bo(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}i(Bo,"utf16End");function Fo(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}i(Fo,"base64Text");function Uo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}i(Uo,"base64End");function Wo(e){return e.toString(this.encoding)}i(Wo,"simpleWrite");function Ho(e){return e&&e.length?this.write(e):""}i(Ho,"simpleEnd")});var Ve=S((xu,Jr)=>{"use strict";c();var Yr=K().codes.ERR_STREAM_PREMATURE_CLOSE;function $o(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}i($o,"once");function zo(){}i(zo,"noop");function Go(e){return e.setHeader&&typeof e.abort=="function"}i(Go,"isRequest");function Xr(e,t,r){if(typeof t=="function")return Xr(e,null,t);t||(t={}),r=$o(r||zo);var n=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,a=i(function(){e.writable||u()},"onlegacyfinish"),s=e._writableState&&e._writableState.finished,u=i(function(){o=!1,s=!0,n||r.call(e)},"onfinish"),f=e._readableState&&e._readableState.endEmitted,l=i(function(){n=!1,f=!0,o||r.call(e)},"onend"),g=i(function(w){r.call(e,w)},"onerror"),d=i(function(){var w;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(w=new Yr),r.call(e,w);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(w=new Yr),r.call(e,w)},"onclose"),y=i(function(){e.req.on("finish",u)},"onrequest");return Go(e)?(e.on("complete",u),e.on("abort",d),e.req?y():e.on("request",y)):o&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",u),t.error!==!1&&e.on("error",g),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",g),e.removeListener("close",d)}}i(Xr,"eos");Jr.exports=Xr});var Qr=S((ku,Zr)=>{"use strict";c();var Ke;function J(e,t,r){return t=Vo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(J,"_defineProperty");function Vo(e){var t=Ko(e,"string");return typeof t=="symbol"?t:String(t)}i(Vo,"_toPropertyKey");function Ko(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Ko,"_toPrimitive");var Yo=Ve(),Z=Symbol("lastResolve"),oe=Symbol("lastReject"),Re=Symbol("error"),Ye=Symbol("ended"),ae=Symbol("lastPromise"),Mt=Symbol("handlePromise"),se=Symbol("stream");function Q(e,t){return{value:e,done:t}}i(Q,"createIterResult");function Xo(e){var t=e[Z];if(t!==null){var r=e[se].read();r!==null&&(e[ae]=null,e[Z]=null,e[oe]=null,t(Q(r,!1)))}}i(Xo,"readAndResolve");function Jo(e){process.nextTick(Xo,e)}i(Jo,"onReadable");function Zo(e,t){return function(r,n){e.then(function(){if(t[Ye]){r(Q(void 0,!0));return}t[Mt](r,n)},n)}}i(Zo,"wrapForNext");var Qo=Object.getPrototypeOf(function(){}),ea=Object.setPrototypeOf((Ke={get stream(){return this[se]},next:i(function(){var t=this,r=this[Re];if(r!==null)return Promise.reject(r);if(this[Ye])return Promise.resolve(Q(void 0,!0));if(this[se].destroyed)return new Promise(function(s,u){process.nextTick(function(){t[Re]?u(t[Re]):s(Q(void 0,!0))})});var n=this[ae],o;if(n)o=new Promise(Zo(n,this));else{var a=this[se].read();if(a!==null)return Promise.resolve(Q(a,!1));o=new Promise(this[Mt])}return this[ae]=o,o},"next")},J(Ke,Symbol.asyncIterator,function(){return this}),J(Ke,"return",i(function(){var t=this;return new Promise(function(r,n){t[se].destroy(null,function(o){if(o){n(o);return}r(Q(void 0,!0))})})},"_return")),Ke),Qo),ta=i(function(t){var r,n=Object.create(ea,(r={},J(r,se,{value:t,writable:!0}),J(r,Z,{value:null,writable:!0}),J(r,oe,{value:null,writable:!0}),J(r,Re,{value:null,writable:!0}),J(r,Ye,{value:t._readableState.endEmitted,writable:!0}),J(r,Mt,{value:i(function(a,s){var u=n[se].read();u?(n[ae]=null,n[Z]=null,n[oe]=null,a(Q(u,!1))):(n[Z]=a,n[oe]=s)},"value"),writable:!0}),r));return n[ae]=null,Yo(t,function(o){if(o&&o.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[oe];a!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,a(o)),n[Re]=o;return}var s=n[Z];s!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,s(Q(void 0,!0))),n[Ye]=!0}),t.on("readable",Jo.bind(null,n)),n},"createReadableStreamAsyncIterator");Zr.exports=ta});var nn=S((Au,rn)=>{"use strict";c();function en(e,t,r,n,o,a,s){try{var u=e[a](s),f=u.value}catch(l){r(l);return}u.done?t(f):Promise.resolve(f).then(n,o)}i(en,"asyncGeneratorStep");function ra(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function s(f){en(a,n,o,s,u,"next",f)}i(s,"_next");function u(f){en(a,n,o,s,u,"throw",f)}i(u,"_throw"),s(void 0)})}}i(ra,"_asyncToGenerator");function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(tn,"ownKeys");function na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(r),!0).forEach(function(n){ia(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(na,"_objectSpread");function ia(e,t,r){return t=oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(ia,"_defineProperty");function oa(e){var t=aa(e,"string");return typeof t=="symbol"?t:String(t)}i(oa,"_toPropertyKey");function aa(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(aa,"_toPrimitive");var sa=K().codes.ERR_INVALID_ARG_TYPE;function ua(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new sa("iterable",["Iterable"],t);var o=new e(na({objectMode:!0},r)),a=!1;o._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}i(s,"next");function u(){return u=ra(function*(){try{var f=yield n.next(),l=f.value,g=f.done;g?o.push(null):o.push(yield l)?s():a=!1}catch(d){o.destroy(d)}}),u.apply(this,arguments)}return i(u,"_next2"),o}i(ua,"from");rn.exports=ua});var xt=S((Cu,pn)=>{"use strict";c();pn.exports=R;var he;R.ReadableState=un;var Iu=L("events").EventEmitter,sn=i(function(t,r){return t.listeners(r).length},"EElistenerCount"),Oe=pt(),Xe=L("buffer").Buffer,fa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function la(e){return Xe.from(e)}i(la,"_uint8ArrayToBuffer");function ca(e){return Xe.isBuffer(e)||e instanceof fa}i(ca,"_isUint8Array");var At=L("util"),m;At&&At.debuglog?m=At.debuglog("stream"):m=i(function(){},"debug");var ha=Or(),Ft=_t(),da=vt(),pa=da.getHighWaterMark,Je=K().codes,ya=Je.ERR_INVALID_ARG_TYPE,ga=Je.ERR_STREAM_PUSH_AFTER_EOF,_a=Je.ERR_METHOD_NOT_IMPLEMENTED,va=Je.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,de,Dt,qt;Y()(R,Oe);var Te=Ft.errorOrDestroy,It=["error","close","destroy","pause","resume"];function ma(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}i(ma,"prependListener");function un(e,t,r){he=he||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof he),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=pa(this,e,"readableHighWaterMark",r),this.buffer=new ha,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(de||(de=Nt().StringDecoder),this.decoder=new de(e.encoding),this.encoding=e.encoding)}i(un,"ReadableState");function R(e){if(he=he||ne(),!(this instanceof R))return new R(e);var t=this instanceof he;this._readableState=new un(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Oe.call(this)}i(R,"Readable");Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:i(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")});R.prototype.destroy=Ft.destroy;R.prototype._undestroy=Ft.undestroy;R.prototype._destroy=function(e,t){t(e)};R.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Xe.from(e,t),t=""),n=!0),fn(this,e,t,!1,n)};R.prototype.unshift=function(e){return fn(this,e,null,!0,!1)};function fn(e,t,r,n,o){m("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Ea(e,a);else{var s;if(o||(s=wa(a,t)),s)Te(e,s);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Xe.prototype&&(t=la(t)),n)a.endEmitted?Te(e,new va):Ct(e,a,t,!0);else if(a.ended)Te(e,new ga);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Ct(e,a,t,!1):Bt(e,a)):Ct(e,a,t,!1)}else n||(a.reading=!1,Bt(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}i(fn,"readableAddChunk");function Ct(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Ze(e)),Bt(e,t)}i(Ct,"addChunk");function wa(e,t){var r;return!ca(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new ya("chunk",["string","Buffer","Uint8Array"],t)),r}i(wa,"chunkInvalid");R.prototype.isPaused=function(){return this._readableState.flowing===!1};R.prototype.setEncoding=function(e){de||(de=Nt().StringDecoder);var t=new de(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var on=1073741824;function ba(e){return e>=on?e=on:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}i(ba,"computeNewHighWaterMark");function an(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ba(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}i(an,"howMuchToRead");R.prototype.read=function(e){m("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return m("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jt(this):Ze(this),null;if(e=an(e,t),e===0&&t.ended)return t.length===0&&jt(this),null;var n=t.needReadable;m("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,m("length less than watermark",n)),t.ended||t.reading?(n=!1,m("reading or ended",n)):n&&(m("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=an(r,t)));var o;return e>0?o=hn(e,t):o=null,o===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&jt(this)),o!==null&&this.emit("data",o),o};function Ea(e,t){if(m("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Ze(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,ln(e)))}}i(Ea,"onEofChunk");function Ze(e){var t=e._readableState;m("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(ln,e))}i(Ze,"emitReadable");function ln(e){var t=e._readableState;m("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Ut(e)}i(ln,"emitReadable_");function Bt(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Sa,e,t))}i(Bt,"maybeReadMore");function Sa(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(m("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}i(Sa,"maybeReadMore_");R.prototype._read=function(e){Te(this,new _a("_read()"))};R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,m("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=o?u:T;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",s);function s(b,p){m("onunpipe"),b===r&&p&&p.hasUnpiped===!1&&(p.hasUnpiped=!0,g())}i(s,"onunpipe");function u(){m("onend"),e.end()}i(u,"onend");var f=Ra(r);e.on("drain",f);var l=!1;function g(){m("cleanup"),e.removeListener("close",_),e.removeListener("finish",w),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",T),r.removeListener("data",d),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}i(g,"cleanup"),r.on("data",d);function d(b){m("ondata");var p=e.write(b);m("dest.write",p),p===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&dn(n.pipes,e)!==-1)&&!l&&(m("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}i(d,"ondata");function y(b){m("onerror",b),T(),e.removeListener("error",y),sn(e,"error")===0&&Te(e,b)}i(y,"onerror"),ma(e,"error",y);function _(){e.removeListener("finish",w),T()}i(_,"onclose"),e.once("close",_);function w(){m("onfinish"),e.removeListener("close",_),T()}i(w,"onfinish"),e.once("finish",w);function T(){m("unpipe"),r.unpipe(e)}return i(T,"unpipe"),e.emit("pipe",r),n.flowing||(m("pipe resume"),r.resume()),e};function Ra(e){return i(function(){var r=e._readableState;m("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&sn(e,"data")&&(r.flowing=!0,Ut(e))},"pipeOnDrainFunctionResult")}i(Ra,"pipeOnDrain");R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=dn(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};R.prototype.on=function(e,t){var r=Oe.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,m("on readable",n.length,n.reading),n.length?Ze(this):n.reading||process.nextTick(Ta,this)),r};R.prototype.addListener=R.prototype.on;R.prototype.removeListener=function(e,t){var r=Oe.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(cn,this),r};R.prototype.removeAllListeners=function(e){var t=Oe.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(cn,this),t};function cn(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}i(cn,"updateReadableListening");function Ta(e){m("readable nexttick read 0"),e.read(0)}i(Ta,"nReadingNextTick");R.prototype.resume=function(){var e=this._readableState;return e.flowing||(m("resume"),e.flowing=!e.readableListening,Oa(this,e)),e.paused=!1,this};function Oa(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(xa,e,t))}i(Oa,"resume");function xa(e,t){m("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Ut(e),t.flowing&&!t.reading&&e.read(0)}i(xa,"resume_");R.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ut(e){var t=e._readableState;for(m("flow",t.flowing);t.flowing&&e.read()!==null;);}i(Ut,"flow");R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(m("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(m("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var u=t.push(s);u||(n=!0,e.pause())}});for(var o in e)this[o]===void 0&&typeof e[o]=="function"&&(this[o]=i(function(u){return i(function(){return e[u].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(o));for(var a=0;a<It.length;a++)e.on(It[a],this.emit.bind(this,It[a]));return this._read=function(s){m("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(R.prototype[Symbol.asyncIterator]=function(){return Dt===void 0&&(Dt=Qr()),Dt(this)});Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:i(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:i(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:i(function(){return this._readableState.flowing},"get"),set:i(function(t){this._readableState&&(this._readableState.flowing=t)},"set")});R._fromList=hn;Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:i(function(){return this._readableState.length},"get")});function hn(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}i(hn,"fromList");function jt(e){var t=e._readableState;m("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(La,t,e))}i(jt,"endReadable");function La(e,t){if(m("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}i(La,"endReadableNT");typeof Symbol=="function"&&(R.from=function(e,t){return qt===void 0&&(qt=nn()),qt(R,e,t)});function dn(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}i(dn,"indexOf")});var Wt=S((Fu,gn)=>{"use strict";c();gn.exports=z;var Qe=K().codes,Pa=Qe.ERR_METHOD_NOT_IMPLEMENTED,ka=Qe.ERR_MULTIPLE_CALLBACK,Na=Qe.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ma=Qe.ERR_TRANSFORM_WITH_LENGTH_0,et=ne();Y()(z,et);function Aa(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new ka);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}i(Aa,"afterTransform");function z(e){if(!(this instanceof z))return new z(e);et.call(this,e),this._transformState={afterTransform:Aa.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Da)}i(z,"Transform");function Da(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yn(e,t,r)}):yn(this,null,null)}i(Da,"prefinish");z.prototype.push=function(e,t){return this._transformState.needTransform=!1,et.prototype.push.call(this,e,t)};z.prototype._transform=function(e,t,r){r(new Pa("_transform()"))};z.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};z.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};z.prototype._destroy=function(e,t){et.prototype._destroy.call(this,e,function(r){t(r)})};function yn(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Ma;if(e._transformState.transforming)throw new Na;return e.push(null)}i(yn,"done")});var mn=S((Hu,vn)=>{"use strict";c();vn.exports=xe;var _n=Wt();Y()(xe,_n);function xe(e){if(!(this instanceof xe))return new xe(e);_n.call(this,e)}i(xe,"PassThrough");xe.prototype._transform=function(e,t,r){r(null,e)}});var Rn=S((Gu,Sn)=>{"use strict";c();var Ht;function qa(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}i(qa,"once");var En=K().codes,Ia=En.ERR_MISSING_ARGS,Ca=En.ERR_STREAM_DESTROYED;function wn(e){if(e)throw e}i(wn,"noop");function ja(e){return e.setHeader&&typeof e.abort=="function"}i(ja,"isRequest");function Ba(e,t,r,n){n=qa(n);var o=!1;e.on("close",function(){o=!0}),Ht===void 0&&(Ht=Ve()),Ht(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var a=!1;return function(s){if(!o&&!a){if(a=!0,ja(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new Ca("pipe"))}}}i(Ba,"destroyer");function bn(e){e()}i(bn,"call");function Fa(e,t){return e.pipe(t)}i(Fa,"pipe");function Ua(e){return!e.length||typeof e[e.length-1]!="function"?wn:e.pop()}i(Ua,"popCallback");function Wa(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Ua(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Ia("streams");var o,a=t.map(function(s,u){var f=u<t.length-1,l=u>0;return Ba(s,f,l,function(g){o||(o=g),g&&a.forEach(bn),!f&&(a.forEach(bn),n(o))})});return t.reduce(Fa)}i(Wa,"pipeline");Sn.exports=Wa});var pe=S((B,Pe)=>{c();var Le=L("stream");process.env.READABLE_STREAM==="disable"&&Le?(Pe.exports=Le.Readable,Object.assign(Pe.exports,Le),Pe.exports.Stream=Le):(B=Pe.exports=xt(),B.Stream=Le||B,B.Readable=B,B.Writable=Rt(),B.Duplex=ne(),B.Transform=Wt(),B.PassThrough=mn(),B.finished=Ve(),B.pipeline=Rn())});var xn=S((Xu,On)=>{"use strict";c();var{Buffer:F}=L("buffer"),Tn=Symbol.for("BufferList");function x(e){if(!(this instanceof x))return new x(e);x._init.call(this,e)}i(x,"BufferList");x._init=i(function(t){Object.defineProperty(this,Tn,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},"_init");x.prototype._new=i(function(t){return new x(t)},"_new");x.prototype._offset=i(function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let o=r+this._bufs[n].length;if(t<o||n===this._bufs.length-1)return[n,t-r];r=o}},"_offset");x.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let n=0;n<t;n++)r+=this._bufs[n].length;return r};x.prototype.get=i(function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},"get");x.prototype.slice=i(function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},"slice");x.prototype.copy=i(function(t,r,n,o){if((typeof n!="number"||n<0)&&(n=0),(typeof o!="number"||o>this.length)&&(o=this.length),n>=this.length||o<=0)return t||F.alloc(0);let a=!!t,s=this._offset(n),u=o-n,f=u,l=a&&r||0,g=s[1];if(n===0&&o===this.length){if(!a)return this._bufs.length===1?this._bufs[0]:F.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(t,l),l+=this._bufs[d].length;return t}if(f<=this._bufs[s[0]].length-g)return a?this._bufs[s[0]].copy(t,r,g,g+f):this._bufs[s[0]].slice(g,g+f);a||(t=F.allocUnsafe(u));for(let d=s[0];d<this._bufs.length;d++){let y=this._bufs[d].length-g;if(f>y)this._bufs[d].copy(t,l,g),l+=y;else{this._bufs[d].copy(t,l,g,g+f),l+=y;break}f-=y,g&&(g=0)}return t.length>l?t.slice(0,l):t},"copy");x.prototype.shallowSlice=i(function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),o=this._offset(r),a=this._bufs.slice(n[0],o[0]+1);return o[1]===0?a.pop():a[a.length-1]=a[a.length-1].slice(0,o[1]),n[1]!==0&&(a[0]=a[0].slice(n[1])),this._new(a)},"shallowSlice");x.prototype.toString=i(function(t,r,n){return this.slice(r,n).toString(t)},"toString");x.prototype.consume=i(function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},"consume");x.prototype.duplicate=i(function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},"duplicate");x.prototype.append=i(function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(F.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let r=0;r<t.length;r++)this.append(t[r]);else if(this._isBufferList(t))for(let r=0;r<t._bufs.length;r++)this.append(t._bufs[r]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(F.from(t));return this},"append");x.prototype._appendBuffer=i(function(t){this._bufs.push(t),this.length+=t.length},"appendBuffer");x.prototype.indexOf=function(e,t,r){if(r===void 0&&typeof t=="string"&&(r=t,t=void 0),typeof e=="function"||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof e=="number"?e=F.from([e]):typeof e=="string"?e=F.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=F.from(e.buffer,e.byteOffset,e.byteLength):F.isBuffer(e)||(e=F.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=this._offset(t),o=n[0],a=n[1];for(;o<this._bufs.length;o++){let s=this._bufs[o];for(;a<s.length;)if(s.length-a>=e.length){let f=s.indexOf(e,a);if(f!==-1)return this._reverseOffset([o,f]);a=s.length-e.length+1}else{let f=this._reverseOffset([o,a]);if(this._match(f,e))return f;a++}a=0}return-1};x.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0};(function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)(function(r){e[r]===null?x.prototype[r]=function(n,o){return this.slice(n,n+o)[r](0,o)}:x.prototype[r]=function(n=0){return this.slice(n,n+e[r])[r](0)}})(t)})();x.prototype._isBufferList=i(function(t){return t instanceof x||x.isBufferList(t)},"_isBufferList");x.isBufferList=i(function(t){return t!=null&&t[Tn]},"isBufferList");On.exports=x});var Ln=S((Qu,tt)=>{"use strict";c();var $t=pe().Duplex,Ha=Y(),ke=xn();function N(e){if(!(this instanceof N))return new N(e);if(typeof e=="function"){this._callback=e;let t=i(function(n){this._callback&&(this._callback(n),this._callback=null)},"piper").bind(this);this.on("pipe",i(function(n){n.on("error",t)},"onPipe")),this.on("unpipe",i(function(n){n.removeListener("error",t)},"onUnpipe")),e=null}ke._init.call(this,e),$t.call(this)}i(N,"BufferListStream");Ha(N,$t);Object.assign(N.prototype,ke.prototype);N.prototype._new=i(function(t){return new N(t)},"_new");N.prototype._write=i(function(t,r,n){this._appendBuffer(t),typeof n=="function"&&n()},"_write");N.prototype._read=i(function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},"_read");N.prototype.end=i(function(t){$t.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},"end");N.prototype._destroy=i(function(t,r){this._bufs.length=0,this.length=0,r(t)},"_destroy");N.prototype._isBufferList=i(function(t){return t instanceof N||t instanceof ke||N.isBufferList(t)},"_isBufferList");N.isBufferList=ke.isBufferList;tt.exports=N;tt.exports.BufferListStream=N;tt.exports.BufferList=ke});var Vt=S(ge=>{c();var $a=Buffer.alloc,za="0000000000000000000",Ga="7777777777777777777",Pn=48,kn=Buffer.from("ustar\0","binary"),Va=Buffer.from("00","binary"),Ka=Buffer.from("ustar ","binary"),Ya=Buffer.from(" \0","binary"),Xa=parseInt("7777",8),Ne=257,Gt=263,Ja=i(function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},"clamp"),Za=i(function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},"toType"),Qa=i(function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},"toTypeflag"),Nn=i(function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},"indexOf"),Mn=i(function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},"cksum"),ee=i(function(e,t){return e=e.toString(8),e.length>t?Ga.slice(0,t)+" ":za.slice(0,t-e.length)+e+" "},"encodeOct");function es(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var o=e[n];t?r.push(o):r.push(255-o)}var a=0,s=r.length;for(n=0;n<s;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}i(es,"parse256");var te=i(function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return es(e);for(;t<e.length&&e[t]===32;)t++;for(var n=Ja(Nn(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},"decodeOct"),ye=i(function(e,t,r,n){return e.slice(t,Nn(e,0,t,t+r)).toString(n)},"decodeStr"),zt=i(function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e},"addLength");ge.decodeLongPath=function(e,t){return ye(e,0,e.length,t)};ge.encodePax=function(e){var t="";e.name&&(t+=zt(" path="+e.name+`
|
|
3
|
+
import{l as cr,m as hr}from"./chunk-NI4SD5KN.js";import{b as or,c as ar,d as sr,e as ur,f as fr,g as lr}from"./chunk-RDY6H5F3.js";import{a as i,b as L,c as S,e as Pi,f as c}from"./chunk-NW56IEMZ.js";var mr=S((Gs,vr)=>{"use strict";c();var C=L("fs"),re=L("path"),ki=C.lchown?"lchown":"chown",Ni=C.lchownSync?"lchownSync":"chownSync",pr=C.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),dr=i((e,t,r)=>{try{return C[Ni](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"lchownSync"),Mi=i((e,t,r)=>{try{return C.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"chownSync"),Ai=pr?(e,t,r,n)=>o=>{!o||o.code!=="EISDIR"?n(o):C.chown(e,t,r,n)}:(e,t,r,n)=>n,ht=pr?(e,t,r)=>{try{return dr(e,t,r)}catch(n){if(n.code!=="EISDIR")throw n;Mi(e,t,r)}}:(e,t,r)=>dr(e,t,r),Di=process.version,yr=i((e,t,r)=>C.readdir(e,t,r),"readdir"),qi=i((e,t)=>C.readdirSync(e,t),"readdirSync");/^v4\./.test(Di)&&(yr=i((e,t,r)=>C.readdir(e,r),"readdir"));var Be=i((e,t,r,n)=>{C[ki](e,t,r,Ai(e,t,r,o=>{n(o&&o.code!=="ENOENT"?o:null)}))},"chown"),gr=i((e,t,r,n,o)=>{if(typeof t=="string")return C.lstat(re.resolve(e,t),(a,s)=>{if(a)return o(a.code!=="ENOENT"?a:null);s.name=t,gr(e,s,r,n,o)});if(t.isDirectory())dt(re.resolve(e,t.name),r,n,a=>{if(a)return o(a);let s=re.resolve(e,t.name);Be(s,r,n,o)});else{let a=re.resolve(e,t.name);Be(a,r,n,o)}},"chownrKid"),dt=i((e,t,r,n)=>{yr(e,{withFileTypes:!0},(o,a)=>{if(o){if(o.code==="ENOENT")return n();if(o.code!=="ENOTDIR"&&o.code!=="ENOTSUP")return n(o)}if(o||!a.length)return Be(e,t,r,n);let s=a.length,u=null,f=i(l=>{if(!u){if(l)return n(u=l);if(--s===0)return Be(e,t,r,n)}},"then");a.forEach(l=>gr(e,l,t,r,f))})},"chownr"),Ii=i((e,t,r,n)=>{if(typeof t=="string")try{let o=C.lstatSync(re.resolve(e,t));o.name=t,t=o}catch(o){if(o.code==="ENOENT")return;throw o}t.isDirectory()&&_r(re.resolve(e,t.name),r,n),ht(re.resolve(e,t.name),r,n)},"chownrKidSync"),_r=i((e,t,r)=>{let n;try{n=qi(e,{withFileTypes:!0})}catch(o){if(o.code==="ENOENT")return;if(o.code==="ENOTDIR"||o.code==="ENOTSUP")return ht(e,t,r);throw o}return n&&n.length&&n.forEach(o=>Ii(e,o,t,r)),ht(e,t,r)},"chownrSync");vr.exports=dt;dt.sync=_r});var pt=S((Ys,wr)=>{c();wr.exports=L("stream")});var Or=S((Js,Tr)=>{"use strict";c();function br(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(br,"ownKeys");function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?br(Object(r),!0).forEach(function(n){Ci(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(Er,"_objectSpread");function Ci(e,t,r){return t=Rr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(Ci,"_defineProperty");function ji(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i(ji,"_classCallCheck");function Sr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rr(n.key),n)}}i(Sr,"_defineProperties");function Bi(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}i(Bi,"_createClass");function Rr(e){var t=Fi(e,"string");return typeof t=="symbol"?t:String(t)}i(Rr,"_toPropertyKey");function Fi(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Fi,"_toPrimitive");var Ui=L("buffer"),Fe=Ui.Buffer,Wi=L("util"),yt=Wi.inspect,Hi=yt&&yt.custom||"inspect";function $i(e,t,r){Fe.prototype.copy.call(e,t,r)}i($i,"copyBuffer");Tr.exports=function(){function e(){ji(this,e),this.head=null,this.tail=null,this.length=0}return i(e,"BufferList"),Bi(e,[{key:"push",value:i(function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},"push")},{key:"unshift",value:i(function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},"unshift")},{key:"shift",value:i(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:i(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:i(function(r){if(this.length===0)return"";for(var n=this.head,o=""+n.data;n=n.next;)o+=r+n.data;return o},"join")},{key:"concat",value:i(function(r){if(this.length===0)return Fe.alloc(0);for(var n=Fe.allocUnsafe(r>>>0),o=this.head,a=0;o;)$i(o.data,n,a),a+=o.data.length,o=o.next;return n},"concat")},{key:"consume",value:i(function(r,n){var o;return r<this.head.data.length?(o=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?o=this.shift():o=n?this._getString(r):this._getBuffer(r),o},"consume")},{key:"first",value:i(function(){return this.head.data},"first")},{key:"_getString",value:i(function(r){var n=this.head,o=1,a=n.data;for(r-=a.length;n=n.next;){var s=n.data,u=r>s.length?s.length:r;if(u===s.length?a+=s:a+=s.slice(0,r),r-=u,r===0){u===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(u));break}++o}return this.length-=o,a},"_getString")},{key:"_getBuffer",value:i(function(r){var n=Fe.allocUnsafe(r),o=this.head,a=1;for(o.data.copy(n),r-=o.data.length;o=o.next;){var s=o.data,u=r>s.length?s.length:r;if(s.copy(n,n.length-r,0,u),r-=u,r===0){u===s.length?(++a,o.next?this.head=o.next:this.head=this.tail=null):(this.head=o,o.data=s.slice(u));break}++a}return this.length-=a,n},"_getBuffer")},{key:Hi,value:i(function(r,n){return yt(this,Er(Er({},n),{},{depth:0,customInspect:!1}))},"value")}]),e}()});var _t=S((eu,Lr)=>{"use strict";c();function zi(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(gt,this,e)):process.nextTick(gt,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(Ue,r):(r._writableState.errorEmitted=!0,process.nextTick(xr,r,a)):process.nextTick(xr,r,a):t?(process.nextTick(Ue,r),t(a)):process.nextTick(Ue,r)}),this)}i(zi,"destroy");function xr(e,t){gt(e,t),Ue(e)}i(xr,"emitErrorAndCloseNT");function Ue(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}i(Ue,"emitCloseNT");function Gi(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}i(Gi,"undestroy");function gt(e,t){e.emit("error",t)}i(gt,"emitErrorNT");function Vi(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}i(Vi,"errorOrDestroy");Lr.exports={destroy:zi,undestroy:Gi,errorOrDestroy:Vi}});var K=S((nu,Nr)=>{"use strict";c();var kr={};function j(e,t,r){r||(r=Error);function n(a,s,u){return typeof t=="string"?t:t(a,s,u)}i(n,"getMessage");class o extends r{static{i(this,"NodeError")}constructor(s,u,f){super(n(s,u,f))}}o.prototype.name=r.name,o.prototype.code=e,kr[e]=o}i(j,"createErrorType");function Pr(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}i(Pr,"oneOf");function Ki(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}i(Ki,"startsWith");function Yi(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}i(Yi,"endsWith");function Xi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}i(Xi,"includes");j("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);j("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Ki(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o;if(Yi(e," argument"))o=`The ${e} ${n} ${Pr(t,"type")}`;else{let a=Xi(e,".")?"property":"argument";o=`The "${e}" ${a} ${n} ${Pr(t,"type")}`}return o+=`. Received type ${typeof r}`,o},TypeError);j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");j("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});j("ERR_STREAM_PREMATURE_CLOSE","Premature close");j("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});j("ERR_MULTIPLE_CALLBACK","Callback called multiple times");j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");j("ERR_STREAM_WRITE_AFTER_END","write after end");j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);j("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");Nr.exports.codes=kr});var vt=S((au,Mr)=>{"use strict";c();var Ji=K().codes.ERR_INVALID_OPT_VALUE;function Zi(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}i(Zi,"highWaterMarkFrom");function Qi(e,t,r,n){var o=Zi(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=n?r:"highWaterMark";throw new Ji(a,o)}return Math.floor(o)}return e.objectMode?16:16*1024}i(Qi,"getHighWaterMark");Mr.exports={getHighWaterMark:Qi}});var Ar=S((fu,mt)=>{c();typeof Object.create=="function"?mt.exports=i(function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):mt.exports=i(function(t,r){if(r){t.super_=r;var n=i(function(){},"TempCtor");n.prototype=r.prototype,t.prototype=new n,t.prototype.constructor=t}},"inherits")});var Y=S((hu,bt)=>{c();try{if(wt=L("util"),typeof wt.inherits!="function")throw"";bt.exports=wt.inherits}catch{bt.exports=Ar()}var wt});var qr=S((pu,Dr)=>{c();Dr.exports=L("util").deprecate});var Rt=S((gu,Ur)=>{"use strict";c();Ur.exports=k;function Cr(e){var t=this;this.next=null,this.entry=null,this.finish=function(){xo(t,e)}}i(Cr,"CorkedRequest");var le;k.WritableState=Ee;var eo={deprecate:qr()},jr=pt(),He=L("buffer").Buffer,to=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ro(e){return He.from(e)}i(ro,"_uint8ArrayToBuffer");function no(e){return He.isBuffer(e)||e instanceof to}i(no,"_isUint8Array");var St=_t(),io=vt(),oo=io.getHighWaterMark,X=K().codes,ao=X.ERR_INVALID_ARG_TYPE,so=X.ERR_METHOD_NOT_IMPLEMENTED,uo=X.ERR_MULTIPLE_CALLBACK,fo=X.ERR_STREAM_CANNOT_PIPE,lo=X.ERR_STREAM_DESTROYED,co=X.ERR_STREAM_NULL_VALUES,ho=X.ERR_STREAM_WRITE_AFTER_END,po=X.ERR_UNKNOWN_ENCODING,ce=St.errorOrDestroy;Y()(k,jr);function yo(){}i(yo,"nop");function Ee(e,t,r){le=le||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof le),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=oo(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(o){Eo(t,o)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Cr(this)}i(Ee,"WritableState");Ee.prototype.getBuffer=i(function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r},"getBuffer");(function(){try{Object.defineProperty(Ee.prototype,"buffer",{get:eo.deprecate(i(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var We;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(We=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:i(function(t){return We.call(this,t)?!0:this!==k?!1:t&&t._writableState instanceof Ee},"value")})):We=i(function(t){return t instanceof this},"realHasInstance");function k(e){le=le||ne();var t=this instanceof le;if(!t&&!We.call(k,this))return new k(e);this._writableState=new Ee(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),jr.call(this)}i(k,"Writable");k.prototype.pipe=function(){ce(this,new fo)};function go(e,t){var r=new ho;ce(e,r),process.nextTick(t,r)}i(go,"writeAfterEnd");function _o(e,t,r,n){var o;return r===null?o=new co:typeof r!="string"&&!t.objectMode&&(o=new ao("chunk",["string","Buffer"],r)),o?(ce(e,o),process.nextTick(n,o),!1):!0}i(_o,"validChunk");k.prototype.write=function(e,t,r){var n=this._writableState,o=!1,a=!n.objectMode&&no(e);return a&&!He.isBuffer(e)&&(e=ro(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=yo),n.ending?go(this,r):(a||_o(this,n,e,r))&&(n.pendingcb++,o=mo(this,n,a,e,t,r)),o};k.prototype.cork=function(){this._writableState.corked++};k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&Br(this,e))};k.prototype.setDefaultEncoding=i(function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new po(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function vo(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=He.from(t,r)),t}i(vo,"decodeChunk");Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});function mo(e,t,r,n,o,a){if(!r){var s=vo(t,n,o);n!==s&&(r=!0,o="buffer",n=s)}var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Et(e,t,!1,u,n,o,a);return f}i(mo,"writeOrBuffer");function Et(e,t,r,n,o,a,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new lo("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}i(Et,"doWrite");function wo(e,t,r,n,o){--t.pendingcb,r?(process.nextTick(o,n),process.nextTick(be,e,t),e._writableState.errorEmitted=!0,ce(e,n)):(o(n),e._writableState.errorEmitted=!0,ce(e,n),be(e,t))}i(wo,"onwriteError");function bo(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}i(bo,"onwriteStateUpdate");function Eo(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(typeof o!="function")throw new uo;if(bo(r),t)wo(e,r,n,t,o);else{var a=Fr(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Br(e,r),n?process.nextTick(Ir,e,r,a,o):Ir(e,r,a,o)}}i(Eo,"onwrite");function Ir(e,t,r,n){r||So(e,t),t.pendingcb--,n(),be(e,t)}i(Ir,"afterWrite");function So(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}i(So,"onwriteDrain");function Br(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,o=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)o[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;o.allBuffers=u,Et(e,t,!0,t.length,o,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new Cr(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,l=r.encoding,g=r.callback,d=t.objectMode?1:f.length;if(Et(e,t,!1,d,f,l,g),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}i(Br,"clearBuffer");k.prototype._write=function(e,t,r){r(new so("_write()"))};k.prototype._writev=null;k.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||Oo(this,n,r),this};Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Fr(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}i(Fr,"needFinish");function Ro(e,t){e._final(function(r){t.pendingcb--,r&&ce(e,r),t.prefinished=!0,e.emit("prefinish"),be(e,t)})}i(Ro,"callFinal");function To(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(Ro,e,t)):(t.prefinished=!0,e.emit("prefinish")))}i(To,"prefinish");function be(e,t){var r=Fr(t);if(r&&(To(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}i(be,"finishMaybe");function Oo(e,t,r){t.ending=!0,be(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}i(Oo,"endWritable");function xo(e,t,r){var n=e.entry;for(e.entry=null;n;){var o=n.callback;t.pendingcb--,o(r),n=n.next}t.corkedRequestsFree.next=e}i(xo,"onCorkedFinish");Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:i(function(t){this._writableState&&(this._writableState.destroyed=t)},"set")});k.prototype.destroy=St.destroy;k.prototype._undestroy=St.undestroy;k.prototype._destroy=function(e,t){t(e)}});var ne=S((mu,Hr)=>{"use strict";c();var Lo=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Hr.exports=U;var Wr=xt(),Ot=Rt();Y()(U,Wr);for(Tt=Lo(Ot.prototype),$e=0;$e<Tt.length;$e++)ze=Tt[$e],U.prototype[ze]||(U.prototype[ze]=Ot.prototype[ze]);var Tt,ze,$e;function U(e){if(!(this instanceof U))return new U(e);Wr.call(this,e),Ot.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Po)))}i(U,"Duplex");Object.defineProperty(U.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(U.prototype,"writableBuffer",{enumerable:!1,get:i(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(U.prototype,"writableLength",{enumerable:!1,get:i(function(){return this._writableState.length},"get")});function Po(){this._writableState.ended||process.nextTick(ko,this)}i(Po,"onend");function ko(e){e.end()}i(ko,"onEndNT");Object.defineProperty(U.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:i(function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)},"set")})});var Gr=S((Lt,zr)=>{c();var Ge=L("buffer"),W=Ge.Buffer;function $r(e,t){for(var r in e)t[r]=e[r]}i($r,"copyProps");W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow?zr.exports=Ge:($r(Ge,Lt),Lt.Buffer=ie);function ie(e,t,r){return W(e,t,r)}i(ie,"SafeBuffer");ie.prototype=Object.create(W.prototype);$r(W,ie);ie.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return W(e,t,r)};ie.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=W(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};ie.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return W(e)};ie.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Ge.SlowBuffer(e)}});var Nt=S(Kr=>{"use strict";c();var kt=Gr().Buffer,Vr=kt.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function No(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}i(No,"_normalizeEncoding");function Mo(e){var t=No(e);if(typeof t!="string"&&(kt.isEncoding===Vr||!Vr(e)))throw new Error("Unknown encoding: "+e);return t||e}i(Mo,"normalizeEncoding");Kr.StringDecoder=Se;function Se(e){this.encoding=Mo(e);var t;switch(this.encoding){case"utf16le":this.text=jo,this.end=Bo,t=4;break;case"utf8":this.fillLast=qo,t=4;break;case"base64":this.text=Fo,this.end=Uo,t=3;break;default:this.write=Wo,this.end=Ho;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=kt.allocUnsafe(t)}i(Se,"StringDecoder");Se.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Se.prototype.end=Co;Se.prototype.text=Io;Se.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Pt(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}i(Pt,"utf8CheckByte");function Ao(e,t,r){var n=t.length-1;if(n<r)return 0;var o=Pt(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||o===-2?0:(o=Pt(t[n]),o>=0?(o>0&&(o===2?o=0:e.lastNeed=o-3),o):0))}i(Ao,"utf8CheckIncomplete");function Do(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}i(Do,"utf8CheckExtraBytes");function qo(e){var t=this.lastTotal-this.lastNeed,r=Do(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}i(qo,"utf8FillLast");function Io(e,t){var r=Ao(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}i(Io,"utf8Text");function Co(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}i(Co,"utf8End");function jo(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}i(jo,"utf16Text");function Bo(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}i(Bo,"utf16End");function Fo(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}i(Fo,"base64Text");function Uo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}i(Uo,"base64End");function Wo(e){return e.toString(this.encoding)}i(Wo,"simpleWrite");function Ho(e){return e&&e.length?this.write(e):""}i(Ho,"simpleEnd")});var Ve=S((xu,Jr)=>{"use strict";c();var Yr=K().codes.ERR_STREAM_PREMATURE_CLOSE;function $o(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}i($o,"once");function zo(){}i(zo,"noop");function Go(e){return e.setHeader&&typeof e.abort=="function"}i(Go,"isRequest");function Xr(e,t,r){if(typeof t=="function")return Xr(e,null,t);t||(t={}),r=$o(r||zo);var n=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,a=i(function(){e.writable||u()},"onlegacyfinish"),s=e._writableState&&e._writableState.finished,u=i(function(){o=!1,s=!0,n||r.call(e)},"onfinish"),f=e._readableState&&e._readableState.endEmitted,l=i(function(){n=!1,f=!0,o||r.call(e)},"onend"),g=i(function(w){r.call(e,w)},"onerror"),d=i(function(){var w;if(n&&!f)return(!e._readableState||!e._readableState.ended)&&(w=new Yr),r.call(e,w);if(o&&!s)return(!e._writableState||!e._writableState.ended)&&(w=new Yr),r.call(e,w)},"onclose"),y=i(function(){e.req.on("finish",u)},"onrequest");return Go(e)?(e.on("complete",u),e.on("abort",d),e.req?y():e.on("request",y)):o&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",l),e.on("finish",u),t.error!==!1&&e.on("error",g),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",y),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",g),e.removeListener("close",d)}}i(Xr,"eos");Jr.exports=Xr});var Qr=S((ku,Zr)=>{"use strict";c();var Ke;function J(e,t,r){return t=Vo(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(J,"_defineProperty");function Vo(e){var t=Ko(e,"string");return typeof t=="symbol"?t:String(t)}i(Vo,"_toPropertyKey");function Ko(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(Ko,"_toPrimitive");var Yo=Ve(),Z=Symbol("lastResolve"),oe=Symbol("lastReject"),Re=Symbol("error"),Ye=Symbol("ended"),ae=Symbol("lastPromise"),Mt=Symbol("handlePromise"),se=Symbol("stream");function Q(e,t){return{value:e,done:t}}i(Q,"createIterResult");function Xo(e){var t=e[Z];if(t!==null){var r=e[se].read();r!==null&&(e[ae]=null,e[Z]=null,e[oe]=null,t(Q(r,!1)))}}i(Xo,"readAndResolve");function Jo(e){process.nextTick(Xo,e)}i(Jo,"onReadable");function Zo(e,t){return function(r,n){e.then(function(){if(t[Ye]){r(Q(void 0,!0));return}t[Mt](r,n)},n)}}i(Zo,"wrapForNext");var Qo=Object.getPrototypeOf(function(){}),ea=Object.setPrototypeOf((Ke={get stream(){return this[se]},next:i(function(){var t=this,r=this[Re];if(r!==null)return Promise.reject(r);if(this[Ye])return Promise.resolve(Q(void 0,!0));if(this[se].destroyed)return new Promise(function(s,u){process.nextTick(function(){t[Re]?u(t[Re]):s(Q(void 0,!0))})});var n=this[ae],o;if(n)o=new Promise(Zo(n,this));else{var a=this[se].read();if(a!==null)return Promise.resolve(Q(a,!1));o=new Promise(this[Mt])}return this[ae]=o,o},"next")},J(Ke,Symbol.asyncIterator,function(){return this}),J(Ke,"return",i(function(){var t=this;return new Promise(function(r,n){t[se].destroy(null,function(o){if(o){n(o);return}r(Q(void 0,!0))})})},"_return")),Ke),Qo),ta=i(function(t){var r,n=Object.create(ea,(r={},J(r,se,{value:t,writable:!0}),J(r,Z,{value:null,writable:!0}),J(r,oe,{value:null,writable:!0}),J(r,Re,{value:null,writable:!0}),J(r,Ye,{value:t._readableState.endEmitted,writable:!0}),J(r,Mt,{value:i(function(a,s){var u=n[se].read();u?(n[ae]=null,n[Z]=null,n[oe]=null,a(Q(u,!1))):(n[Z]=a,n[oe]=s)},"value"),writable:!0}),r));return n[ae]=null,Yo(t,function(o){if(o&&o.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[oe];a!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,a(o)),n[Re]=o;return}var s=n[Z];s!==null&&(n[ae]=null,n[Z]=null,n[oe]=null,s(Q(void 0,!0))),n[Ye]=!0}),t.on("readable",Jo.bind(null,n)),n},"createReadableStreamAsyncIterator");Zr.exports=ta});var nn=S((Au,rn)=>{"use strict";c();function en(e,t,r,n,o,a,s){try{var u=e[a](s),f=u.value}catch(l){r(l);return}u.done?t(f):Promise.resolve(f).then(n,o)}i(en,"asyncGeneratorStep");function ra(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function s(f){en(a,n,o,s,u,"next",f)}i(s,"_next");function u(f){en(a,n,o,s,u,"throw",f)}i(u,"_throw"),s(void 0)})}}i(ra,"_asyncToGenerator");function tn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}i(tn,"ownKeys");function na(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tn(Object(r),!0).forEach(function(n){ia(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}i(na,"_objectSpread");function ia(e,t,r){return t=oa(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(ia,"_defineProperty");function oa(e){var t=aa(e,"string");return typeof t=="symbol"?t:String(t)}i(oa,"_toPropertyKey");function aa(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}i(aa,"_toPrimitive");var sa=K().codes.ERR_INVALID_ARG_TYPE;function ua(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new sa("iterable",["Iterable"],t);var o=new e(na({objectMode:!0},r)),a=!1;o._read=function(){a||(a=!0,s())};function s(){return u.apply(this,arguments)}i(s,"next");function u(){return u=ra(function*(){try{var f=yield n.next(),l=f.value,g=f.done;g?o.push(null):o.push(yield l)?s():a=!1}catch(d){o.destroy(d)}}),u.apply(this,arguments)}return i(u,"_next2"),o}i(ua,"from");rn.exports=ua});var xt=S((Cu,pn)=>{"use strict";c();pn.exports=R;var he;R.ReadableState=un;var Iu=L("events").EventEmitter,sn=i(function(t,r){return t.listeners(r).length},"EElistenerCount"),Oe=pt(),Xe=L("buffer").Buffer,fa=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function la(e){return Xe.from(e)}i(la,"_uint8ArrayToBuffer");function ca(e){return Xe.isBuffer(e)||e instanceof fa}i(ca,"_isUint8Array");var At=L("util"),m;At&&At.debuglog?m=At.debuglog("stream"):m=i(function(){},"debug");var ha=Or(),Ft=_t(),da=vt(),pa=da.getHighWaterMark,Je=K().codes,ya=Je.ERR_INVALID_ARG_TYPE,ga=Je.ERR_STREAM_PUSH_AFTER_EOF,_a=Je.ERR_METHOD_NOT_IMPLEMENTED,va=Je.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,de,Dt,qt;Y()(R,Oe);var Te=Ft.errorOrDestroy,It=["error","close","destroy","pause","resume"];function ma(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}i(ma,"prependListener");function un(e,t,r){he=he||ne(),e=e||{},typeof r!="boolean"&&(r=t instanceof he),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=pa(this,e,"readableHighWaterMark",r),this.buffer=new ha,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(de||(de=Nt().StringDecoder),this.decoder=new de(e.encoding),this.encoding=e.encoding)}i(un,"ReadableState");function R(e){if(he=he||ne(),!(this instanceof R))return new R(e);var t=this instanceof he;this._readableState=new un(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Oe.call(this)}i(R,"Readable");Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:i(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:i(function(t){this._readableState&&(this._readableState.destroyed=t)},"set")});R.prototype.destroy=Ft.destroy;R.prototype._undestroy=Ft.undestroy;R.prototype._destroy=function(e,t){t(e)};R.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=Xe.from(e,t),t=""),n=!0),fn(this,e,t,!1,n)};R.prototype.unshift=function(e){return fn(this,e,null,!0,!1)};function fn(e,t,r,n,o){m("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Ea(e,a);else{var s;if(o||(s=wa(a,t)),s)Te(e,s);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==Xe.prototype&&(t=la(t)),n)a.endEmitted?Te(e,new va):Ct(e,a,t,!0);else if(a.ended)Te(e,new ga);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Ct(e,a,t,!1):Bt(e,a)):Ct(e,a,t,!1)}else n||(a.reading=!1,Bt(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}i(fn,"readableAddChunk");function Ct(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&Ze(e)),Bt(e,t)}i(Ct,"addChunk");function wa(e,t){var r;return!ca(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new ya("chunk",["string","Buffer","Uint8Array"],t)),r}i(wa,"chunkInvalid");R.prototype.isPaused=function(){return this._readableState.flowing===!1};R.prototype.setEncoding=function(e){de||(de=Nt().StringDecoder);var t=new de(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var on=1073741824;function ba(e){return e>=on?e=on:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}i(ba,"computeNewHighWaterMark");function an(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=ba(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}i(an,"howMuchToRead");R.prototype.read=function(e){m("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return m("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jt(this):Ze(this),null;if(e=an(e,t),e===0&&t.ended)return t.length===0&&jt(this),null;var n=t.needReadable;m("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,m("length less than watermark",n)),t.ended||t.reading?(n=!1,m("reading or ended",n)):n&&(m("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=an(r,t)));var o;return e>0?o=hn(e,t):o=null,o===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&jt(this)),o!==null&&this.emit("data",o),o};function Ea(e,t){if(m("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?Ze(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,ln(e)))}}i(Ea,"onEofChunk");function Ze(e){var t=e._readableState;m("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(ln,e))}i(Ze,"emitReadable");function ln(e){var t=e._readableState;m("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Ut(e)}i(ln,"emitReadable_");function Bt(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Sa,e,t))}i(Bt,"maybeReadMore");function Sa(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(m("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}i(Sa,"maybeReadMore_");R.prototype._read=function(e){Te(this,new _a("_read()"))};R.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,m("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=o?u:T;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",s);function s(b,p){m("onunpipe"),b===r&&p&&p.hasUnpiped===!1&&(p.hasUnpiped=!0,g())}i(s,"onunpipe");function u(){m("onend"),e.end()}i(u,"onend");var f=Ra(r);e.on("drain",f);var l=!1;function g(){m("cleanup"),e.removeListener("close",_),e.removeListener("finish",w),e.removeListener("drain",f),e.removeListener("error",y),e.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",T),r.removeListener("data",d),l=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&f()}i(g,"cleanup"),r.on("data",d);function d(b){m("ondata");var p=e.write(b);m("dest.write",p),p===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&dn(n.pipes,e)!==-1)&&!l&&(m("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}i(d,"ondata");function y(b){m("onerror",b),T(),e.removeListener("error",y),sn(e,"error")===0&&Te(e,b)}i(y,"onerror"),ma(e,"error",y);function _(){e.removeListener("finish",w),T()}i(_,"onclose"),e.once("close",_);function w(){m("onfinish"),e.removeListener("close",_),T()}i(w,"onfinish"),e.once("finish",w);function T(){m("unpipe"),r.unpipe(e)}return i(T,"unpipe"),e.emit("pipe",r),n.flowing||(m("pipe resume"),r.resume()),e};function Ra(e){return i(function(){var r=e._readableState;m("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&sn(e,"data")&&(r.flowing=!0,Ut(e))},"pipeOnDrainFunctionResult")}i(Ra,"pipeOnDrain");R.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,o=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<o;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var s=dn(t.pipes,e);return s===-1?this:(t.pipes.splice(s,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};R.prototype.on=function(e,t){var r=Oe.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,m("on readable",n.length,n.reading),n.length?Ze(this):n.reading||process.nextTick(Ta,this)),r};R.prototype.addListener=R.prototype.on;R.prototype.removeListener=function(e,t){var r=Oe.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(cn,this),r};R.prototype.removeAllListeners=function(e){var t=Oe.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(cn,this),t};function cn(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}i(cn,"updateReadableListening");function Ta(e){m("readable nexttick read 0"),e.read(0)}i(Ta,"nReadingNextTick");R.prototype.resume=function(){var e=this._readableState;return e.flowing||(m("resume"),e.flowing=!e.readableListening,Oa(this,e)),e.paused=!1,this};function Oa(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(xa,e,t))}i(Oa,"resume");function xa(e,t){m("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Ut(e),t.flowing&&!t.reading&&e.read(0)}i(xa,"resume_");R.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ut(e){var t=e._readableState;for(m("flow",t.flowing);t.flowing&&e.read()!==null;);}i(Ut,"flow");R.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(m("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&t.push(s)}t.push(null)}),e.on("data",function(s){if(m("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var u=t.push(s);u||(n=!0,e.pause())}});for(var o in e)this[o]===void 0&&typeof e[o]=="function"&&(this[o]=i(function(u){return i(function(){return e[u].apply(e,arguments)},"methodWrapReturnFunction")},"methodWrap")(o));for(var a=0;a<It.length;a++)e.on(It[a],this.emit.bind(this,It[a]));return this._read=function(s){m("wrapped _read",s),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(R.prototype[Symbol.asyncIterator]=function(){return Dt===void 0&&(Dt=Qr()),Dt(this)});Object.defineProperty(R.prototype,"readableHighWaterMark",{enumerable:!1,get:i(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(R.prototype,"readableBuffer",{enumerable:!1,get:i(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(R.prototype,"readableFlowing",{enumerable:!1,get:i(function(){return this._readableState.flowing},"get"),set:i(function(t){this._readableState&&(this._readableState.flowing=t)},"set")});R._fromList=hn;Object.defineProperty(R.prototype,"readableLength",{enumerable:!1,get:i(function(){return this._readableState.length},"get")});function hn(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}i(hn,"fromList");function jt(e){var t=e._readableState;m("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(La,t,e))}i(jt,"endReadable");function La(e,t){if(m("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}i(La,"endReadableNT");typeof Symbol=="function"&&(R.from=function(e,t){return qt===void 0&&(qt=nn()),qt(R,e,t)});function dn(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}i(dn,"indexOf")});var Wt=S((Fu,gn)=>{"use strict";c();gn.exports=z;var Qe=K().codes,Pa=Qe.ERR_METHOD_NOT_IMPLEMENTED,ka=Qe.ERR_MULTIPLE_CALLBACK,Na=Qe.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ma=Qe.ERR_TRANSFORM_WITH_LENGTH_0,et=ne();Y()(z,et);function Aa(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new ka);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}i(Aa,"afterTransform");function z(e){if(!(this instanceof z))return new z(e);et.call(this,e),this._transformState={afterTransform:Aa.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Da)}i(z,"Transform");function Da(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yn(e,t,r)}):yn(this,null,null)}i(Da,"prefinish");z.prototype.push=function(e,t){return this._transformState.needTransform=!1,et.prototype.push.call(this,e,t)};z.prototype._transform=function(e,t,r){r(new Pa("_transform()"))};z.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};z.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};z.prototype._destroy=function(e,t){et.prototype._destroy.call(this,e,function(r){t(r)})};function yn(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Ma;if(e._transformState.transforming)throw new Na;return e.push(null)}i(yn,"done")});var mn=S((Hu,vn)=>{"use strict";c();vn.exports=xe;var _n=Wt();Y()(xe,_n);function xe(e){if(!(this instanceof xe))return new xe(e);_n.call(this,e)}i(xe,"PassThrough");xe.prototype._transform=function(e,t,r){r(null,e)}});var Rn=S((Gu,Sn)=>{"use strict";c();var Ht;function qa(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}i(qa,"once");var En=K().codes,Ia=En.ERR_MISSING_ARGS,Ca=En.ERR_STREAM_DESTROYED;function wn(e){if(e)throw e}i(wn,"noop");function ja(e){return e.setHeader&&typeof e.abort=="function"}i(ja,"isRequest");function Ba(e,t,r,n){n=qa(n);var o=!1;e.on("close",function(){o=!0}),Ht===void 0&&(Ht=Ve()),Ht(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var a=!1;return function(s){if(!o&&!a){if(a=!0,ja(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new Ca("pipe"))}}}i(Ba,"destroyer");function bn(e){e()}i(bn,"call");function Fa(e,t){return e.pipe(t)}i(Fa,"pipe");function Ua(e){return!e.length||typeof e[e.length-1]!="function"?wn:e.pop()}i(Ua,"popCallback");function Wa(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Ua(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Ia("streams");var o,a=t.map(function(s,u){var f=u<t.length-1,l=u>0;return Ba(s,f,l,function(g){o||(o=g),g&&a.forEach(bn),!f&&(a.forEach(bn),n(o))})});return t.reduce(Fa)}i(Wa,"pipeline");Sn.exports=Wa});var pe=S((B,Pe)=>{c();var Le=L("stream");process.env.READABLE_STREAM==="disable"&&Le?(Pe.exports=Le.Readable,Object.assign(Pe.exports,Le),Pe.exports.Stream=Le):(B=Pe.exports=xt(),B.Stream=Le||B,B.Readable=B,B.Writable=Rt(),B.Duplex=ne(),B.Transform=Wt(),B.PassThrough=mn(),B.finished=Ve(),B.pipeline=Rn())});var xn=S((Xu,On)=>{"use strict";c();var{Buffer:F}=L("buffer"),Tn=Symbol.for("BufferList");function x(e){if(!(this instanceof x))return new x(e);x._init.call(this,e)}i(x,"BufferList");x._init=i(function(t){Object.defineProperty(this,Tn,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},"_init");x.prototype._new=i(function(t){return new x(t)},"_new");x.prototype._offset=i(function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let o=r+this._bufs[n].length;if(t<o||n===this._bufs.length-1)return[n,t-r];r=o}},"_offset");x.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let n=0;n<t;n++)r+=this._bufs[n].length;return r};x.prototype.get=i(function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},"get");x.prototype.slice=i(function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},"slice");x.prototype.copy=i(function(t,r,n,o){if((typeof n!="number"||n<0)&&(n=0),(typeof o!="number"||o>this.length)&&(o=this.length),n>=this.length||o<=0)return t||F.alloc(0);let a=!!t,s=this._offset(n),u=o-n,f=u,l=a&&r||0,g=s[1];if(n===0&&o===this.length){if(!a)return this._bufs.length===1?this._bufs[0]:F.concat(this._bufs,this.length);for(let d=0;d<this._bufs.length;d++)this._bufs[d].copy(t,l),l+=this._bufs[d].length;return t}if(f<=this._bufs[s[0]].length-g)return a?this._bufs[s[0]].copy(t,r,g,g+f):this._bufs[s[0]].slice(g,g+f);a||(t=F.allocUnsafe(u));for(let d=s[0];d<this._bufs.length;d++){let y=this._bufs[d].length-g;if(f>y)this._bufs[d].copy(t,l,g),l+=y;else{this._bufs[d].copy(t,l,g,g+f),l+=y;break}f-=y,g&&(g=0)}return t.length>l?t.slice(0,l):t},"copy");x.prototype.shallowSlice=i(function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),o=this._offset(r),a=this._bufs.slice(n[0],o[0]+1);return o[1]===0?a.pop():a[a.length-1]=a[a.length-1].slice(0,o[1]),n[1]!==0&&(a[0]=a[0].slice(n[1])),this._new(a)},"shallowSlice");x.prototype.toString=i(function(t,r,n){return this.slice(r,n).toString(t)},"toString");x.prototype.consume=i(function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},"consume");x.prototype.duplicate=i(function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},"duplicate");x.prototype.append=i(function(t){if(t==null)return this;if(t.buffer)this._appendBuffer(F.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let r=0;r<t.length;r++)this.append(t[r]);else if(this._isBufferList(t))for(let r=0;r<t._bufs.length;r++)this.append(t._bufs[r]);else typeof t=="number"&&(t=t.toString()),this._appendBuffer(F.from(t));return this},"append");x.prototype._appendBuffer=i(function(t){this._bufs.push(t),this.length+=t.length},"appendBuffer");x.prototype.indexOf=function(e,t,r){if(r===void 0&&typeof t=="string"&&(r=t,t=void 0),typeof e=="function"||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof e=="number"?e=F.from([e]):typeof e=="string"?e=F.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=F.from(e.buffer,e.byteOffset,e.byteLength):F.isBuffer(e)||(e=F.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),e.length===0)return t>this.length?this.length:t;let n=this._offset(t),o=n[0],a=n[1];for(;o<this._bufs.length;o++){let s=this._bufs[o];for(;a<s.length;)if(s.length-a>=e.length){let f=s.indexOf(e,a);if(f!==-1)return this._reverseOffset([o,f]);a=s.length-e.length+1}else{let f=this._reverseOffset([o,a]);if(this._match(f,e))return f;a++}a=0}return-1};x.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0};(function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)(function(r){e[r]===null?x.prototype[r]=function(n,o){return this.slice(n,n+o)[r](0,o)}:x.prototype[r]=function(n=0){return this.slice(n,n+e[r])[r](0)}})(t)})();x.prototype._isBufferList=i(function(t){return t instanceof x||x.isBufferList(t)},"_isBufferList");x.isBufferList=i(function(t){return t!=null&&t[Tn]},"isBufferList");On.exports=x});var Ln=S((Qu,tt)=>{"use strict";c();var $t=pe().Duplex,Ha=Y(),ke=xn();function N(e){if(!(this instanceof N))return new N(e);if(typeof e=="function"){this._callback=e;let t=i(function(n){this._callback&&(this._callback(n),this._callback=null)},"piper").bind(this);this.on("pipe",i(function(n){n.on("error",t)},"onPipe")),this.on("unpipe",i(function(n){n.removeListener("error",t)},"onUnpipe")),e=null}ke._init.call(this,e),$t.call(this)}i(N,"BufferListStream");Ha(N,$t);Object.assign(N.prototype,ke.prototype);N.prototype._new=i(function(t){return new N(t)},"_new");N.prototype._write=i(function(t,r,n){this._appendBuffer(t),typeof n=="function"&&n()},"_write");N.prototype._read=i(function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},"_read");N.prototype.end=i(function(t){$t.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},"end");N.prototype._destroy=i(function(t,r){this._bufs.length=0,this.length=0,r(t)},"_destroy");N.prototype._isBufferList=i(function(t){return t instanceof N||t instanceof ke||N.isBufferList(t)},"_isBufferList");N.isBufferList=ke.isBufferList;tt.exports=N;tt.exports.BufferListStream=N;tt.exports.BufferList=ke});var Vt=S(ge=>{c();var $a=Buffer.alloc,za="0000000000000000000",Ga="7777777777777777777",Pn=48,kn=Buffer.from("ustar\0","binary"),Va=Buffer.from("00","binary"),Ka=Buffer.from("ustar ","binary"),Ya=Buffer.from(" \0","binary"),Xa=parseInt("7777",8),Ne=257,Gt=263,Ja=i(function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},"clamp"),Za=i(function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},"toType"),Qa=i(function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},"toTypeflag"),Nn=i(function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},"indexOf"),Mn=i(function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},"cksum"),ee=i(function(e,t){return e=e.toString(8),e.length>t?Ga.slice(0,t)+" ":za.slice(0,t-e.length)+e+" "},"encodeOct");function es(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var o=e[n];t?r.push(o):r.push(255-o)}var a=0,s=r.length;for(n=0;n<s;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}i(es,"parse256");var te=i(function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return es(e);for(;t<e.length&&e[t]===32;)t++;for(var n=Ja(Nn(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},"decodeOct"),ye=i(function(e,t,r,n){return e.slice(t,Nn(e,0,t,t+r)).toString(n)},"decodeStr"),zt=i(function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e},"addLength");ge.decodeLongPath=function(e,t){return ye(e,0,e.length,t)};ge.encodePax=function(e){var t="";e.name&&(t+=zt(" path="+e.name+`
|
|
4
4
|
`)),e.linkname&&(t+=zt(" linkpath="+e.linkname+`
|
|
5
5
|
`));var r=e.pax;if(r)for(var n in r)t+=zt(" "+n+"="+r[n]+`
|
|
6
6
|
`);return Buffer.from(t)};ge.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var o=e.slice(r+1,n-1).toString(),a=o.indexOf("=");if(a===-1)return t;t[o.slice(0,a)]=o.slice(a+1),e=e.slice(n)}return t};ge.encode=function(e){var t=$a(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var o=r.indexOf("/");if(o===-1)return null;n+=n?"/"+r.slice(0,o):r.slice(0,o),r=r.slice(o+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(ee(e.mode&Xa,6),100),t.write(ee(e.uid,6),108),t.write(ee(e.gid,6),116),t.write(ee(e.size,11),124),t.write(ee(e.mtime.getTime()/1e3|0,11),136),t[156]=Pn+Qa(e.type),e.linkname&&t.write(e.linkname,157),kn.copy(t,Ne),Va.copy(t,Gt),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ee(e.devmajor||0,6),329),t.write(ee(e.devminor||0,6),337),n&&t.write(n,345),t.write(ee(Mn(t),6),148),t)};ge.decode=function(e,t,r){var n=e[156]===0?0:e[156]-Pn,o=ye(e,0,100,t),a=te(e,100,8),s=te(e,108,8),u=te(e,116,8),f=te(e,124,12),l=te(e,136,12),g=Za(n),d=e[157]===0?null:ye(e,157,100,t),y=ye(e,265,32),_=ye(e,297,32),w=te(e,329,8),T=te(e,337,8),b=Mn(e);if(b===8*32)return null;if(b!==te(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(kn.compare(e,Ne,Ne+6)===0)e[345]&&(o=ye(e,345,155,t)+"/"+o);else if(!(Ka.compare(e,Ne,Ne+6)===0&&Ya.compare(e,Gt,Gt+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&o&&o[o.length-1]==="/"&&(n=5),{name:o,mode:a,uid:s,gid:u,size:f,mtime:new Date(1e3*l),type:g,linkname:d,uname:y,gname:_,devmajor:w,devminor:T}}});var Bn=S((af,jn)=>{c();var Dn=L("util"),ts=Ln(),Me=Vt(),qn=pe().Writable,In=pe().PassThrough,Cn=i(function(){},"noop"),An=i(function(e){return e&=511,e&&512-e},"overflow"),rs=i(function(e,t){var r=new rt(e,t);return r.end(),r},"emptyStream"),ns=i(function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},"mixinPax"),rt=i(function(e,t){this._parent=e,this.offset=t,In.call(this,{autoDestroy:!1})},"Source");Dn.inherits(rt,In);rt.prototype.destroy=function(e){this._parent.destroy(e)};var G=i(function(e){if(!(this instanceof G))return new G(e);qn.call(this,e),e=e||{},this._offset=0,this._buffer=ts(),this._missing=0,this._partial=!1,this._onparse=Cn,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=i(function(){t._continue()},"oncontinue"),o=i(function(y){if(t._locked=!1,y)return t.destroy(y);t._stream||n()},"onunlock"),a=i(function(){t._stream=null;var y=An(t._header.size);y?t._parse(y,s):t._parse(512,d),t._locked||n()},"onstreamend"),s=i(function(){t._buffer.consume(An(t._header.size)),t._parse(512,d),n()},"ondrain"),u=i(function(){var y=t._header.size;t._paxGlobal=Me.decodePax(r.slice(0,y)),r.consume(y),a()},"onpaxglobalheader"),f=i(function(){var y=t._header.size;t._pax=Me.decodePax(r.slice(0,y)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(y),a()},"onpaxheader"),l=i(function(){var y=t._header.size;this._gnuLongPath=Me.decodeLongPath(r.slice(0,y),e.filenameEncoding),r.consume(y),a()},"ongnulongpath"),g=i(function(){var y=t._header.size;this._gnuLongLinkPath=Me.decodeLongPath(r.slice(0,y),e.filenameEncoding),r.consume(y),a()},"ongnulonglinkpath"),d=i(function(){var y=t._offset,_;try{_=t._header=Me.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(w){t.emit("error",w)}if(r.consume(512),!_){t._parse(512,d),n();return}if(_.type==="gnu-long-path"){t._parse(_.size,l),n();return}if(_.type==="gnu-long-link-path"){t._parse(_.size,g),n();return}if(_.type==="pax-global-header"){t._parse(_.size,u),n();return}if(_.type==="pax-header"){t._parse(_.size,f),n();return}if(t._gnuLongPath&&(_.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(_.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=_=ns(_,t._pax),t._pax=null),t._locked=!0,!_.size||_.type==="directory"){t._parse(512,d),t.emit("entry",_,rs(t,y),o);return}t._stream=new rt(t,y),t.emit("entry",_,t._stream,o),t._parse(_.size,a),n()},"onheader");this._onheader=d,this._parse(512,d)},"Extract");Dn.inherits(G,qn);G.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};G.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};G.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=Cn,this._overflow?this._write(this._overflow,void 0,e):e()}};G.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,o=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(o.append(e),r());this._cb=r,this._missing=0;var s=null;e.length>a&&(s=e.slice(a),e=e.slice(0,a)),n?n.end(e):o.append(e),this._overflow=s,this._onparse()}};G.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};jn.exports=G});var Un=S((ff,Fn)=>{c();Fn.exports=L("fs").constants||L("constants")});var $n=S((cf,Hn)=>{c();Hn.exports=Wn;function Wn(e,t){if(e&&t)return Wn(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),o=0;o<n.length;o++)n[o]=arguments[o];var a=e.apply(this,n),s=n[n.length-1];return typeof a=="function"&&a!==s&&Object.keys(s).forEach(function(u){a[u]=s[u]}),a}i(r,"wrapper")}i(Wn,"wrappy")});var Yt=S((pf,Kt)=>{c();var zn=$n();Kt.exports=zn(nt);Kt.exports.strict=zn(Gn);nt.proto=nt(function(){Object.defineProperty(Function.prototype,"once",{value:i(function(){return nt(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:i(function(){return Gn(this)},"value"),configurable:!0})});function nt(e){var t=i(function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))},"f");return t.called=!1,t}i(nt,"once");function Gn(e){var t=i(function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},"f"),r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}i(Gn,"onceStrict")});var Xt=S((_f,Kn)=>{c();var is=Yt(),os=i(function(){},"noop"),as=global.Bare?queueMicrotask:process.nextTick.bind(process),ss=i(function(e){return e.setHeader&&typeof e.abort=="function"},"isRequest"),us=i(function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},"isChildProcess"),Vn=i(function(e,t,r){if(typeof t=="function")return Vn(e,null,t);t||(t={}),r=is(r||os);var n=e._writableState,o=e._readableState,a=t.readable||t.readable!==!1&&e.readable,s=t.writable||t.writable!==!1&&e.writable,u=!1,f=i(function(){e.writable||l()},"onlegacyfinish"),l=i(function(){s=!1,a||r.call(e)},"onfinish"),g=i(function(){a=!1,s||r.call(e)},"onend"),d=i(function(b){r.call(e,b?new Error("exited with error code: "+b):null)},"onexit"),y=i(function(b){r.call(e,b)},"onerror"),_=i(function(){as(w)},"onclose"),w=i(function(){if(!u){if(a&&!(o&&o.ended&&!o.destroyed))return r.call(e,new Error("premature close"));if(s&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},"onclosenexttick"),T=i(function(){e.req.on("finish",l)},"onrequest");return ss(e)?(e.on("complete",l),e.on("abort",_),e.req?T():e.on("request",T)):s&&!n&&(e.on("end",f),e.on("close",f)),us(e)&&e.on("exit",d),e.on("end",g),e.on("finish",l),t.error!==!1&&e.on("error",y),e.on("close",_),function(){u=!0,e.removeListener("complete",l),e.removeListener("abort",_),e.removeListener("request",T),e.req&&e.req.removeListener("finish",l),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",l),e.removeListener("exit",d),e.removeListener("end",g),e.removeListener("error",y),e.removeListener("close",_)}},"eos");Kn.exports=Vn});var Qn=S((wf,Zn)=>{c();var _e=Un(),Yn=Xt(),ot=Y(),fs=Buffer.alloc,Xn=pe().Readable,ve=pe().Writable,ls=L("string_decoder").StringDecoder,it=Vt(),cs=parseInt("755",8),hs=parseInt("644",8),Jn=fs(1024),Zt=i(function(){},"noop"),Jt=i(function(e,t){t&=511,t&&e.push(Jn.slice(0,512-t))},"overflow");function ds(e){switch(e&_e.S_IFMT){case _e.S_IFBLK:return"block-device";case _e.S_IFCHR:return"character-device";case _e.S_IFDIR:return"directory";case _e.S_IFIFO:return"fifo";case _e.S_IFLNK:return"symlink"}return"file"}i(ds,"modeToType");var at=i(function(e){ve.call(this),this.written=0,this._to=e,this._destroyed=!1},"Sink");ot(at,ve);at.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};at.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var st=i(function(){ve.call(this),this.linkname="",this._decoder=new ls("utf-8"),this._destroyed=!1},"LinkSink");ot(st,ve);st.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};st.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Ae=i(function(){ve.call(this),this._destroyed=!1},"Void");ot(Ae,ve);Ae.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};Ae.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var H=i(function(e){if(!(this instanceof H))return new H(e);Xn.call(this,e),this._drain=Zt,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null},"Pack");ot(H,Xn);H.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=Zt);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=ds(e.mode)),e.mode||(e.mode=e.type==="directory"?cs:hs),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var o=this.push(t);return Jt(n,e.size),o?process.nextTick(r):this._drain=r,new Ae}if(e.type==="symlink"&&!e.linkname){var a=new st;return Yn(a,function(u){if(u)return n.destroy(),r(u);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new Ae;var s=new at(this);return this._stream=s,Yn(s,function(u){if(n._stream=null,u)return n.destroy(),r(u);if(s.written!==e.size)return n.destroy(),r(new Error("size mismatch"));Jt(n,e.size),n._finalizing&&n.finalize(),r()}),s}};H.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Jn),this.push(null))};H.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};H.prototype._encode=function(e){if(!e.pax){var t=it.encode(e);if(t){this.push(t);return}}this._encodePax(e)};H.prototype._encodePax=function(e){var t=it.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(it.encode(r)),this.push(t),Jt(this,t.length),r.size=e.size,r.type=e.type,this.push(it.encode(r))};H.prototype._read=function(e){var t=this._drain;this._drain=Zt,t()};Zn.exports=H});var ei=S(Qt=>{c();Qt.extract=Bn();Qt.pack=Qn()});var ni=S((Tf,ri)=>{c();var ps=Yt(),ys=Xt(),ut;try{ut=L("fs")}catch{}var De=i(function(){},"noop"),gs=typeof process>"u"?!1:/^v?\.0/.test(process.version),ft=i(function(e){return typeof e=="function"},"isFn"),_s=i(function(e){return!gs||!ut?!1:(e instanceof(ut.ReadStream||De)||e instanceof(ut.WriteStream||De))&&ft(e.close)},"isFS"),vs=i(function(e){return e.setHeader&&ft(e.abort)},"isRequest"),ms=i(function(e,t,r,n){n=ps(n);var o=!1;e.on("close",function(){o=!0}),ys(e,{readable:t,writable:r},function(s){if(s)return n(s);o=!0,n()});var a=!1;return function(s){if(!o&&!a){if(a=!0,_s(e))return e.close(De);if(vs(e))return e.abort();if(ft(e.destroy))return e.destroy();n(s||new Error("stream was destroyed"))}}},"destroyer"),ti=i(function(e){e()},"call"),ws=i(function(e,t){return e.pipe(t)},"pipe"),bs=i(function(){var e=Array.prototype.slice.call(arguments),t=ft(e[e.length-1]||De)&&e.pop()||De;if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Error("pump requires two streams per minimum");var r,n=e.map(function(o,a){var s=a<e.length-1,u=a>0;return ms(o,s,u,function(f){r||(r=f),f&&n.forEach(ti),!s&&(n.forEach(ti),t(r))})});return e.reduce(ws)},"pump");ri.exports=bs});var si=S((Lf,ai)=>{c();var lt=L("path"),ii=L("fs"),oi=parseInt("0777",8);ai.exports=me.mkdirp=me.mkdirP=me;function me(e,t,r,n){typeof t=="function"?(r=t,t={}):(!t||typeof t!="object")&&(t={mode:t});var o=t.mode,a=t.fs||ii;o===void 0&&(o=oi&~process.umask()),n||(n=null);var s=r||function(){};e=lt.resolve(e),a.mkdir(e,o,function(u){if(!u)return n=n||e,s(null,n);switch(u.code){case"ENOENT":me(lt.dirname(e),t,function(f,l){f?s(f,l):me(e,t,s,l)});break;default:a.stat(e,function(f,l){f||!l.isDirectory()?s(u,n):s(null,n)});break}})}i(me,"mkdirP");me.sync=i(function e(t,r,n){(!r||typeof r!="object")&&(r={mode:r});var o=r.mode,a=r.fs||ii;o===void 0&&(o=oi&~process.umask()),n||(n=null),t=lt.resolve(t);try{a.mkdirSync(t,o),n=n||t}catch(u){switch(u.code){case"ENOENT":n=e(lt.dirname(t),r,n),e(t,r,n);break;default:var s;try{s=a.statSync(t)}catch{throw u}if(!s.isDirectory())throw u;break}}return n},"sync")});var gi=S(nr=>{c();var Es=mr(),fi=ei(),li=ni(),Ss=si(),ci=L("fs"),P=L("path"),Rs=L("os"),qe=Rs.platform()==="win32",Ie=i(function(){},"noop"),rr=i(function(e){return e},"echo"),er=qe?function(e){return e.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:rr,Ts=i(function(e,t,r,n,o,a){for(var s=o||["."],u=0;u<s.length;u++)if(!tr(P.resolve(r,s[u]),r))throw new Error(s[u]+" is not a valid path");return i(function(l){if(!s.length)return l();var g=s.shift(),d=P.join(r,g);t.call(e,d,function(y,_){if(y)return l(y);if(!_.isDirectory())return l(null,g,_);e.readdir(d,function(w,T){if(w)return l(w);a&&T.sort();for(var b=0;b<T.length;b++)n(P.join(r,g,T[b]))||s.push(P.join(g,T[b]));l(null,g,_)})})},"loop")},"statAll"),hi=i(function(e,t){return function(r){r.name=r.name.split("/").slice(t).join("/");var n=r.linkname;return n&&(r.type==="link"||P.isAbsolute(n))&&(r.linkname=n.split("/").slice(t).join("/")),e(r)}},"strip");nr.pack=function(e,t){e||(e="."),t||(t={});var r=t.fs||ci,n=t.ignore||t.filter||Ie,o=t.map||Ie,a=t.mapStream||rr,s=Ts(r,t.dereference?r.stat:r.lstat,e,n,t.entries,t.sort),u=t.strict!==!1,f=typeof t.umask=="number"?~t.umask:~di(),l=typeof t.dmode=="number"?t.dmode:0,g=typeof t.fmode=="number"?t.fmode:0,d=t.pack||fi.pack(),y=t.finish||Ie;t.strip&&(o=hi(o,t.strip)),t.readable&&(l|=parseInt(555,8),g|=parseInt(444,8)),t.writable&&(l|=parseInt(333,8),g|=parseInt(222,8));var _=i(function(b,p){r.readlink(P.join(e,b),function(v,h){if(v)return d.destroy(v);p.linkname=er(h),d.entry(p,T)})},"onsymlink"),w=i(function(b,p,v){if(b)return d.destroy(b);if(!p)return t.finalize!==!1&&d.finalize(),y(d);if(v.isSocket())return T();var h={name:er(p),mode:(v.mode|(v.isDirectory()?l:g))&f,mtime:v.mtime,size:v.size,type:"file",uid:v.uid,gid:v.gid};if(v.isDirectory())return h.size=0,h.type="directory",h=o(h)||h,d.entry(h,T);if(v.isSymbolicLink())return h.size=0,h.type="symlink",h=o(h)||h,_(p,h);if(h=o(h)||h,!v.isFile())return u?d.destroy(new Error("unsupported type for "+p)):T();var O=d.entry(h,T);if(O){var A=a(r.createReadStream(P.join(e,p),{start:0,end:h.size>0?h.size-1:h.size}),h);A.on("error",function(V){O.destroy(V)}),li(A,O)}},"onstat"),T=i(function(b){if(b)return d.destroy(b);s(w)},"onnextentry");return T(),d};var Os=i(function(e){return e.length?e[e.length-1]:null},"head"),xs=i(function(){return process.getuid?process.getuid():-1},"processGetuid"),di=i(function(){return process.umask?process.umask():0},"processUmask");nr.extract=function(e,t){e||(e="."),t||(t={});var r=t.fs||ci,n=t.ignore||t.filter||Ie,o=t.map||Ie,a=t.mapStream||rr,s=t.chown!==!1&&!qe&&xs()===0,u=t.extract||fi.extract(),f=[],l=new Date,g=typeof t.umask=="number"?~t.umask:~di(),d=typeof t.dmode=="number"?t.dmode:0,y=typeof t.fmode=="number"?t.fmode:0,_=t.strict!==!1;t.strip&&(o=hi(o,t.strip)),t.readable&&(d|=parseInt(555,8),y|=parseInt(444,8)),t.writable&&(d|=parseInt(333,8),y|=parseInt(222,8));var w=i(function(p,v){for(var h;(h=Os(f))&&p.slice(0,h[0].length)!==h[0];)f.pop();if(!h)return v();r.utimes(h[0],l,h[1],v)},"utimesParent"),T=i(function(p,v,h){if(t.utimes===!1)return h();if(v.type==="directory")return r.utimes(p,l,v.mtime,h);if(v.type==="symlink")return w(p,h);r.utimes(p,l,v.mtime,function(O){if(O)return h(O);w(p,h)})},"utimes"),b=i(function(p,v,h){var O=v.type==="symlink",A=O?r.lchmod:r.chmod,V=O?r.lchown:r.chown;if(!A)return h();var ct=(v.mode|(v.type==="directory"?d:y))&g&parseInt(777,8);V&&s?V.call(r,p,v.uid,v.gid,we):we(null);function we(ue){if(ue)return h(ue);if(!A)return h();A.call(r,p,ct,h)}i(we,"onchown")},"chperm");return u.on("entry",function(p,v,h){p=o(p)||p,p.name=er(p.name);var O=P.join(e,P.join("/",p.name));if(n(O,p))return v.resume(),h();var A=i(function(D){if(D)return h(D);if(P.join(O,".")===P.join(e,"."))return h();T(O,p,function(q){if(q)return h(q);if(qe)return h();b(O,p,h)})},"stat"),V=i(function(){if(qe)return h();r.unlink(O,function(){var D=P.resolve(P.dirname(O),p.linkname);if(!tr(D,e))return h(new Error(O+" is not a valid symlink"));yi(r,D,P.resolve(e),function(q,I){if(q)return h(q);if(!I)return h(new Error(O+" is not a valid symlink"));r.symlink(p.linkname,O,A)})})},"onsymlink"),ct=i(function(){if(qe)return h();r.unlink(O,function(){var D=P.join(e,P.join("/",p.linkname));r.realpath(D,function(q,I){if(q||!tr(I,e))return h(new Error(O+" is not a valid hardlink"));r.link(I,O,function(fe){if(fe&&fe.code==="EPERM"&&t.hardlinkAsFilesFallback)return v=r.createReadStream(D),we();A(fe)})})})},"onlink"),we=i(function(){r.lstat(O,function(q,I){if(!q&&I.isSymbolicLink())return r.unlink(O,D);D()});function D(q){if(q)return h(q);var I=r.createWriteStream(O),fe=a(v,p);I.on("error",function(je){fe.destroy(je)}),li(fe,I,function(je){if(je)return h(je);I.on("close",A)})}i(D,"onwrite")},"onfile");if(p.type==="directory")return f.push([O,p.mtime]),ui(O,{fs:r,own:s,uid:p.uid,gid:p.gid},A);var ue=P.dirname(O);pi(r,ue,P.join(e,"."),function(D,q){if(D)return h(D);if(!q)return h(new Error(ue+" is not a valid path"));ui(ue,{fs:r,own:s,uid:p.uid,gid:p.gid},function(I){if(I)return h(I);switch(p.type){case"file":return we();case"link":return ct();case"symlink":return V()}if(_)return h(new Error("unsupported type for "+O+" ("+p.type+")"));v.resume(),h()})})}),t.finish&&u.on("finish",t.finish),u};function pi(e,t,r,n){if(t===r)return n(null,!0);e.lstat(t,function(o,a){if(o&&o.code!=="ENOENT")return n(o);if(o||a.isDirectory())return pi(e,P.join(t,".."),r,n);n(null,!1)})}i(pi,"validate");function yi(e,t,r,n){if(t===r)return n(null,!0);if(!t.startsWith(r+P.sep))return n(null,!1);e.lstat(t,function(o,a){if(o&&o.code!=="ENOENT"&&o.code!=="EPERM")return n(o);if(o||!a.isSymbolicLink())return yi(e,P.join(t,".."),r,n);n(null,!1)})}i(yi,"validateNotSymlink");function ui(e,t,r){Ss(e,{fs:t.fs},function(n,o){!n&&o&&t.own?Es(o,t.uid,t.gid,r):r(n)})}i(ui,"mkdirfix");function tr(e,t){return t=P.resolve(t),t===e||e.startsWith(t+P.sep)}i(tr,"inCwd")});c();var Ti=Pi(gi(),1);import{createHash as Ps}from"node:crypto";import{readFileSync as Ei}from"node:fs";import*as Si from"node:os";import*as $ from"node:path";import{PassThrough as vi,Readable as Ri}from"node:stream";import{StringDecoder as ks}from"node:string_decoder";c();import{createRequire as Ls}from"node:module";function _i(){return Ls(import.meta.url)("dockerode")}i(_i,"loadDockerode");function Ns(){return process.env.NODE_TEST_CONTEXT&&!process.env.WERKMEISTER_DOCKER_ENGINE?(process.stderr.write(`Docker engine reached in a test without useDockerEngine() (fixtures.mjs); using a dead socket
|
|
@@ -12,4 +12,4 @@ import{l as cr,m as hr}from"./chunk-AF2X5LK6.js";import{b as or,c as ar,d as sr,
|
|
|
12
12
|
safe-buffer/index.js:
|
|
13
13
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
14
14
|
*/
|
|
15
|
-
//# sourceMappingURL=chunk-
|
|
15
|
+
//# sourceMappingURL=chunk-2CNYFUAA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{a as s,f as c}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as s,f as c}from"./chunk-NW56IEMZ.js";c();function t(e=process.env){let r=e.WERKMEISTER_LAUNCHER;return r==="vscode"||r==="terminal"?r:e.CLAUDE_CODE_ENTRYPOINT==="claude-vscode"||e.TERM_PROGRAM==="vscode"?"vscode":"terminal"}s(t,"claudeLauncher");var n="vscode://jbbz.werkmeister-vscode";function i(e){let r=new URLSearchParams({workspace:e.workspace,mode:e.sessionId?"resume":"new"});return e.sessionId&&r.set("session",e.sessionId),e.prompt&&r.set("prompt",e.prompt),`${n}/claude?${r}`}s(i,"claudeLaunchUri");function a(e){return`${n}/reconcile?${new URLSearchParams({slug:e})}`}s(a,"reconcileLaunchUri");export{t as a,i as b,a as c};
|
|
4
|
+
//# sourceMappingURL=chunk-2OZ3J23R.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{n as C,r as M}from"./chunk-
|
|
3
|
+
import{n as C,r as M}from"./chunk-Z5B5JN3T.js";import{a as j,h as B,j as b,m as x,n as S}from"./chunk-RDY6H5F3.js";import{b as I}from"./chunk-TSEX5HWM.js";import{a as i,e as L,f as F}from"./chunk-NW56IEMZ.js";F();var _=L(j(),1);import{spawn as W}from"node:child_process";import*as k from"node:crypto";import*as p from"node:fs";import*as v from"node:net";import*as R from"node:os";import*as P from"node:path";function N(){return`.${M().local_domain.replace(/^\.+/,"")}`}i(N,"cookieDomain");var y={chrome:{label:"Google Chrome",engine:"chromium",macPath:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"},chromium:{label:"Chromium",engine:"chromium",macPath:"/Applications/Chromium.app/Contents/MacOS/Chromium"},brave:{label:"Brave Browser",engine:"chromium",macPath:"/Applications/Brave Browser.app/Contents/MacOS/Brave Browser"},edge:{label:"Microsoft Edge",engine:"chromium",macPath:"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"},firefox:{label:"Firefox",engine:"gecko",macPath:"/Applications/Firefox.app/Contents/MacOS/firefox"},safari:{label:"Safari",engine:"webkit",macPath:"/Applications/Safari.app/Contents/MacOS/Safari"},duckduckgo:{label:"DuckDuckGo",engine:"webkit",macPath:"/Applications/DuckDuckGo.app/Contents/MacOS/DuckDuckGo"}},A="chrome",oe={key:"browser",label:"Browser for `werkmeister feature open`",help:"Chromium browsers (chrome, chromium, brave, edge) work via CDP; safari works via Apple's bundled safaridriver. Firefox/DuckDuckGo are listed for visibility but aren't wired up yet.",acceptEmpty:!1,pattern:`(${Object.keys(y).join("|")})`,placeholder:A,choicesFn:i(()=>Object.keys(y),"choicesFn")};function H(){if(process.env.CHROME_BIN)return process.env.CHROME_BIN;let s=C().overrides??{};if(s.browser_path)return s.browser_path;let t=s.browser||A,e=y[t];if(!e)return x(`Unknown overrides.browser '${t}' -- choices: ${Object.keys(y).join(", ")}`),null;if(e.engine!=="chromium"){let o=e.engine==="webkit"?"WebKit":"Gecko",r=Object.keys(y).filter(n=>y[n].engine==="chromium");return x(`${e.label} uses ${o}, not Chromium -- \`werkmeister feature open\` only speaks the Chrome DevTools Protocol, which just Chromium-based browsers support. Run \`werkmeister machine setup\` and pick one of: ${r.join(", ")}.`),null}return e.macPath}i(H,"resolveBrowserBinary");function $(s){return new Promise(t=>setTimeout(t,s))}i($,"sleep");var O=class s{static{i(this,"WS")}host;port;sock;fatalError=null;rxbuf=Buffer.alloc(0);nextId=0;pending=[];handler=null;set onMessage(t){if(this.handler=t,t)for(;this.pending.length;)t(this.pending.shift())}constructor(t,e,o){this.sock=t,this.host=e,this.port=o}static connect(t){let e=new URL(t),o=e.hostname,r=e.port?parseInt(e.port,10):80,n=e.pathname||"/";return e.search&&(n+=e.search),new Promise((a,l)=>{let c=v.createConnection({host:o,port:r}),u=new s(c,o,r),d=!1,f=Buffer.alloc(0);c.setTimeout(1e4,()=>c.destroy(new Error("websocket handshake timed out"))),c.on("error",h=>{d?u.fatalError||(u.fatalError=h):l(h)}),c.on("close",()=>{d?u.fatalError||(u.fatalError=new Error("websocket closed by peer")):l(new Error("websocket handshake failed (closed)"))});let m=i(h=>{f=Buffer.concat([f,h]);let w=f.indexOf(`\r
|
|
4
4
|
\r
|
|
5
5
|
`);if(w===-1)return;if(!f.subarray(0,f.indexOf(`\r
|
|
6
6
|
`)).toString("latin1").includes(" 101 ")){c.destroy(),l(new Error(`websocket handshake failed: ${f.subarray(0,80).toString("latin1")}`));return}u.rxbuf=f.subarray(w+4),c.setTimeout(0),c.off("data",m),c.on("data",g=>{u.rxbuf=Buffer.concat([u.rxbuf,g]),u.pump()}),d=!0,a(u),u.pump()},"onHandshakeData");c.on("data",m),c.on("connect",()=>{let h=k.randomBytes(16).toString("base64"),w=`GET ${n} HTTP/1.1\r
|
|
@@ -37,9 +37,9 @@ Sec-WebSocket-Version: 13\r
|
|
|
37
37
|
tick();
|
|
38
38
|
setInterval(tick,1000); // self-heal across SPA route changes
|
|
39
39
|
})();
|
|
40
|
-
`}i(J,"badgeScript");function K(){return new Promise((s,t)=>{let e=v.createServer();e.once("error",t),e.listen(0,"127.0.0.1",()=>{let o=e.address().port;e.close(()=>s(o))})})}i(K,"findFreePort");async function q(s,t=15){let e=Date.now()+t*1e3,o=null;for(;Date.now()<e;)try{return(await(await fetch(`http://127.0.0.1:${s}/json/version`,{signal:AbortSignal.timeout(2e3)})).json()).webSocketDebuggerUrl}catch(r){o=r,await $(250)}throw new Error(`Chrome debug endpoint never came up on :${s} (${o})`)}i(q,"waitForBrowserWs");var T=class{static{i(this,"FeatureSession")}ws;feature;url;script;procExited;shouldStop;configured=new Set;cookieSet=!1;navigated=!1;constructor(t,e,o,r,n,a){this.ws=t,this.feature=e,this.url=r,this.script=J(e,o),this.procExited=n,this.shouldStop=a}configureTarget(t){this.cookieSet||(this.ws.send("Network.enable",null,t),this.ws.send("Network.setCookie",{name:"X-Feature",value:this.feature,domain:N(),path:"/",secure:!0,sameSite:"Lax"},t),this.cookieSet=!0),this.ws.send("Page.enable",null,t),this.ws.send("Page.addScriptToEvaluateOnNewDocument",{source:this.script},t),this.ws.send("Runtime.evaluate",{expression:this.script},t),this.navigated||(this.ws.send("Page.navigate",{url:this.url},t),this.navigated=!0)}onEvent(t){if(t?.method!=="Target.attachedToTarget")return;let e=t.params,o=e.sessionId;if(e.targetInfo?.type==="page"&&!this.configured.has(o)){this.configured.add(o);try{this.configureTarget(o)}catch(r){x(`could not configure tab: ${r instanceof Error?r.message:r}`)}}}async start(t=15e3){this.ws.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),this.ws.onMessage=o=>this.onEvent(o);let e=Date.now()+t;for(;!this.navigated;){if(this.ws.fatalError)throw this.ws.fatalError;if(this.procExited()||Date.now()>e)return!1;await $(50)}return!0}async poll(){for(;!this.procExited()&&!this.shouldStop();){if(this.ws.fatalError)throw this.ws.fatalError;await $(1e3)}}};function X(){if(process.env.CHROME_BIN)return!1;let s=C().overrides??{};return s.browser_path?!1:(s.browser||A)==="safari"}i(X,"wantsSafari");async function ne(s,t,e={}){if(X()){let{launchSafariWindow:o}=await import("./safari-
|
|
40
|
+
`}i(J,"badgeScript");function K(){return new Promise((s,t)=>{let e=v.createServer();e.once("error",t),e.listen(0,"127.0.0.1",()=>{let o=e.address().port;e.close(()=>s(o))})})}i(K,"findFreePort");async function q(s,t=15){let e=Date.now()+t*1e3,o=null;for(;Date.now()<e;)try{return(await(await fetch(`http://127.0.0.1:${s}/json/version`,{signal:AbortSignal.timeout(2e3)})).json()).webSocketDebuggerUrl}catch(r){o=r,await $(250)}throw new Error(`Chrome debug endpoint never came up on :${s} (${o})`)}i(q,"waitForBrowserWs");var T=class{static{i(this,"FeatureSession")}ws;feature;url;script;procExited;shouldStop;configured=new Set;cookieSet=!1;navigated=!1;constructor(t,e,o,r,n,a){this.ws=t,this.feature=e,this.url=r,this.script=J(e,o),this.procExited=n,this.shouldStop=a}configureTarget(t){this.cookieSet||(this.ws.send("Network.enable",null,t),this.ws.send("Network.setCookie",{name:"X-Feature",value:this.feature,domain:N(),path:"/",secure:!0,sameSite:"Lax"},t),this.cookieSet=!0),this.ws.send("Page.enable",null,t),this.ws.send("Page.addScriptToEvaluateOnNewDocument",{source:this.script},t),this.ws.send("Runtime.evaluate",{expression:this.script},t),this.navigated||(this.ws.send("Page.navigate",{url:this.url},t),this.navigated=!0)}onEvent(t){if(t?.method!=="Target.attachedToTarget")return;let e=t.params,o=e.sessionId;if(e.targetInfo?.type==="page"&&!this.configured.has(o)){this.configured.add(o);try{this.configureTarget(o)}catch(r){x(`could not configure tab: ${r instanceof Error?r.message:r}`)}}}async start(t=15e3){this.ws.send("Target.setAutoAttach",{autoAttach:!0,waitForDebuggerOnStart:!1,flatten:!0}),this.ws.onMessage=o=>this.onEvent(o);let e=Date.now()+t;for(;!this.navigated;){if(this.ws.fatalError)throw this.ws.fatalError;if(this.procExited()||Date.now()>e)return!1;await $(50)}return!0}async poll(){for(;!this.procExited()&&!this.shouldStop();){if(this.ws.fatalError)throw this.ws.fatalError;await $(1e3)}}};function X(){if(process.env.CHROME_BIN)return!1;let s=C().overrides??{};return s.browser_path?!1:(s.browser||A)==="safari"}i(X,"wantsSafari");async function ne(s,t,e={}){if(X()){let{launchSafariWindow:o}=await import("./safari-NTMZA4NA.js");return o(s,t,e)}return V(s,t,e)}i(ne,"launchFeatureWindow");async function V(s,t,e={}){let o=e.size??"1440,900",r=e.position??null,n=H();if(!n)return null;if(!p.existsSync(n))return x(`Browser not found at ${n} (set CHROME_BIN, or overrides.browser_path in config.yaml, to override -- or run \`werkmeister machine setup\` to pick an installed browser)`),null;let a=z(s),l=await K(),c=p.mkdtempSync(P.join(R.tmpdir(),`chrome-${s}-`));if(!r){let g=Number(G(s)%8n)*40;r=`${60+g},${60+g}`}let u=[`--user-data-dir=${c}`,`--remote-debugging-port=${l}`,"--no-first-run","--no-default-browser-check","--new-window",`--window-size=${o}`,`--window-position=${r}`,"about:blank"],d=W(n,u,{stdio:"ignore",detached:!0});d.unref();let f=!1;d.on("exit",()=>{f=!0});let m=null;async function h(){m?.close();try{d.kill()}catch{}if(!f&&!await new Promise(D=>{let U=setTimeout(()=>D(!1),5e3);d.once("exit",()=>{clearTimeout(U),D(!0)})}))try{d.kill("SIGKILL")}catch{}p.rmSync(c,{recursive:!0,force:!0})}i(h,"cleanup");let w,E=!1;try{if(m=await O.connect(await q(l)),w=new T(m,s,a,t,()=>f,()=>E),!await w.start())return x("The browser window never came up \u2014 nothing was tagged."),await h(),null}catch(g){throw await h(),g}return S(`
|
|
41
41
|
`),b(`Feature : ${s}`),b(`Cookie : X-Feature=${s} (domain ${N()})`),b(`Badge : ${a}`),b(`URL : ${t}`),b(`Profile : ${c} (throwaway)`),S(`
|
|
42
42
|
Window is tagged ${B.BOLD}[${s}]${B.RESET} in the title bar + corner badge.
|
|
43
43
|
`),{stop:i(()=>{E=!0},"stop"),async supervise(){try{return await w.poll(),E?(S(`
|
|
44
44
|
`),b("Closing feature window\u2026"),130):0}finally{await h()}}}}i(V,"launchChromiumWindow");function se(s){for(let t of["workspace.yml","workspace.yaml"]){let e=P.join(I(s),t);if(!(p.existsSync(e)&&p.statSync(e).isFile()))continue;let o;try{o=(0,_.parse)(p.readFileSync(e,"utf8"))}catch{return{}}return o&&typeof o=="object"&&!Array.isArray(o)?o:{}}return{}}i(se,"readWorkspaceYaml");export{N as a,y as b,A as c,oe as d,$ as e,z as f,J as g,K as h,ne as i,se as j};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
45
|
+
//# sourceMappingURL=chunk-2X6AXXB5.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{l as w,m as S}from"./chunk-
|
|
3
|
+
import{l as w,m as S}from"./chunk-NI4SD5KN.js";import{b as F}from"./chunk-O3AIZBOX.js";import{X as T,aa as C,j as m,k as b,l as g,m as y}from"./chunk-RDY6H5F3.js";import{b as D}from"./chunk-TSEX5HWM.js";import{a as s,f as A}from"./chunk-NW56IEMZ.js";A();import{spawn as X}from"node:child_process";import*as o from"node:fs";import*as G from"node:net";import*as M from"node:os";import*as u from"node:path";var $={label:"Workspaces dashboard",dir:"werkmeister-dashboard",port:3001,stem:"mcp-server",entry:"dist/main.js",buildRef:"dist/main.js",bundled:"dist/dashboard.js"},H={label:"Werkmeister MCP server",dir:"werkmeister-mcp",get port(){return F()},stem:"sandbox-mcp",entry:"dist/main.js",buildRef:"dist/main.js",bundled:"dist/mcp.js",env:{HOST:"0.0.0.0"}},k="com.werkmeister.daemon";function Y(t=M.homedir()){return u.join(t,"Library","LaunchAgents",`${k}.plist`)}s(Y,"daemonPlistPath");function B(t){return t===H&&process.platform==="darwin"&&o.existsSync(Y())}s(B,"launchdOwns");function Z(t,e){let r=`gui/${process.getuid?.()??0}/${k}`,n=S(["launchctl","kickstart",...e?["-k"]:[],r],{capture:!0,timeout:15});return n.status!==0?(y(`launchctl kickstart ${r} failed: ${(n.stderr||n.stdout).trim()}`),!1):(b(`${t.label} ${e?"restarted":"started"} by launchd (${k})`),!0)}s(Z,"kickstart");var O=[$,H];function v(t){return new Promise(e=>setTimeout(e,t*1e3))}s(v,"sleep");async function _(t){let e;try{e=S(["lsof","-ti",`tcp:${t}`,"-sTCP:LISTEN"],{capture:!0,timeout:5}).stdout}catch(n){if(n instanceof w&&(n.code==="ENOENT"||n.code==="ETIMEDOUT"))return;throw n}let r=e.split(/\s+/).map(n=>n.trim()).filter(n=>/^\d+$/.test(n)).map(n=>Number.parseInt(n,10));for(let n of r)try{process.kill(n,"SIGTERM")}catch{}if(r.length!==0){for(let n=0;n<20;n++){if(!await W(t))return;await v(.25)}for(let n of r)try{process.kill(n,"SIGKILL")}catch{}}}s(_,"freePort");function K(){let t=D(M.homedir());return o.mkdirSync(t,{recursive:!0}),t}s(K,"stateDir");function p(t){return u.join(K(),`${t.stem}.pid`)}s(p,"pidFile");function tt(t){return u.join(K(),`${t.stem}.log`)}s(tt,"logFile");function I(t){return u.join(C(),"apps",t.dir)}s(I,"appDir");function et(t,e){let r=e.lastIndexOf("/"),n=r>=0?u.join(t,e.slice(0,r)):t,i=r>=0?e.slice(r+1):e,c=new RegExp("^"+i.split("*").map(d=>d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")+"$"),f;try{f=o.readdirSync(n,{withFileTypes:!0})}catch{return[]}return f.filter(d=>c.test(d.name)).map(d=>u.join(n,d.name))}s(et,"globMatch");function rt(t){let e=I(t),r=u.join(e,t.buildRef),n;try{let c=o.statSync(r);if(!c.isFile())return!0;n=c.mtimeMs}catch{return!0}let i=["*.ts","*.html","package.json","tsconfig*.json","src/*.ts","src/*.css","src/lib/*.ts"];for(let c of i)for(let f of et(e,c))try{if(o.statSync(f).mtimeMs>n)return!0}catch{}return!1}s(rt,"distStale");function nt(t,e){try{return o.statSync(e).mtimeMs>o.statSync(p(t)).mtimeMs}catch{return!1}}s(nt,"buildNewerThanRunning");function st(t){let e;try{e=o.readFileSync(p(t),"utf8")}catch{return null}let r=e.trim();return/^[+-]?\d+$/.test(r)?Number.parseInt(r,10):null}s(st,"readPid");function U(t){try{process.kill(t,0)}catch(e){let r=e.code;if(r==="ESRCH")return!1;if(r==="EPERM")return!0;throw e}return!0}s(U,"alive");function W(t){return new Promise(e=>{let r=G.connect({host:"127.0.0.1",port:t}),n=s(i=>{r.destroy(),e(i)},"done");r.setTimeout(1e3,()=>n(!1)),r.once("connect",()=>n(!0)),r.once("error",()=>n(!1))})}s(W,"portOpen");async function P(t){try{let e=await fetch(`http://127.0.0.1:${t}/__werkmeister-health`,{method:"POST",headers:{"Content-Type":"application/json"},body:"{}",signal:AbortSignal.timeout(2e3)});return e.status!==400&&e.status<500}catch{return!1}}s(P,"serves");function L(t=$){let e=st(t);return e&&U(e)?[!0,e]:[!1,null]}s(L,"isRunning");async function dt(t=$){let[e,r]=L(t);return{running:e,pid:r,port:t.port,url:`http://localhost:${t.port}/`,healthy:e&&await P(t.port)}}s(dt,"status");function q(t){let e=I(t);if(o.existsSync(u.join(e,"package.json")))return{dir:e,entry:t.entry,bundled:!1};let r=t.bundled?u.join(T(),t.bundled):null;return!r||!o.existsSync(r)?null:{dir:T(),entry:r,bundled:!0}}s(q,"appEntry");function mt(t){let e=q(t);return e?u.resolve(e.dir,e.entry):void 0}s(mt,"appEntryPath");async function z(t=$,e=!0,r=!1){let[n,i]=L(t);if(n&&i===process.pid)return b(`${t.label} is this process (pid ${i}); leaving it running`),!0;if(B(t))return!r&&await P(t.port)?(b(`${t.label} already running under launchd (http://localhost:${t.port}/)`),!0):Z(t,r);n&&!await P(t.port)&&(m(`${t.label} (pid ${i}) is not serving on port ${t.port}; restarting it.`),r=!0);let c=q(t);if(!c)return g(`${t.label} not found at ${I(t)}; skipping`),!1;let{dir:f,entry:d}=c,Q=c.bundled?d:u.join(f,t.buildRef);c.bundled&&(e=!1);let x=!1;if(e&&rt(t)){m(`Building ${t.label} (sources changed)...`);let l;try{l=S(["pnpm","run","build"],{cwd:f,capture:!0,timeout:300})}catch(a){if(a instanceof w&&a.code==="ENOENT")return g(`pnpm not found; skipping ${t.label}`),!1;if(a instanceof w&&a.code==="ETIMEDOUT")return y(`${t.label} build timed out; skipping`),!1;throw a}if(l.status!==0){let a=(l.stderr.trim()||l.stdout.trim()).slice(-800);return y(`${t.label} build failed; skipping start:
|
|
4
4
|
${a}`),!1}x=!0}else e&&m(`${t.label} build up to date; skipping build`);if(n&&!x&&nt(t,Q)&&(m(`Running ${t.label} predates the current build; bouncing to reload it.`),r=!0),n&&!x&&!r)return b(`${t.label} already running (pid ${i}, http://localhost:${t.port}/)`),!0;n&&await J(t),await _(t.port);let E=tt(t),V={...process.env,PORT:String(t.port),...t.env??{}};m(`Starting ${t.label} on http://localhost:${t.port}/ ...`);let j=o.openSync(E,"w"),h=X("node",[d],{cwd:f,detached:!0,stdio:["ignore",j,j],env:V}),R=await new Promise(l=>{h.once("spawn",()=>l("spawned")),h.once("error",a=>l(a))});if(o.closeSync(j),R!=="spawned"){if(R.code==="ENOENT")return g(`node not found; skipping ${t.label}`),!1;throw R}h.unref(),o.writeFileSync(p(t),String(h.pid));let N=!1;h.once("exit",()=>{N=!0});for(let l=0;l<20;l++){if(N)return y(`${t.label} exited immediately (see ${E})`),o.rmSync(p(t),{force:!0}),!1;if(await W(t.port))return b(`${t.label} started (pid ${h.pid}, http://localhost:${t.port}/)`),!0;await v(.25)}return g(`${t.label} started (pid ${h.pid}) but port ${t.port} not up yet; check ${E}`),!0}s(z,"start");async function J(t=$){if(B(t))return m(`${t.label} is kept up by launchd (${k}); leaving it running`),!1;let[e,r]=L(t);if(!e||r===null)return o.rmSync(p(t),{force:!0}),!1;m(`Stopping ${t.label} (pid ${r})...`);try{process.kill(r,"SIGTERM")}catch(i){let c=i.code;if(c==="ESRCH")return o.rmSync(p(t),{force:!0}),!1;if(c==="EPERM")return y(`Cannot signal pid ${r} (owned by another user)`),!1;throw i}let n=!1;for(let i=0;i<20;i++){if(!U(r)){n=!0;break}await v(.25)}if(!n)try{process.kill(r,"SIGKILL")}catch{}return o.rmSync(p(t),{force:!0}),await _(t.port),b(`${t.label} stopped`),!0}s(J,"stop");async function ot(t=$,e=!1){await z(t,e,!0)}s(ot,"restart");async function ht(t=!0){for(let e of O)await z(e,t)}s(ht,"startAll");async function bt(){for(let t of O)await J(t)}s(bt,"stopAll");async function pt(t=!1){for(let e of O)await ot(e,t)}s(pt,"restartAll");export{$ as a,H as b,k as c,Y as d,P as e,dt as f,q as g,mt as h,z as i,J as j,ot as k,ht as l,bt as m,pt as n};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-3SM7OPFC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
2
|
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
-
import{m as c}from"./chunk-
|
|
3
|
+
import{m as c}from"./chunk-NI4SD5KN.js";import{j as h,l as k}from"./chunk-RDY6H5F3.js";import{a,f as w}from"./chunk-NW56IEMZ.js";w();import*as m from"node:fs";import*as d from"node:path";var $="# --- sandbox workspace (managed section)",E=`${$} -----------------------------------
|
|
4
4
|
# Repo worktrees nested in this workspace, ignored by name. Rewritten by
|
|
5
5
|
# \`werkmeister workspace init\` on each run; rules above come from the repo's main.
|
|
6
6
|
`,x=["compose.yml","compose.gate.yml",".werkmeister/agent-state.json",".werkmeister/sessions/",".werkmeister/notices.json",".werkmeister/last-exec",".werkmeister/starts.json",".werkmeister/token",".werkmeister/wake-nudge*"],C=["/.env","/.env.*",...x.map(t=>`/${t}`)];function v(t){let i=["rm","--cached","--quiet","--ignore-unmatch","--",...x];c(["git","-C",t,...i],{capture:!0})}a(v,"untrackRuntimeFiles");function A(t){let i=d.join(t,".gitignore"),e="";try{e=m.readFileSync(i,"utf8")}catch{}let n=new Set(e.split(`
|
|
@@ -20,4 +20,4 @@ import{m as c}from"./chunk-AF2X5LK6.js";import{j as h,l as k}from"./chunk-T5NBS5
|
|
|
20
20
|
then rerun; the worktree lands on that branch.
|
|
21
21
|
Start over (deletes the remote branch): rerun with --force
|
|
22
22
|
Keep both: pick a different feature name.`)}h(` ${r}: worktree \u2192 ${e} (from ${l})`),f=["git","-C",t,"worktree","add","--no-track","-b",e,i,l]}let o=c(f,{capture:!0});if(o.status!==0)throw new Error(o.stderr.trim()||`git worktree add failed for ${r}`);if(s.status!==0)for(let[l,u]of[["remote","origin"],["merge",`refs/heads/${e}`]])c(["git","-C",t,"config",`branch.${e}.${l}`,u],{capture:!0})}a(D,"createWorktree");function S(t){return!!c(["git","-C",t,"status","--porcelain"],{capture:!0}).stdout.trim()}a(S,"worktreeIsDirty");function N(t,i,e){let n=c(["git","-C",t,"worktree","remove","--force",i],{capture:!0});if(n.status!==0)return[!1,n.stderr.trim()||`could not remove worktree ${i}`];let r=c(["git","-C",t,"branch","-D",e],{capture:!0});return r.status!==0?[!0,`worktree removed but branch ${e} lingered: ${r.stderr.trim()}`]:[!0,""]}a(N,"removeWorktree");function H(t,i,e=[]){if(!m.existsSync(d.join(t,".git")))return!1;let n=e.length?["--",...e]:[];try{return c(["git","-C",t,"add","-A",...n],{capture:!0,check:!0}),c(["git","-C",t,"diff","--cached","--quiet",...n],{capture:!0}).status===0?!1:(c(["git","-C",t,"commit","-q","-m",i,...n],{capture:!0,check:!0}),!0)}catch(r){return k(`Could not commit ${i}: ${r.message}`),!1}}a(H,"commitRecord");export{A as a,F as b,W as c,j as d,_ as e,T as f,D as g,S as h,N as i,H as j};
|
|
23
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-46BQCITV.js.map
|