werkmeister 0.89.3 → 0.90.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-TVWUOULR.js → budget-VVV4W7GV.js} +2 -2
- package/dist/{cache-BFQZZEI4.js → cache-4RFUYO4D.js} +2 -2
- package/dist/{chunk-UMORQN4O.js → chunk-2EBFF67G.js} +2 -2
- package/dist/{chunk-3UNRQ3J6.js → chunk-3HP4LXFW.js} +2 -2
- package/dist/{chunk-KFPZ5GPD.js → chunk-3IYW4GH7.js} +2 -2
- package/dist/{chunk-IXHOYBP4.js → chunk-5E6TBEKS.js} +2 -2
- package/dist/{chunk-PWP7ETUE.js → chunk-5FEUWFZU.js} +2 -2
- package/dist/{chunk-Z6FWTYQO.js → chunk-6W4VDTZ7.js} +51 -51
- package/dist/{chunk-SRHOFDPA.js → chunk-7WWXRFDJ.js} +2 -2
- package/dist/{chunk-ACGR3QDJ.js → chunk-ACRCO2SK.js} +2 -2
- package/dist/{chunk-WG72IZ56.js → chunk-BNXAAYSP.js} +2 -2
- package/dist/{chunk-RN3RYZ5D.js → chunk-BWBFHDBY.js} +2 -2
- package/dist/{chunk-3CWFM32E.js → chunk-COKEH2YU.js} +2 -2
- package/dist/{chunk-WRXTCIKP.js → chunk-CUXEKUPQ.js} +2 -2
- package/dist/{chunk-5UMRCX33.js → chunk-DQ73PEN4.js} +2 -2
- package/dist/{chunk-BKCYHB6B.js → chunk-E6H3OPHH.js} +2 -2
- package/dist/{chunk-5D5SOUZL.js → chunk-ENMXHMXC.js} +2 -2
- package/dist/{chunk-AOH4K6GP.js → chunk-EVXY6FSW.js} +2 -2
- package/dist/chunk-FQIPYXS3.js +4 -0
- package/dist/{chunk-F4UT472P.js → chunk-FR225LYD.js} +2 -2
- package/dist/{chunk-2VHOLJPD.js → chunk-GCCUEPYG.js} +2 -2
- package/dist/{chunk-X7VWEYJA.js → chunk-GJJPGT2W.js} +2 -2
- package/dist/{chunk-UA3SKI5H.js → chunk-GZNJ7GIP.js} +2 -2
- package/dist/{chunk-KQ634E6Q.js → chunk-HTOZ5C3T.js} +2 -2
- package/dist/{chunk-XVK63SA3.js → chunk-HWGGARGZ.js} +2 -2
- package/dist/{chunk-UJJVS5FL.js → chunk-ICWQFEAC.js} +2 -2
- package/dist/{chunk-L6R7TZTL.js → chunk-IFURHJUW.js} +2 -2
- package/dist/{chunk-JDIATMMP.js → chunk-IIJXCSAC.js} +2 -2
- package/dist/{chunk-X7NYDP5V.js → chunk-J4T3Y5M5.js} +44 -44
- package/dist/{chunk-SGXZD6S5.js → chunk-JEAU27N2.js} +2 -2
- package/dist/{chunk-CQZO7HXP.js → chunk-JU6Y2G3K.js} +2 -2
- package/dist/{chunk-72B433OL.js → chunk-KNH7K7K5.js} +3 -3
- package/dist/{chunk-DDBE5WOZ.js → chunk-LXREE532.js} +19 -19
- package/dist/{chunk-DDUJVGYS.js → chunk-MLXY7JPA.js} +2 -2
- package/dist/chunk-MSBPGE5M.js +13 -0
- package/dist/{chunk-D7V374JV.js → chunk-MWQQLIYI.js} +27 -27
- package/dist/{chunk-EVIEFMQX.js → chunk-N3B4CFR5.js} +2 -2
- package/dist/{chunk-44YMNG7G.js → chunk-NCFKYG7Q.js} +2 -2
- package/dist/{chunk-VBQC4FHW.js → chunk-OQCQB7D4.js} +2 -2
- package/dist/{chunk-3I35353B.js → chunk-PENBQLTX.js} +2 -2
- package/dist/{chunk-4532BYHL.js → chunk-PGFTMWD4.js} +2 -2
- package/dist/{chunk-6POQA2GP.js → chunk-PK4WPMSC.js} +2 -2
- package/dist/{chunk-7QKUAX64.js → chunk-PPYOIKTU.js} +2 -2
- package/dist/{chunk-Y3IKLSB7.js → chunk-PUFDKXDA.js} +2 -2
- package/dist/{chunk-UONVX5PW.js → chunk-QCGGZOW3.js} +2 -2
- package/dist/{chunk-SVUSC267.js → chunk-QY5PXC6N.js} +2 -2
- package/dist/{chunk-B4XOYXRD.js → chunk-R5SNQ5H4.js} +2 -2
- package/dist/{chunk-WKBD3SWM.js → chunk-RAIBCJC6.js} +2 -2
- package/dist/{chunk-W7NSXOX4.js → chunk-RKNCIEAQ.js} +2 -2
- package/dist/{chunk-ZP3TD2WH.js → chunk-RM7GNPYV.js} +2 -2
- package/dist/{chunk-GAZQNGJS.js → chunk-S2LN47CB.js} +3 -3
- package/dist/{chunk-LEC6E7ZF.js → chunk-TDVG5BD2.js} +2 -2
- package/dist/{chunk-V3PHDF4N.js → chunk-TTCCGRPC.js} +2 -2
- package/dist/{chunk-M4P6IKGJ.js → chunk-TV6IMMES.js} +2 -2
- package/dist/{chunk-OBKPCTPF.js → chunk-TXXDMCWB.js} +2 -2
- package/dist/{chunk-Z3QV5VNL.js → chunk-VVBFEHYG.js} +2 -2
- package/dist/{chunk-T6ZJOJVL.js → chunk-W6YKINRT.js} +2 -2
- package/dist/{chunk-4UJXSHDG.js → chunk-WXADSSGR.js} +2 -2
- package/dist/{chunk-WVEQ2NN3.js → chunk-WYA36Q6O.js} +2 -2
- package/dist/{chunk-JIVZUJQP.js → chunk-WZ4C5LQF.js} +2 -2
- package/dist/{chunk-J7CF3XWN.js → chunk-XF4O72WE.js} +2 -2
- package/dist/{chunk-AYN55JE7.js → chunk-XOE3BKEQ.js} +2 -2
- package/dist/{chunk-TTEC5IKC.js → chunk-XSZLSRIK.js} +2 -2
- package/dist/{chunk-ILPSDL7H.js → chunk-YFVAUZZJ.js} +2 -2
- package/dist/{chunk-VZDWLCF5.js → chunk-YJOXEIPT.js} +2 -2
- package/dist/{chunk-4EUL55H7.js → chunk-YMSOTNNY.js} +3 -3
- package/dist/{chunk-ZFR7U6NA.js → chunk-YSVDNV4A.js} +2 -2
- package/dist/chunk-ZAGBWZZM.js +5 -0
- package/dist/clean-PTQC3FA7.js +8 -0
- package/dist/close_out-TLFEWQFQ.js +8 -0
- package/dist/code-TWCGFVWG.js +4 -0
- package/dist/{config-3WD3L4VQ.js → config-IAJB5GGA.js} +2 -2
- package/dist/{connect-UGQ43FQI.js → connect-IRGN7IK4.js} +2 -2
- package/dist/{daemon-UKVJBUY6.js → daemon-EYEZ6H4X.js} +2 -2
- package/dist/dashboard.js +1 -1
- package/dist/{detect-HERBE3KK.js → detect-GNPDUBUC.js} +2 -2
- package/dist/{down-T26JZGJO.js → down-KFOAIOPX.js} +3 -3
- package/dist/{fixture-KD63REDT.js → fixture-B6WISNOK.js} +2 -2
- package/dist/form-cli.js +1 -1
- package/dist/hooks-BMVMCV25.js +4 -0
- package/dist/{hooks_gen-YZJNYT5T.js → hooks_gen-26V7XODO.js} +2 -2
- package/dist/infra-YMHZ67JJ.js +4 -0
- package/dist/init_workspace-CCDLF2OH.js +4 -0
- package/dist/{intercept-EGKOTY5V.js → intercept-JFG74AG7.js} +2 -2
- package/dist/{issue-ZIHGMYBD.js → issue-GHYOX7Z5.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-JYXQJFXD.js +7 -0
- package/dist/logs-JNFSJSZ3.js +6 -0
- package/dist/main.js +3 -3
- package/dist/mcp-proxy.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/{migrate-HADI4VFM.js → migrate-AFZGYGXD.js} +2 -2
- package/dist/notes-US5GD3X6.js +4 -0
- package/dist/{open-GD3Y3OKD.js → open-KYYLKCVG.js} +2 -2
- package/dist/{optimize-3K4OSU4R.js → optimize-ATFBPIDM.js} +2 -2
- package/dist/pause-RG4V4U2C.js +4 -0
- package/dist/pr-EA7L7OHK.js +5 -0
- package/dist/proxy_reload-PQLB5T4O.js +6 -0
- package/dist/{registry-Y23LPM7E.js → registry-DEM7RIVB.js} +2 -2
- package/dist/remove-UJ3MKFBT.js +7 -0
- package/dist/remove_workspace-22BCMLR5.js +8 -0
- package/dist/restart-ZJVGRP7T.js +8 -0
- package/dist/resume-WS337JIU.js +8 -0
- package/dist/{safari-SK3NFJOX.js → safari-DX6MKSWG.js} +2 -2
- package/dist/{sandbox-FZMTZBPJ.js → sandbox-F7J2KY6T.js} +2 -2
- package/dist/{services-OEKEKIL7.js → services-W7USB623.js} +2 -2
- package/dist/{setup-I5ZC3RCG.js → setup-BCLBKP6T.js} +2 -2
- package/dist/skills-TSB262GQ.js +4 -0
- package/dist/{slots-VQUXT5AI.js → slots-OV73ZSPU.js} +2 -2
- package/dist/{standards-BJZOMUPG.js → standards-GZVWZOSV.js} +2 -2
- package/dist/start_args-ATXJRWZS.js +4 -0
- package/dist/starting_prompt-7SEPN5BJ.js +4 -0
- package/dist/stats-CHQ6HNR3.js +4 -0
- package/dist/{status-PZLYZGIU.js → status-XOG2XZB5.js} +2 -2
- package/dist/{stop-YHH6JBE5.js → stop-RHSBWGXC.js} +2 -2
- package/dist/{telepresence-XNZMY3BH.js → telepresence-HUF6577A.js} +2 -2
- package/dist/{test-PPJP5AE6.js → test-B3ROSN62.js} +2 -2
- package/dist/{tokens-L53QZBUS.js → tokens-NPLPVGIK.js} +2 -2
- package/dist/{up-E6H4QYXL.js → up-IBKCCV4R.js} +3 -3
- package/dist/{v4-EHEA67RQ.js → v4-IBECLGXA.js} +2 -2
- package/dist/wait_load-QVXDWK6A.js +4 -0
- package/dist/werkmeister-workspaces.vsix +0 -0
- package/dist/{workspace-VK7OEICO.js → workspace-HLXV6IGD.js} +2 -2
- package/infra/templates/Caddyfile.njk +18 -0
- package/package.json +4 -4
- package/dist/chunk-CRT2753J.js +0 -13
- package/dist/chunk-I7VVNLCE.js +0 -5
- package/dist/chunk-UW2AJYBP.js +0 -4
- package/dist/clean-HWPJXNBJ.js +0 -8
- package/dist/close_out-W5GW6WRP.js +0 -8
- package/dist/code-LXWWJ75V.js +0 -4
- package/dist/hooks-TMLWRDDT.js +0 -4
- package/dist/infra-I66Y4JAU.js +0 -4
- package/dist/init_workspace-OEBVESNA.js +0 -4
- package/dist/list_workspaces-UZP57BMT.js +0 -7
- package/dist/logs-WQPQDDYL.js +0 -6
- package/dist/notes-F7QSCDHC.js +0 -4
- package/dist/pause-6JWCUIUL.js +0 -4
- package/dist/pr-E63HJVSU.js +0 -5
- package/dist/proxy_reload-MH3ND5OE.js +0 -6
- package/dist/remove-AR2FHAZW.js +0 -7
- package/dist/remove_workspace-ZD65PFNI.js +0 -8
- package/dist/restart-PHB3HHZV.js +0 -8
- package/dist/resume-VZHY74K6.js +0 -8
- package/dist/skills-GE3CPWRR.js +0 -4
- package/dist/start_args-WQDU4APM.js +0 -4
- package/dist/starting_prompt-K3O7XPOK.js +0 -4
- package/dist/stats-3B7NQEBU.js +0 -4
- package/dist/wait_load-2QM3P6YP.js +0 -4
|
@@ -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-IXHOYBP4.js";import{b as or,c as ar,d as sr,e as ur,f as fr,g as lr}from"./chunk-X7NYDP5V.js";import{a as i,b as L,c as E,e as Li,f as c}from"./chunk-J7CF3XWN.js";var mr=E((zs,vr)=>{"use strict";c();var C=L("fs"),re=L("path"),Pi=C.lchown?"lchown":"chown",ki=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[ki](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"lchownSync"),Ni=i((e,t,r)=>{try{return C.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"chownSync"),Mi=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;Ni(e,t,r)}}:(e,t,r)=>dr(e,t,r),Ai=process.version,yr=i((e,t,r)=>C.readdir(e,t,r),"readdir"),Di=i((e,t)=>C.readdirSync(e,t),"readdirSync");/^v4\./.test(Ai)&&(yr=i((e,t,r)=>C.readdir(e,r),"readdir"));var Be=i((e,t,r,n)=>{C[Pi](e,t,r,Mi(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"),qi=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=Di(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=>qi(e,o,t,r)),ht(e,t,r)},"chownrSync");vr.exports=dt;dt.sync=_r});var pt=E((Ks,wr)=>{c();wr.exports=L("stream")});var Or=E((Xs,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){Ii(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 Ii(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(Ii,"_defineProperty");function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i(Ci,"_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 ji(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}i(ji,"_createClass");function Rr(e){var t=Bi(e,"string");return typeof t=="symbol"?t:String(t)}i(Rr,"_toPropertyKey");function Bi(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(Bi,"_toPrimitive");var Fi=L("buffer"),Fe=Fi.Buffer,Ui=L("util"),yt=Ui.inspect,Wi=yt&&yt.custom||"inspect";function Hi(e,t,r){Fe.prototype.copy.call(e,t,r)}i(Hi,"copyBuffer");Tr.exports=function(){function e(){Ci(this,e),this.head=null,this.tail=null,this.length=0}return i(e,"BufferList"),ji(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;)Hi(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:Wi,value:i(function(r,n){return yt(this,Er(Er({},n),{},{depth:0,customInspect:!1}))},"value")}]),e}()});var _t=E((Qs,Lr)=>{"use strict";c();function $i(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($i,"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 zi(){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(zi,"undestroy");function gt(e,t){e.emit("error",t)}i(gt,"emitErrorNT");function Gi(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}i(Gi,"errorOrDestroy");Lr.exports={destroy:$i,undestroy:zi,errorOrDestroy:Gi}});var K=E((ru,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 Vi(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}i(Vi,"startsWith");function Ki(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}i(Ki,"endsWith");function Yi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}i(Yi,"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"&&Vi(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o;if(Ki(e," argument"))o=`The ${e} ${n} ${Pr(t,"type")}`;else{let a=Yi(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=E((ou,Mr)=>{"use strict";c();var Xi=K().codes.ERR_INVALID_OPT_VALUE;function Ji(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}i(Ji,"highWaterMarkFrom");function Zi(e,t,r,n){var o=Ji(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=n?r:"highWaterMark";throw new Xi(a,o)}return Math.floor(o)}return e.objectMode?16:16*1024}i(Zi,"getHighWaterMark");Mr.exports={getHighWaterMark:Zi}});var Ar=E((uu,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=E((cu,bt)=>{c();try{if(wt=L("util"),typeof wt.inherits!="function")throw"";bt.exports=wt.inherits}catch{bt.exports=Ar()}var wt});var qr=E((du,Dr)=>{c();Dr.exports=L("util").deprecate});var Rt=E((yu,Ur)=>{"use strict";c();Ur.exports=k;function Cr(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Oo(t,e)}}i(Cr,"CorkedRequest");var le;k.WritableState=Ee;var Qi={deprecate:qr()},jr=pt(),He=L("buffer").Buffer,eo=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function to(e){return He.from(e)}i(to,"_uint8ArrayToBuffer");function ro(e){return He.isBuffer(e)||e instanceof eo}i(ro,"_isUint8Array");var St=_t(),no=vt(),io=no.getHighWaterMark,X=K().codes,oo=X.ERR_INVALID_ARG_TYPE,ao=X.ERR_METHOD_NOT_IMPLEMENTED,so=X.ERR_MULTIPLE_CALLBACK,uo=X.ERR_STREAM_CANNOT_PIPE,fo=X.ERR_STREAM_DESTROYED,lo=X.ERR_STREAM_NULL_VALUES,co=X.ERR_STREAM_WRITE_AFTER_END,ho=X.ERR_UNKNOWN_ENCODING,ce=St.errorOrDestroy;Y()(k,jr);function po(){}i(po,"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=io(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){bo(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:Qi.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 uo)};function yo(e,t){var r=new co;ce(e,r),process.nextTick(t,r)}i(yo,"writeAfterEnd");function go(e,t,r,n){var o;return r===null?o=new lo:typeof r!="string"&&!t.objectMode&&(o=new oo("chunk",["string","Buffer"],r)),o?(ce(e,o),process.nextTick(n,o),!1):!0}i(go,"validChunk");k.prototype.write=function(e,t,r){var n=this._writableState,o=!1,a=!n.objectMode&&ro(e);return a&&!He.isBuffer(e)&&(e=to(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=po),n.ending?yo(this,r):(a||go(this,n,e,r))&&(n.pendingcb++,o=vo(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 ho(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 _o(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=He.from(t,r)),t}i(_o,"decodeChunk");Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});function vo(e,t,r,n,o,a){if(!r){var s=_o(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(vo,"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 fo("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}i(Et,"doWrite");function mo(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(mo,"onwriteError");function wo(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}i(wo,"onwriteStateUpdate");function bo(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(typeof o!="function")throw new so;if(wo(r),t)mo(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(bo,"onwrite");function Ir(e,t,r,n){r||Eo(e,t),t.pendingcb--,n(),be(e,t)}i(Ir,"afterWrite");function Eo(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}i(Eo,"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 ao("_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||To(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 So(e,t){e._final(function(r){t.pendingcb--,r&&ce(e,r),t.prefinished=!0,e.emit("prefinish"),be(e,t)})}i(So,"callFinal");function Ro(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(So,e,t)):(t.prefinished=!0,e.emit("prefinish")))}i(Ro,"prefinish");function be(e,t){var r=Fr(t);if(r&&(Ro(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 To(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(To,"endWritable");function Oo(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(Oo,"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=E((vu,Hr)=>{"use strict";c();var xo=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=xo(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",Lo)))}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 Lo(){this._writableState.ended||process.nextTick(Po,this)}i(Lo,"onend");function Po(e){e.end()}i(Po,"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=E((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=E(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 ko(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(ko,"_normalizeEncoding");function No(e){var t=ko(e);if(typeof t!="string"&&(kt.isEncoding===Vr||!Vr(e)))throw new Error("Unknown encoding: "+e);return t||e}i(No,"normalizeEncoding");Kr.StringDecoder=Se;function Se(e){this.encoding=No(e);var t;switch(this.encoding){case"utf16le":this.text=Co,this.end=jo,t=4;break;case"utf8":this.fillLast=Do,t=4;break;case"base64":this.text=Bo,this.end=Fo,t=3;break;default:this.write=Uo,this.end=Wo;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=Io;Se.prototype.text=qo;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 Mo(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(Mo,"utf8CheckIncomplete");function Ao(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(Ao,"utf8CheckExtraBytes");function Do(e){var t=this.lastTotal-this.lastNeed,r=Ao(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(Do,"utf8FillLast");function qo(e,t){var r=Mo(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(qo,"utf8Text");function Io(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}i(Io,"utf8End");function Co(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(Co,"utf16Text");function jo(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(jo,"utf16End");function Bo(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(Bo,"base64Text");function Fo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}i(Fo,"base64End");function Uo(e){return e.toString(this.encoding)}i(Uo,"simpleWrite");function Wo(e){return e&&e.length?this.write(e):""}i(Wo,"simpleEnd")});var Ve=E((Ou,Jr)=>{"use strict";c();var Yr=K().codes.ERR_STREAM_PREMATURE_CLOSE;function Ho(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(Ho,"once");function $o(){}i($o,"noop");function zo(e){return e.setHeader&&typeof e.abort=="function"}i(zo,"isRequest");function Xr(e,t,r){if(typeof t=="function")return Xr(e,null,t);t||(t={}),r=Ho(r||$o);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 zo(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=E((Pu,Zr)=>{"use strict";c();var Ke;function J(e,t,r){return t=Go(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(J,"_defineProperty");function Go(e){var t=Vo(e,"string");return typeof t=="symbol"?t:String(t)}i(Go,"_toPropertyKey");function Vo(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(Vo,"_toPrimitive");var Ko=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 Yo(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(Yo,"readAndResolve");function Xo(e){process.nextTick(Yo,e)}i(Xo,"onReadable");function Jo(e,t){return function(r,n){e.then(function(){if(t[Ye]){r(Q(void 0,!0));return}t[Mt](r,n)},n)}}i(Jo,"wrapForNext");var Zo=Object.getPrototypeOf(function(){}),Qo=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(Jo(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),Zo),ea=i(function(t){var r,n=Object.create(Qo,(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,Ko(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",Xo.bind(null,n)),n},"createReadableStreamAsyncIterator");Zr.exports=ea});var nn=E((Mu,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 ta(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(ta,"_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 ra(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){na(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(ra,"_objectSpread");function na(e,t,r){return t=ia(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(na,"_defineProperty");function ia(e){var t=oa(e,"string");return typeof t=="symbol"?t:String(t)}i(ia,"_toPropertyKey");function oa(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(oa,"_toPrimitive");var aa=K().codes.ERR_INVALID_ARG_TYPE;function sa(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 aa("iterable",["Iterable"],t);var o=new e(ra({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=ta(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(sa,"from");rn.exports=sa});var xt=E((Iu,pn)=>{"use strict";c();pn.exports=R;var he;R.ReadableState=un;var qu=L("events").EventEmitter,sn=i(function(t,r){return t.listeners(r).length},"EElistenerCount"),Oe=pt(),Xe=L("buffer").Buffer,ua=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fa(e){return Xe.from(e)}i(fa,"_uint8ArrayToBuffer");function la(e){return Xe.isBuffer(e)||e instanceof ua}i(la,"_isUint8Array");var At=L("util"),m;At&&At.debuglog?m=At.debuglog("stream"):m=i(function(){},"debug");var ca=Or(),Ft=_t(),ha=vt(),da=ha.getHighWaterMark,Je=K().codes,pa=Je.ERR_INVALID_ARG_TYPE,ya=Je.ERR_STREAM_PUSH_AFTER_EOF,ga=Je.ERR_METHOD_NOT_IMPLEMENTED,_a=Je.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,de,Dt,qt;Y()(R,Oe);var Te=Ft.errorOrDestroy,It=["error","close","destroy","pause","resume"];function va(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(va,"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=da(this,e,"readableHighWaterMark",r),this.buffer=new ca,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,ba(e,a);else{var s;if(o||(s=ma(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=fa(t)),n)a.endEmitted?Te(e,new _a):Ct(e,a,t,!0);else if(a.ended)Te(e,new ya);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 ma(e,t){var r;return!la(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new pa("chunk",["string","Buffer","Uint8Array"],t)),r}i(ma,"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 wa(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(wa,"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=wa(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 ba(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(ba,"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(Ea,e,t))}i(Bt,"maybeReadMore");function Ea(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(Ea,"maybeReadMore_");R.prototype._read=function(e){Te(this,new ga("_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=Sa(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"),va(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 Sa(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(Sa,"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(Ra,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 Ra(e){m("readable nexttick read 0"),e.read(0)}i(Ra,"nReadingNextTick");R.prototype.resume=function(){var e=this._readableState;return e.flowing||(m("resume"),e.flowing=!e.readableListening,Ta(this,e)),e.paused=!1,this};function Ta(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Oa,e,t))}i(Ta,"resume");function Oa(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(Oa,"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(xa,t,e))}i(jt,"endReadable");function xa(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(xa,"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=E((Bu,gn)=>{"use strict";c();gn.exports=z;var Qe=K().codes,La=Qe.ERR_METHOD_NOT_IMPLEMENTED,Pa=Qe.ERR_MULTIPLE_CALLBACK,ka=Qe.ERR_TRANSFORM_ALREADY_TRANSFORMING,Na=Qe.ERR_TRANSFORM_WITH_LENGTH_0,et=ne();Y()(z,et);function Ma(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Pa);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(Ma,"afterTransform");function z(e){if(!(this instanceof z))return new z(e);et.call(this,e),this._transformState={afterTransform:Ma.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",Aa)}i(z,"Transform");function Aa(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yn(e,t,r)}):yn(this,null,null)}i(Aa,"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 La("_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 Na;if(e._transformState.transforming)throw new ka;return e.push(null)}i(yn,"done")});var mn=E((Wu,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=E((zu,Sn)=>{"use strict";c();var Ht;function Da(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}i(Da,"once");var En=K().codes,qa=En.ERR_MISSING_ARGS,Ia=En.ERR_STREAM_DESTROYED;function wn(e){if(e)throw e}i(wn,"noop");function Ca(e){return e.setHeader&&typeof e.abort=="function"}i(Ca,"isRequest");function ja(e,t,r,n){n=Da(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,Ca(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new Ia("pipe"))}}}i(ja,"destroyer");function bn(e){e()}i(bn,"call");function Ba(e,t){return e.pipe(t)}i(Ba,"pipe");function Fa(e){return!e.length||typeof e[e.length-1]!="function"?wn:e.pop()}i(Fa,"popCallback");function Ua(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Fa(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new qa("streams");var o,a=t.map(function(s,u){var f=u<t.length-1,l=u>0;return ja(s,f,l,function(g){o||(o=g),g&&a.forEach(bn),!f&&(a.forEach(bn),n(o))})});return t.reduce(Ba)}i(Ua,"pipeline");Sn.exports=Ua});var pe=E((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=E((Yu,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=E((Zu,tt)=>{"use strict";c();var $t=pe().Duplex,Wa=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");Wa(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=E(ge=>{c();var Ha=Buffer.alloc,$a="0000000000000000000",za="7777777777777777777",Pn=48,kn=Buffer.from("ustar\0","binary"),Ga=Buffer.from("00","binary"),Va=Buffer.from("ustar ","binary"),Ka=Buffer.from(" \0","binary"),Ya=parseInt("7777",8),Ne=257,Gt=263,Xa=i(function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},"clamp"),Ja=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"),Za=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?za.slice(0,t)+" ":$a.slice(0,t-e.length)+e+" "},"encodeOct");function Qa(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(Qa,"parse256");var te=i(function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return Qa(e);for(;t<e.length&&e[t]===32;)t++;for(var n=Xa(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-5E6TBEKS.js";import{b as or,c as ar,d as sr,e as ur,f as fr,g as lr}from"./chunk-J4T3Y5M5.js";import{a as i,b as L,c as E,e as Li,f as c}from"./chunk-XF4O72WE.js";var mr=E((zs,vr)=>{"use strict";c();var C=L("fs"),re=L("path"),Pi=C.lchown?"lchown":"chown",ki=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[ki](e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"lchownSync"),Ni=i((e,t,r)=>{try{return C.chownSync(e,t,r)}catch(n){if(n.code!=="ENOENT")throw n}},"chownSync"),Mi=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;Ni(e,t,r)}}:(e,t,r)=>dr(e,t,r),Ai=process.version,yr=i((e,t,r)=>C.readdir(e,t,r),"readdir"),Di=i((e,t)=>C.readdirSync(e,t),"readdirSync");/^v4\./.test(Ai)&&(yr=i((e,t,r)=>C.readdir(e,r),"readdir"));var Be=i((e,t,r,n)=>{C[Pi](e,t,r,Mi(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"),qi=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=Di(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=>qi(e,o,t,r)),ht(e,t,r)},"chownrSync");vr.exports=dt;dt.sync=_r});var pt=E((Ks,wr)=>{c();wr.exports=L("stream")});var Or=E((Xs,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){Ii(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 Ii(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(Ii,"_defineProperty");function Ci(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}i(Ci,"_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 ji(e,t,r){return t&&Sr(e.prototype,t),r&&Sr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}i(ji,"_createClass");function Rr(e){var t=Bi(e,"string");return typeof t=="symbol"?t:String(t)}i(Rr,"_toPropertyKey");function Bi(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(Bi,"_toPrimitive");var Fi=L("buffer"),Fe=Fi.Buffer,Ui=L("util"),yt=Ui.inspect,Wi=yt&&yt.custom||"inspect";function Hi(e,t,r){Fe.prototype.copy.call(e,t,r)}i(Hi,"copyBuffer");Tr.exports=function(){function e(){Ci(this,e),this.head=null,this.tail=null,this.length=0}return i(e,"BufferList"),ji(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;)Hi(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:Wi,value:i(function(r,n){return yt(this,Er(Er({},n),{},{depth:0,customInspect:!1}))},"value")}]),e}()});var _t=E((Qs,Lr)=>{"use strict";c();function $i(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($i,"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 zi(){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(zi,"undestroy");function gt(e,t){e.emit("error",t)}i(gt,"emitErrorNT");function Gi(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}i(Gi,"errorOrDestroy");Lr.exports={destroy:$i,undestroy:zi,errorOrDestroy:Gi}});var K=E((ru,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 Vi(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}i(Vi,"startsWith");function Ki(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}i(Ki,"endsWith");function Yi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}i(Yi,"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"&&Vi(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let o;if(Ki(e," argument"))o=`The ${e} ${n} ${Pr(t,"type")}`;else{let a=Yi(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=E((ou,Mr)=>{"use strict";c();var Xi=K().codes.ERR_INVALID_OPT_VALUE;function Ji(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}i(Ji,"highWaterMarkFrom");function Zi(e,t,r,n){var o=Ji(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var a=n?r:"highWaterMark";throw new Xi(a,o)}return Math.floor(o)}return e.objectMode?16:16*1024}i(Zi,"getHighWaterMark");Mr.exports={getHighWaterMark:Zi}});var Ar=E((uu,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=E((cu,bt)=>{c();try{if(wt=L("util"),typeof wt.inherits!="function")throw"";bt.exports=wt.inherits}catch{bt.exports=Ar()}var wt});var qr=E((du,Dr)=>{c();Dr.exports=L("util").deprecate});var Rt=E((yu,Ur)=>{"use strict";c();Ur.exports=k;function Cr(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Oo(t,e)}}i(Cr,"CorkedRequest");var le;k.WritableState=Ee;var Qi={deprecate:qr()},jr=pt(),He=L("buffer").Buffer,eo=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function to(e){return He.from(e)}i(to,"_uint8ArrayToBuffer");function ro(e){return He.isBuffer(e)||e instanceof eo}i(ro,"_isUint8Array");var St=_t(),no=vt(),io=no.getHighWaterMark,X=K().codes,oo=X.ERR_INVALID_ARG_TYPE,ao=X.ERR_METHOD_NOT_IMPLEMENTED,so=X.ERR_MULTIPLE_CALLBACK,uo=X.ERR_STREAM_CANNOT_PIPE,fo=X.ERR_STREAM_DESTROYED,lo=X.ERR_STREAM_NULL_VALUES,co=X.ERR_STREAM_WRITE_AFTER_END,ho=X.ERR_UNKNOWN_ENCODING,ce=St.errorOrDestroy;Y()(k,jr);function po(){}i(po,"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=io(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){bo(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:Qi.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 uo)};function yo(e,t){var r=new co;ce(e,r),process.nextTick(t,r)}i(yo,"writeAfterEnd");function go(e,t,r,n){var o;return r===null?o=new lo:typeof r!="string"&&!t.objectMode&&(o=new oo("chunk",["string","Buffer"],r)),o?(ce(e,o),process.nextTick(n,o),!1):!0}i(go,"validChunk");k.prototype.write=function(e,t,r){var n=this._writableState,o=!1,a=!n.objectMode&&ro(e);return a&&!He.isBuffer(e)&&(e=to(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=po),n.ending?yo(this,r):(a||go(this,n,e,r))&&(n.pendingcb++,o=vo(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 ho(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 _o(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=He.from(t,r)),t}i(_o,"decodeChunk");Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:i(function(){return this._writableState.highWaterMark},"get")});function vo(e,t,r,n,o,a){if(!r){var s=_o(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(vo,"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 fo("write")):r?e._writev(o,t.onwrite):e._write(o,a,t.onwrite),t.sync=!1}i(Et,"doWrite");function mo(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(mo,"onwriteError");function wo(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}i(wo,"onwriteStateUpdate");function bo(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if(typeof o!="function")throw new so;if(wo(r),t)mo(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(bo,"onwrite");function Ir(e,t,r,n){r||Eo(e,t),t.pendingcb--,n(),be(e,t)}i(Ir,"afterWrite");function Eo(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}i(Eo,"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 ao("_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||To(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 So(e,t){e._final(function(r){t.pendingcb--,r&&ce(e,r),t.prefinished=!0,e.emit("prefinish"),be(e,t)})}i(So,"callFinal");function Ro(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(So,e,t)):(t.prefinished=!0,e.emit("prefinish")))}i(Ro,"prefinish");function be(e,t){var r=Fr(t);if(r&&(Ro(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 To(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(To,"endWritable");function Oo(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(Oo,"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=E((vu,Hr)=>{"use strict";c();var xo=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=xo(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",Lo)))}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 Lo(){this._writableState.ended||process.nextTick(Po,this)}i(Lo,"onend");function Po(e){e.end()}i(Po,"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=E((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=E(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 ko(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(ko,"_normalizeEncoding");function No(e){var t=ko(e);if(typeof t!="string"&&(kt.isEncoding===Vr||!Vr(e)))throw new Error("Unknown encoding: "+e);return t||e}i(No,"normalizeEncoding");Kr.StringDecoder=Se;function Se(e){this.encoding=No(e);var t;switch(this.encoding){case"utf16le":this.text=Co,this.end=jo,t=4;break;case"utf8":this.fillLast=Do,t=4;break;case"base64":this.text=Bo,this.end=Fo,t=3;break;default:this.write=Uo,this.end=Wo;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=Io;Se.prototype.text=qo;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 Mo(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(Mo,"utf8CheckIncomplete");function Ao(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(Ao,"utf8CheckExtraBytes");function Do(e){var t=this.lastTotal-this.lastNeed,r=Ao(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(Do,"utf8FillLast");function qo(e,t){var r=Mo(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(qo,"utf8Text");function Io(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}i(Io,"utf8End");function Co(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(Co,"utf16Text");function jo(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(jo,"utf16End");function Bo(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(Bo,"base64Text");function Fo(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}i(Fo,"base64End");function Uo(e){return e.toString(this.encoding)}i(Uo,"simpleWrite");function Wo(e){return e&&e.length?this.write(e):""}i(Wo,"simpleEnd")});var Ve=E((Ou,Jr)=>{"use strict";c();var Yr=K().codes.ERR_STREAM_PREMATURE_CLOSE;function Ho(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(Ho,"once");function $o(){}i($o,"noop");function zo(e){return e.setHeader&&typeof e.abort=="function"}i(zo,"isRequest");function Xr(e,t,r){if(typeof t=="function")return Xr(e,null,t);t||(t={}),r=Ho(r||$o);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 zo(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=E((Pu,Zr)=>{"use strict";c();var Ke;function J(e,t,r){return t=Go(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(J,"_defineProperty");function Go(e){var t=Vo(e,"string");return typeof t=="symbol"?t:String(t)}i(Go,"_toPropertyKey");function Vo(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(Vo,"_toPrimitive");var Ko=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 Yo(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(Yo,"readAndResolve");function Xo(e){process.nextTick(Yo,e)}i(Xo,"onReadable");function Jo(e,t){return function(r,n){e.then(function(){if(t[Ye]){r(Q(void 0,!0));return}t[Mt](r,n)},n)}}i(Jo,"wrapForNext");var Zo=Object.getPrototypeOf(function(){}),Qo=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(Jo(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),Zo),ea=i(function(t){var r,n=Object.create(Qo,(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,Ko(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",Xo.bind(null,n)),n},"createReadableStreamAsyncIterator");Zr.exports=ea});var nn=E((Mu,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 ta(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(ta,"_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 ra(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){na(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(ra,"_objectSpread");function na(e,t,r){return t=ia(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}i(na,"_defineProperty");function ia(e){var t=oa(e,"string");return typeof t=="symbol"?t:String(t)}i(ia,"_toPropertyKey");function oa(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(oa,"_toPrimitive");var aa=K().codes.ERR_INVALID_ARG_TYPE;function sa(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 aa("iterable",["Iterable"],t);var o=new e(ra({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=ta(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(sa,"from");rn.exports=sa});var xt=E((Iu,pn)=>{"use strict";c();pn.exports=R;var he;R.ReadableState=un;var qu=L("events").EventEmitter,sn=i(function(t,r){return t.listeners(r).length},"EElistenerCount"),Oe=pt(),Xe=L("buffer").Buffer,ua=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fa(e){return Xe.from(e)}i(fa,"_uint8ArrayToBuffer");function la(e){return Xe.isBuffer(e)||e instanceof ua}i(la,"_isUint8Array");var At=L("util"),m;At&&At.debuglog?m=At.debuglog("stream"):m=i(function(){},"debug");var ca=Or(),Ft=_t(),ha=vt(),da=ha.getHighWaterMark,Je=K().codes,pa=Je.ERR_INVALID_ARG_TYPE,ya=Je.ERR_STREAM_PUSH_AFTER_EOF,ga=Je.ERR_METHOD_NOT_IMPLEMENTED,_a=Je.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,de,Dt,qt;Y()(R,Oe);var Te=Ft.errorOrDestroy,It=["error","close","destroy","pause","resume"];function va(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(va,"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=da(this,e,"readableHighWaterMark",r),this.buffer=new ca,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,ba(e,a);else{var s;if(o||(s=ma(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=fa(t)),n)a.endEmitted?Te(e,new _a):Ct(e,a,t,!0);else if(a.ended)Te(e,new ya);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 ma(e,t){var r;return!la(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new pa("chunk",["string","Buffer","Uint8Array"],t)),r}i(ma,"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 wa(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(wa,"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=wa(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 ba(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(ba,"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(Ea,e,t))}i(Bt,"maybeReadMore");function Ea(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(Ea,"maybeReadMore_");R.prototype._read=function(e){Te(this,new ga("_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=Sa(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"),va(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 Sa(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(Sa,"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(Ra,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 Ra(e){m("readable nexttick read 0"),e.read(0)}i(Ra,"nReadingNextTick");R.prototype.resume=function(){var e=this._readableState;return e.flowing||(m("resume"),e.flowing=!e.readableListening,Ta(this,e)),e.paused=!1,this};function Ta(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Oa,e,t))}i(Ta,"resume");function Oa(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(Oa,"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(xa,t,e))}i(jt,"endReadable");function xa(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(xa,"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=E((Bu,gn)=>{"use strict";c();gn.exports=z;var Qe=K().codes,La=Qe.ERR_METHOD_NOT_IMPLEMENTED,Pa=Qe.ERR_MULTIPLE_CALLBACK,ka=Qe.ERR_TRANSFORM_ALREADY_TRANSFORMING,Na=Qe.ERR_TRANSFORM_WITH_LENGTH_0,et=ne();Y()(z,et);function Ma(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Pa);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(Ma,"afterTransform");function z(e){if(!(this instanceof z))return new z(e);et.call(this,e),this._transformState={afterTransform:Ma.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",Aa)}i(z,"Transform");function Aa(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){yn(e,t,r)}):yn(this,null,null)}i(Aa,"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 La("_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 Na;if(e._transformState.transforming)throw new ka;return e.push(null)}i(yn,"done")});var mn=E((Wu,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=E((zu,Sn)=>{"use strict";c();var Ht;function Da(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}i(Da,"once");var En=K().codes,qa=En.ERR_MISSING_ARGS,Ia=En.ERR_STREAM_DESTROYED;function wn(e){if(e)throw e}i(wn,"noop");function Ca(e){return e.setHeader&&typeof e.abort=="function"}i(Ca,"isRequest");function ja(e,t,r,n){n=Da(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,Ca(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(s||new Ia("pipe"))}}}i(ja,"destroyer");function bn(e){e()}i(bn,"call");function Ba(e,t){return e.pipe(t)}i(Ba,"pipe");function Fa(e){return!e.length||typeof e[e.length-1]!="function"?wn:e.pop()}i(Fa,"popCallback");function Ua(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Fa(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new qa("streams");var o,a=t.map(function(s,u){var f=u<t.length-1,l=u>0;return ja(s,f,l,function(g){o||(o=g),g&&a.forEach(bn),!f&&(a.forEach(bn),n(o))})});return t.reduce(Ba)}i(Ua,"pipeline");Sn.exports=Ua});var pe=E((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=E((Yu,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=E((Zu,tt)=>{"use strict";c();var $t=pe().Duplex,Wa=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");Wa(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=E(ge=>{c();var Ha=Buffer.alloc,$a="0000000000000000000",za="7777777777777777777",Pn=48,kn=Buffer.from("ustar\0","binary"),Ga=Buffer.from("00","binary"),Va=Buffer.from("ustar ","binary"),Ka=Buffer.from(" \0","binary"),Ya=parseInt("7777",8),Ne=257,Gt=263,Xa=i(function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},"clamp"),Ja=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"),Za=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?za.slice(0,t)+" ":$a.slice(0,t-e.length)+e+" "},"encodeOct");function Qa(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(Qa,"parse256");var te=i(function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return Qa(e);for(;t<e.length&&e[t]===32;)t++;for(var n=Xa(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=Ha(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&Ya,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+Za(e.type),e.linkname&&t.write(e.linkname,157),kn.copy(t,Ne),Ga.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=Ja(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(!(Va.compare(e,Ne,Ne+6)===0&&Ka.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=E((of,jn)=>{c();var Dn=L("util"),es=Ln(),Me=Vt(),qn=pe().Writable,In=pe().PassThrough,Cn=i(function(){},"noop"),An=i(function(e){return e&=511,e&&512-e},"overflow"),ts=i(function(e,t){var r=new rt(e,t);return r.end(),r},"emptyStream"),rs=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=es(),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=_=rs(_,t._pax),t._pax=null),t._locked=!0,!_.size||_.type==="directory"){t._parse(512,d),t.emit("entry",_,ts(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=E((uf,Fn)=>{c();Fn.exports=L("fs").constants||L("constants")});var $n=E((lf,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=E((df,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=E((gf,Kn)=>{c();var ns=Yt(),is=i(function(){},"noop"),os=global.Bare?queueMicrotask:process.nextTick.bind(process),as=i(function(e){return e.setHeader&&typeof e.abort=="function"},"isRequest"),ss=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=ns(r||is);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(){os(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 as(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)),ss(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=E((mf,Zn)=>{c();var _e=Un(),Yn=Xt(),ot=Y(),us=Buffer.alloc,Xn=pe().Readable,ve=pe().Writable,fs=L("string_decoder").StringDecoder,it=Vt(),ls=parseInt("755",8),cs=parseInt("644",8),Jn=us(1024),Zt=i(function(){},"noop"),Jt=i(function(e,t){t&=511,t&&e.push(Jn.slice(0,512-t))},"overflow");function hs(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(hs,"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 fs("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=hs(e.mode)),e.mode||(e.mode=e.type==="directory"?ls:cs),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=E(Qt=>{c();Qt.extract=Bn();Qt.pack=Qn()});var ni=E((Rf,ri)=>{c();var ds=Yt(),ps=Xt(),ut;try{ut=L("fs")}catch{}var De=i(function(){},"noop"),ys=typeof process>"u"?!1:/^v?\.0/.test(process.version),ft=i(function(e){return typeof e=="function"},"isFn"),gs=i(function(e){return!ys||!ut?!1:(e instanceof(ut.ReadStream||De)||e instanceof(ut.WriteStream||De))&&ft(e.close)},"isFS"),_s=i(function(e){return e.setHeader&&ft(e.abort)},"isRequest"),vs=i(function(e,t,r,n){n=ds(n);var o=!1;e.on("close",function(){o=!0}),ps(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,gs(e))return e.close(De);if(_s(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"),ms=i(function(e,t){return e.pipe(t)},"pipe"),ws=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 vs(o,s,u,function(f){r||(r=f),f&&n.forEach(ti),!s&&(n.forEach(ti),t(r))})});return e.reduce(ms)},"pump");ri.exports=ws});var si=E((xf,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=E(nr=>{c();var bs=mr(),fi=ei(),li=ni(),Es=si(),ci=L("fs"),P=L("path"),Ss=L("os"),qe=Ss.platform()==="win32",Ie=i(function(){},"noop"),rr=i(function(e){return e},"echo"),er=qe?function(e){return e.replace(/\\/g,"/").replace(/[:?<>|]/g,"_")}:rr,Rs=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=Rs(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 Ts=i(function(e){return e.length?e[e.length-1]:null},"head"),Os=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&&Os()===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=Ts(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){Es(e,{fs:t.fs},function(n,o){!n&&o&&t.own?bs(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 Ri=Li(gi(),1);import{createHash as xs}from"node:crypto";import{readFileSync as bi}from"node:fs";import*as Ei from"node:os";import*as $ from"node:path";import{PassThrough as _i,Readable as Si}from"node:stream";import{StringDecoder as Ls}from"node:string_decoder";import Ps from"dockerode";function ks(){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-IXHOYBP4.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-EVXY6FSW.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as __sandboxCreateRequire } from "node:module";
|
|
2
|
+
const require = __sandboxCreateRequire(import.meta.url);
|
|
3
|
+
import{X as e,aa as r}from"./chunk-J4T3Y5M5.js";import{f as o}from"./chunk-XF4O72WE.js";o();var W=e,h=r;export{W as a,h as b};
|
|
4
|
+
//# sourceMappingURL=chunk-FQIPYXS3.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-5E6TBEKS.js";import{j as h,l as k}from"./chunk-J4T3Y5M5.js";import{a,f as w}from"./chunk-XF4O72WE.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-IXHOYBP4.js";import{j as h,l as k}from"./chunk-X7NYDP
|
|
|
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-FR225LYD.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 r,f as c}from"./chunk-
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
import{a as r,f as c}from"./chunk-XF4O72WE.js";c();import*as t from"node:fs";import*as s from"node:path";var i="compose.yml",p="docker-compose.yml";function f(o){try{return t.statSync(o).isFile()}catch{return!1}}r(f,"isFile");function m(o){for(let e of[i,p]){let n=s.join(o,e);if(f(n))return n}return null}r(m,"findWorkspaceCompose");function u(o){let e=s.join(o,p),n=s.join(o,i);f(e)&&!t.existsSync(n)&&t.renameSync(e,n)}r(u,"migrateWorkspaceCompose");export{i as a,p as b,m as c,u as d};
|
|
4
|
+
//# sourceMappingURL=chunk-GCCUEPYG.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{a as P}from"./chunk-
|
|
3
|
+
import{a as P}from"./chunk-WZ4C5LQF.js";import{a as E}from"./chunk-DQ73PEN4.js";import{b as m}from"./chunk-ENMXHMXC.js";import{a as r,f as T}from"./chunk-XF4O72WE.js";T();import*as c from"node:fs";import*as d from"node:path";var C=new Set(["AskUserQuestion","ExitPlanMode"]),J=new Set(["permission_prompt","elicitation_dialog"]),I=30*6e4,F=24*60*6e4,_=/^[\w-]+$/,j=r(t=>d.join(m(t),"agent-state.json"),"legacyFile"),k=r(t=>d.join(m(t),"sessions"),"sessionsDir"),M=r((t,e)=>d.join(k(t),`${e}.json`),"sessionPath");function y(t){try{let e=JSON.parse(c.readFileSync(t,"utf8"));return e&&typeof e=="object"&&!Array.isArray(e)?e:null}catch{return null}}r(y,"readJson");function S(t){if(t?.status!=="busy"&&t?.status!=="idle"||typeof t.at!="string")return null;let e={status:t.status,at:t.at};return t.headless===!0&&(e.headless=!0),typeof t.last=="string"&&(e.last=t.last),typeof t.tool?.name=="string"&&typeof t.tool.at=="string"&&(e.tool=t.tool),Number.isInteger(t.subagents)&&t.subagents>0&&(e.subagents=t.subagents),typeof t.shell?.command=="string"&&typeof t.shell.at=="string"&&(e.shell={command:t.shell.command,at:t.shell.at,...typeof t.shell.id=="string"&&{id:t.shell.id}}),typeof t.ask?.what=="string"&&typeof t.ask.at=="string"&&(e.ask=t.ask),t.stopped===!0&&(e.stopped=!0),e}r(S,"sessionOf");function lt(t,e=Date.now()){let s={},o=r(a=>a.status==="idle"||a.ask!==void 0||e-w(a)<F,"fresh");for(let[a,n]of Object.entries(y(j(t))?.sessions??{})){let u=S(n);u&&o(u)&&(s[a]=u)}let i=[];try{i=c.readdirSync(k(t))}catch{}for(let a of i){let n=a.match(/^([\w-]+)\.json$/)?.[1],u=d.join(k(t),a),f=n?S(y(u)):null;!n||!f||(o(f)?s[n]=f:G(u,o))}return s}r(lt,"readSessions");function G(t,e){try{let s=S(y(t));s&&!e(s)&&c.rmSync(t,{force:!0})}catch{}}r(G,"removeIfStale");var w=r(t=>Date.parse(t.last??t.at),"lastOf"),K=r((t,e=Date.now())=>t.status==="busy"&&e-w(t)>=I,"sessionGone");function ft(t,e=Date.now()){let s=Object.values(t),o=s.flatMap(u=>u.ask?[u.ask]:[]).sort((u,f)=>u.at.localeCompare(f.at))[0];if(o)return{agent:"needs-you",at:o.at,question:o.what};let i=s.find(u=>u.status==="busy"&&!K(u,e));if(i)return{agent:"working",at:i.at,question:null};let a=s.find(u=>u.shell&&e-Date.parse(u.shell.at)<I)?.shell;if(a)return{agent:"working",at:a.at,question:null};let n=s.sort((u,f)=>w(f)-w(u))[0];return n?n.stopped?{agent:"done",at:n.at,question:null}:n.status==="busy"?{agent:"idle",at:n.at,question:null}:null:null}r(ft,"agentOf");function L(t){return/\?(?=[\s*_`'")\]]|$)/.test(D(t))}r(L,"asksQuestion");function D(t){let e=t.trim().split(/\n\s*\n/);return e[e.length-1].trim().slice(0,200)}r(D,"questionOf");function U(t,e){let s=c.openSync(t,"r");try{let o=c.fstatSync(s).size,i=Math.min(o,e),a=Buffer.alloc(i);return c.readSync(s,a,0,i,o-i),a.toString("utf8")}finally{c.closeSync(s)}}r(U,"tailOf");function B(t){let e=U(t,65536).split(`
|
|
4
4
|
`);for(let s=e.length-1;s>=0;s--){let o;try{o=JSON.parse(e[s])}catch{continue}if(o.type!=="assistant")continue;let i=o.message?.content;if(typeof i=="string")return i;if(!Array.isArray(i))continue;let a=i.filter(n=>n?.type==="text"&&typeof n.text=="string");if(a.length)return a.map(n=>n.text).join(`
|
|
5
5
|
`)}return null}r(B,"lastAssistantText");var Q=1<<20;function z(t,e,s){if(!t.id)return t.at<e;if(typeof s!="string")return!1;let o=`<task-id>${t.id}</task-id>`;try{return U(s,Q).split(`
|
|
6
6
|
`).some(i=>i.includes(o)&&H(i,o))}catch{return!1}}r(z,"shellExited");function H(t,e){try{let s=JSON.parse(t);return s?.type==="queue-operation"?String(s.content??"").includes(e):s?.attachment?.type==="queued_command"&&String(s.attachment.prompt??"").includes(e)}catch{return!1}}r(H,"isExitNotice");var $=r(t=>t.ask?.kind!=="permission"&&t.tool!==void 0&&C.has(t.tool.name),"askingTool");function Y(t,e,s,o={}){let i=t.hook_event_name,a=s.toISOString(),n=e?{...e}:{status:"idle",at:a};o.foreign||(o.headless?n.headless=!0:delete n.headless),n.last=a;let u=r(l=>{n.status!==l&&Object.assign(n,{status:l,at:a})},"status");if(i==="SubagentStart"||i==="SubagentStop"){let l=(n.subagents??0)+(i==="SubagentStart"?1:-1);return l>0?n.subagents=l:delete n.subagents,n}if(t.agent_id)return e?n:void 0;let f=String(t.tool_name??""),g=o.foreign;switch(i){case"SessionStart":if(u("idle"),!g)for(let l of["tool","ask","stopped","subagents","shell"])delete n[l];return n;case"UserPromptSubmit":if(u("busy"),!g)for(let l of["tool","ask","stopped"])delete n[l];return n;case"PreToolUse":{if(u("busy"),g)return n;delete n.stopped;let l=t.tool_input?.command;n.tool={name:f,...typeof l=="string"&&{command:l.slice(0,200)},at:a},f==="Bash"&&t.tool_input?.run_in_background===!0&&(n.shell={command:typeof l=="string"?l.slice(0,200):"",at:a});let p=t.tool_input?.ask;if(f===P&&typeof p=="string"&&p.trim())n.ask={kind:"question",what:p.trim(),at:a,source:"session",via:"wrap_up"};else if(f==="AskUserQuestion"){let v=t.tool_input?.questions?.[0]?.question;n.ask={kind:"question",what:typeof v=="string"?v:"Answer the question",at:a,source:"session"}}else f==="ExitPlanMode"?n.ask={kind:"plan",what:"Approve the plan?",at:a,source:"session"}:delete n.ask;return n}case"PostToolUse":case"PostToolUseFailure":{if(u("busy"),g)return n;delete n.tool;let l=t.tool_response?.backgroundTaskId;n.shell&&typeof l=="string"&&t.tool_input?.run_in_background===!0&&(n.shell={...n.shell,id:l});let p=t.tool_input?.task_id??t.tool_input?.shell_id;return(f==="TaskStop"||f==="KillShell")&&n.shell?.id&&p===n.shell.id&&delete n.shell,f===P&&n.ask?.via==="wrap_up"||delete n.ask,n}case"Notification":{let l=t.notification_type,p=String(t.message??"");return!(typeof l=="string"?J.has(l):!/waiting for your input/i.test(p))||g||$(n)||n.ask?.kind==="permission"?void 0:(n.ask={kind:l==="elicitation_dialog"?"question":"permission",what:p||"Approve the tool call?",at:a,source:"session"},n)}case"PermissionRequest":{if(g||$(n)||n.ask?.kind==="permission")return;let l=t.tool_input?.description;return n.ask={kind:"permission",what:typeof l=="string"&&l.trim()?l.trim():`Approve ${f||"the tool call"}?`,at:a,source:"session"},n}case"PermissionDenied":return n.ask?.kind==="permission"&&delete n.ask,n;case"Stop":case"StopFailure":{let l=n.at;if(u("idle"),g)return n;delete n.tool,n.shell&&z(n.shell,l,t.transcript_path)&&delete n.shell,n.stopped=!0;let p=null;return typeof t.last_assistant_message=="string"?p=t.last_assistant_message:typeof t.transcript_path=="string"&&(p=B(t.transcript_path)),p&&L(p)?n.ask={kind:"question",what:D(p),at:a,source:"text"}:n.ask?.via!=="wrap_up"&&delete n.ask,n}case"SessionEnd":return o.foreign?n:null;default:return}}r(Y,"nextSession");var V="Workspace paused by the person from its card. End your turn now; it continues when they press Resume.",pt="Workspace resumed by the person. Continue where you left off.",x=r(t=>d.join(m(t),"paused.json"),"pausedPath"),b=r(t=>d.join(m(t),"resume-nudge.json"),"nudgePath"),O=r(t=>d.join(m(t),"waiting.json"),"waitingPath");function h(t,e){let s=`${t}.${process.pid}.tmp`;c.writeFileSync(s,`${JSON.stringify(e)}
|
|
@@ -9,4 +9,4 @@ import{a as P}from"./chunk-JIVZUJQP.js";import{a as E}from"./chunk-5UMRCX33.js";
|
|
|
9
9
|
${s}`:s,at:o.toISOString()})}catch(u){throw n!==null&&c.renameSync(a,i),u}c.rmSync(a,{force:!0})}r(bt,"writeWakeNudge");function et(t,e){let s=t.hook_event_name;if(s!=="UserPromptSubmit"&&s!=="PostToolUse"&&s!=="Stop"||t.agent_id||!tt(e,t.session_id))return null;let o=N(e,t.session_id),i=`${o}.${process.pid}-${Date.now()}.claimed`;try{c.renameSync(o,i)}catch{return null}let a=R(i);return c.rmSync(i,{force:!0}),a===null?null:s==="Stop"?{decision:"block",reason:a}:{hookSpecificOutput:{hookEventName:s,additionalContext:a}}}r(et,"deliverWake");function nt(t,e){let s=c.existsSync(x(e)),o=s?null:q(e);if(!s&&!o||o?.services)return null;let i=o?`Waiting for capacity (position ${o.position}). End your turn now; it starts when another feature stops.`:V;switch(t.hook_event_name){case"PreToolUse":{let a={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:i}};return process.env.WERKMEISTER_HOOK_HARNESS==="codex"?a:{continue:!1,stopReason:i,...a}}case"UserPromptSubmit":return{decision:"block",reason:o?"This workspace is waiting for capacity; it starts on its own.":"This workspace is paused. Press \u25B6 Resume on its card first."};default:return null}}r(nt,"pauseGate");function st(t,e){if(t.hook_event_name!=="UserPromptSubmit")return null;let s=X(e);return s?.services?`This session's own service start is waiting for capacity (position ${s.position}): ${s.services.join(", ")}. The werkmeister command that started it (pr gate, pr open or feature up --service), usually a background job in this session, polls every 15 s for up to 10 min and goes on by itself when room frees. To stop the wait, stop that job (TaskStop, or kill its pid; never pkill).`:null}r(st,"serviceWaitContext");function ot(t,e){let s=t?.hookSpecificOutput?.additionalContext;return{hookSpecificOutput:{hookEventName:"UserPromptSubmit",additionalContext:s?`${e}
|
|
10
10
|
|
|
11
11
|
${s}`:e}}}r(ot,"withContext");function rt(t,e=new Date){let s=E(String(t.cwd||process.cwd())),o=t.session_id;if(!s||typeof o!="string"||!_.test(o))return null;let i=M(s,o),a=S(y(i)),n=y(j(s)),u=a??S(n?.sessions?.[o]),f=process.env.CLAUDE_CODE_ENTRYPOINT?.startsWith("sdk")??!1,g=f&&u!==null&&!u.headless,l=Y(t,u,e,{headless:f,foreign:g});return l===void 0?null:(n?.sessions?.[o]&&(delete n.sessions[o],h(j(s),n)),l===null?u?(c.rmSync(i,{force:!0}),i):null:(c.mkdirSync(k(s),{recursive:!0}),h(i,l),i))}r(rt,"record");function Ot(){try{let t=process.stdin.isTTY?"":c.readFileSync(0,"utf8"),e=t.trim()?JSON.parse(t):{};if(typeof e!="object"||e===null||Array.isArray(e))return;let s=E(String(e.cwd||process.cwd())),o=s?nt(e,s):null;if(o){console.log(JSON.stringify(o));return}s&&e.hook_event_name==="UserPromptSubmit"&&c.rmSync(b(s),{force:!0});let i=s?et(e,s):null,a=s?st(e,s):null;if(a?console.log(JSON.stringify(ot(i,a))):i&&console.log(JSON.stringify(i)),i&&e.hook_event_name==="Stop")return;rt(e)}catch{}}r(Ot,"main");export{I as a,F as b,lt as c,K as d,ft as e,L as f,D as g,pt as h,b as i,O as j,h as k,dt as l,gt as m,mt as n,q as o,X as p,ht as q,yt as r,St as s,kt as t,W as u,wt as v,_t as w,xt as x,bt as y,Ot as z};
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-GJJPGT2W.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{b as st}from"./chunk-KFPZ5GPD.js";import{f as _e,g as $e,h as H,i as be}from"./chunk-JDIATMMP.js";import{a as ve,b as S,c as se,d as K,f as y,g as w,i as ye}from"./chunk-UJJVS5FL.js";import{r as ke}from"./chunk-Z3QV5VNL.js";import{A as he,X as ge,a as F,w as ue}from"./chunk-X7NYDP5V.js";import{a as p,e as M,f as $}from"./chunk-J7CF3XWN.js";$();var ie=M(F(),1);import*as z from"node:fs";import*as oe from"node:path";var re=class extends Error{static{p(this,"AllocationError")}};function Ct(e=he()){try{let t=(0,ie.parse)(z.readFileSync(e,"utf8"))?.feature_slots?.ports_per_slot;return Number.isInteger(t)&&t>0?t:20}catch{return 20}}p(Ct,"portsPerSlot");function ne(e,t){for(let r of["services","infrastructure"])for(let a of Object.values(e?.[r]??{})){if(!a||typeof a!="object")continue;let i=a;Number.isInteger(i.port_offset)&&t.offsets.add(i.port_offset),Number.isInteger(i.k8s_forward_port)&&t.forwards.add(i.k8s_forward_port)}}p(ne,"collect");function xe(e,t,r,a){let i={offsets:new Set,forwards:new Set};for(let n of H(e))oe.resolve(n.path)!==oe.resolve(t)&&ne(n.doc,i);return z.existsSync(r)&&ne((0,ie.parse)(z.readFileSync(r,"utf8"))??null,i),ne(a,i),i}p(xe,"takenPorts");function we(e,t,r){let a=new Set(t),i=new Map;for(let n of[...e].sort()){let s=0;for(;a.has(s);)s++;if(s>=r)throw new re(`port_offset exhausted: ${r} offsets (ports.yaml ports_per_slot) are all used \u2014 raise ports_per_slot or free one`);a.add(s),i.set(n,s)}return i}p(we,"allocateOffsets");function Se(e,t,r=9050){let a=new Set(t),i=new Map;for(let n of[...e].sort()){let s=r;for(;a.has(s);)s++;a.add(s),i.set(n,s)}return i}p(Se,"allocateForwards");var nt=p(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRe");function je(e,t,r){let a={...e},i=[];for(let n of t){let s=a[n];if(s===void 0)continue;let o=s;for(let c of r)o=o.replace(new RegExp(`(?<![\\w.-])${nt(c.host??c.name)}:${c.port}\\b`,"g"),`k8s-${c.name}:${c.forward}`);o!==s&&(a[n]=o,i.push(n))}return{env:a,rewritten:i}}p(je,"rewriteEnv");$();var Ie=M(F(),1);$();$();import*as U from"node:path";var ae={redis:{health:"redis",port:6379},postgres:{health:"postgres",port:5432},postgis:{health:"postgres",port:5432},mysql:{health:"",port:3306},mariadb:{health:"",port:3306},mongo:{health:"",port:27017},rabbitmq:{health:"",port:5672}};function Ae(e){return(e.split("@")[0].split("/").pop()??e).split(":")[0]}p(Ae,"imageRepoName");var Oe=p((e,t)=>e.name.localeCompare(t.name),"byName");function Ee(e){let t=e.image?Ae(e.image):"";return Object.hasOwn(ae,t)?t:null}p(Ee,"datastoreOf");function Ne(e,t){let r=e.filter(f=>f.kind==="package"||f.kind==="dockerfile"),a=e.filter(f=>f.kind==="k8s"||f.kind==="compose"),i=[...new Set(r.map(f=>f.dir))].sort(),n=p(f=>f==="."?t:U.posix.basename(f),"base"),s=p(f=>{let h=U.posix.dirname(f);return h==="."?t:U.posix.basename(h)},"parent"),o=new Map;for(let f of i)o.set(n(f),(o.get(n(f))??0)+1);let c=i.map(f=>({dir:f,name:(o.get(n(f))??0)>1?`${s(f)}-${n(f)}`:n(f),findings:r.filter(h=>h.dir===f)})),u=[(f,h)=>f.kind==="k8s"&&f.dir!==null&&h.dir!=="."&&(f.dir===h.dir||f.dir.startsWith(`${h.dir}/`)),(f,h)=>f.kind==="compose"&&f.dir!==null&&f.dir===h.dir,(f,h)=>f.name===h.name,(f,h)=>!!f.image&&Ae(f.image)===h.name],m=[];for(let f of a){let h=Ee(f)?[u[2]]:u,b;for(let N of h)if(b=c.find(j=>N(f,j)),b)break;b?b.findings.push(f):m.push(f)}let d=[],g=new Map,k=[];for(let f of m){let h=Ee(f);if(h){let b=g.get(f.name)??{name:f.name,datastore:h,findings:[]};b.findings.push(f),g.set(f.name,b)}else{k.push(f);let b=f.kind==="k8s"?"Deployment":"compose service";d.push({item:f.file,reason:`found ${b} ${f.name} \u2014 no source dir in this repo, skipped`})}}return{services:c.filter(f=>{let h=f.findings.some(b=>b.kind!=="package"||b.runnable);return h||d.push({item:f.dir,reason:"library package (no Dockerfile, deploy config or dev/start script), skipped"}),h}).sort(Oe),infrastructure:[...g.values()].sort(Oe),unmatched:k,skipped:d}}p(Ne,"correlate");var ot={type:["package"],archetype:["package"],test:["package"],internal_port:["k8s","compose","dockerfile"],health_endpoint:["k8s","compose"],setup_service:["package"],image:["dockerfile","package"],command:["package","compose","dockerfile"],memory_limit:["k8s"],memory_reservation:["k8s"],node_modules_volume:["package"],secrets:["k8s"],k8s_deployment:["k8s"],k8s_namespace:["k8s"],k8s_port:["k8s"],k8s_port_name:["k8s"],k8s_pod_prefix:["k8s"],feature_router:["k8s"],depends_on:["compose"]},ce=p((e,t)=>JSON.stringify(e)===JSON.stringify(t),"same");function rt(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}p(rt,"sortKeys");function Pe(e,t){return Object.assign({},...e.filter(r=>r.kind===t&&r.fields.environment).map(r=>r.fields.environment.value))}p(Pe,"envOf");function V(e){let t={path:y(e.dir,"source directory")},r=[];for(let[o,c]of Object.entries(ot)){let u=c.flatMap(g=>e.findings.filter(k=>k.kind===g&&k.fields[o]!==void 0).map(k=>k.fields[o]));if(!u.length)continue;let m=u[0];if(t[o]=m,m.confidence!=="stated")continue;let d=u.slice(1).filter(g=>g.confidence==="stated"&&!ce(g.value,m.value)).filter((g,k,v)=>v.findIndex(f=>ce(f.value,g.value))===k);d.length&&r.push({service:e.name,key:o,chosen:m,also:d})}t.internal_port??=w(3e3,"no port in any source \u2014 default 3000"),t.health_endpoint??=w("","no readiness probe or healthcheck \u2014 TCP-only"),t.type??=w("api","no package.json \u2014 assumed a service"),t.image??=w("alpine:3","no usable FROM and no package.json \u2014 set the dev image"),!t.feature_router&&t.type.value==="web"&&(t.feature_router=w({},"type: web \u2014 routed through Caddy"));let a=Pe(e.findings,"k8s"),i=Pe(e.findings,"compose"),n={...a,...i};if(Object.keys(n).length){let o=[Object.keys(i).length?"compose environment":"",Object.keys(a).length?"k8s env":""];t.environment=y(rt(n),o.filter(Boolean).join(" + "))}let s=Object.keys(a).filter(o=>!(o in i)).sort();return{name:e.name,dir:e.dir,fields:t,conflicts:r,k8sEnvKeys:s,findings:e.findings}}p(V,"resolveService");function Me(e,t=[]){let r=ae[e.datastore],a=e.findings.filter(o=>o.kind==="k8s"),i=a[0];for(let o of a.slice(1))for(let c of["internal_port","k8s_namespace"]){let u=i.fields[c],m=o.fields[c];u&&m&&!ce(u.value,m.value)&&t.push({item:o.file,reason:`infrastructure ${e.name}: ${c} ${m.value} disagrees with ${u.value} (${u.source}), kept ${u.value}`})}let n=i?.fields.internal_port??e.findings.find(o=>o.fields.internal_port)?.fields.internal_port,s="no k8s manifest for this datastore";return{name:e.name,fields:{internal_port:n??y(r.port,`${e.datastore} default port`),k8s_namespace:i?.fields.k8s_namespace??w("default",s),k8s_pod_prefix:i?.fields.k8s_pod_prefix??w(e.name,s),health_endpoint:y(r.health,r.health?`${e.datastore} wire probe`:"no wire probe for this datastore \u2014 TCP-only")}}}p(Me,"resolveInfra");var Xt={type:"object",required:["answers"],additionalProperties:!1,properties:{answers:{type:"array",items:{type:"object",required:["item","value","reason","files_read"],additionalProperties:!1,properties:{item:{type:"string"},value:{},reason:{type:"string"},files_read:{type:"array",items:{type:"string"}}}}}}};function it(e){let t=e.existing?(0,Ie.parse)(e.existing)??{}:{},r=p((n,s)=>t?.services?.[n]?.[s]!==void 0,"inFile"),a=e.services.map(n=>n.name),i=[];for(let n of e.services){let s=n.fields,o=p((m,d)=>{r(n.name,m)||i.push({id:`${n.name}.${m}`,service:n.name,...d})},"ask");s.command?.confidence==="guessed"&&o("command",{kind:"command",prompt:`What command starts ${n.name} for local development? It runs with the repo root mounted at /app as the working directory.`,facts:{dir:n.dir,guess:s.command.value,why:s.command.source}}),s.health_endpoint?.confidence==="guessed"&&o("health_endpoint",{kind:"health_endpoint",prompt:`Which HTTP path answers 200 when ${n.name} is healthy? Answer "" if it has none.`,facts:{dir:n.dir,port:s.internal_port?.value}});let c=e.envExample[n.name]??[];c.length&&(o("environment",{kind:"environment",prompt:`Which environment variables does ${n.name} need for local development, with development values? Leave secrets out.`,facts:{dir:n.dir,env_example_keys:c,current:s.environment?.value??{}}}),s.secrets||o("secrets",{kind:"secrets",prompt:`Which of these keys must be set for ${n.name} to start at all? A declared secret that is missing stops \`werkmeister feature up\`.`,facts:{dir:n.dir},choices:c}));let u=a.filter(m=>m!==n.name);u.length&&!s.depends_on&&o("depends_on",{kind:"depends_on",prompt:`Which of these services must be running before ${n.name} starts (it calls them at startup)? Answer [] for none.`,facts:{dir:n.dir},choices:u});for(let m of n.conflicts)o(m.key,{kind:"conflict",prompt:`Sources disagree on ${n.name}.${m.key}. Which value is right for local development?`,facts:{sources:[m.chosen,...m.also].map(d=>({value:d.value,source:d.source}))},choices:[m.chosen.value,...m.also.map(d=>d.value)]})}for(let n of[...new Set(e.unmatched.map(s=>s.name))]){let s=e.unmatched.filter(c=>c.name===n),o=s.map(c=>c.file).join(", ");i.push({id:`unmatched.${n}`,kind:"unmatched",service:null,prompt:`${o} define${s.length>1?"":"s"} ${n}, but no source directory matched it. Which service is it? Answer null if its code lives in another repo.`,facts:{files:s.map(c=>c.file),image:s.find(c=>c.image)?.image??null},choices:[...a,null]})}return i}p(it,"collectQuestions");var at=p(e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>typeof t=="string"),"isStringMap"),De=p((e,t)=>Array.isArray(e)&&e.every(r=>typeof r=="string"&&t.includes(r)),"subsetOf"),ct=p((e,t)=>JSON.stringify(e)===JSON.stringify(t),"same");function ft(e,t,r,a){if(r===null)return null;let i=typeof r=="string"?e.services.find(o=>o.name===r):void 0,n=e.unmatched.filter(o=>`unmatched.${o.name}`===t);if(!i||!n.length)return"expected one of this repo's services, or null";let s=V({name:i.name,dir:i.dir,findings:[...i.findings,...n]});for(let[o,c]of Object.entries(s.fields))o in i.fields||(i.fields[o]={...c,confidence:"inferred",source:`${c.source}; matched by Claude: ${a}`});return i.findings.push(...n),e.unmatched=e.unmatched.filter(o=>!n.includes(o)),e.skipped=e.skipped.filter(o=>!n.some(c=>o.item===c.file&&o.reason.includes(` ${c.name} \u2014 `))),null}p(ft,"applyUnmatched");function Qt(e,t){let r=structuredClone(e),a=new Map(it(e).map(o=>[o.id,o])),i=[],n=[],s=new Set;for(let o of t){let c=a.get(o.item);if(!c){n.push({item:o.item,reason:"not one of the questions asked"});continue}if(s.has(o.item)){n.push({item:o.item,reason:"answered twice; kept the first"});continue}s.add(o.item);let u=o.reason?.trim()||"no reason given",m=p(k=>({value:k,source:u,confidence:"inferred"}),"inferred"),d=c.service?r.services.find(k=>k.name===c.service):void 0,g=null;if(c.kind==="unmatched")g=ft(r,c.id,o.value,u);else if(!d)g=`no service named ${c.service} in this plan`;else switch(c.kind){case"command":typeof o.value=="string"&&o.value.trim()?d.fields.command=m(o.value.trim()):g="expected a non-empty command string";break;case"health_endpoint":typeof o.value=="string"&&(o.value===""||o.value.startsWith("/"))?d.fields.health_endpoint=m(o.value):g='expected "" or a path starting with /';break;case"environment":{if(!at(o.value)){g="expected an object of string values";break}let k=d.fields.environment?.value??{},v=Object.fromEntries(Object.entries({...o.value,...k}).sort(([h],[b])=>h.localeCompare(b))),f=d.fields.environment?.source;d.fields.environment=m(v),f&&(d.fields.environment.source=`${f}; Claude added keys: ${u}`);break}case"secrets":De(o.value,c.choices??[])?o.value.length&&(d.fields.secrets=m([...o.value].sort())):g="expected a list of keys from .env.example";break;case"depends_on":De(o.value,c.choices??[])?o.value.length&&(d.fields.depends_on=m([...o.value].sort())):g="expected a list of this repo's other services";break;case"conflict":{let k=(c.choices??[]).find(f=>ct(f,o.value));if(k===void 0){g="not one of the conflicting values";break}let v=c.id.slice(d.name.length+1);d.fields[v]=m(k),d.conflicts=d.conflicts.filter(f=>f.key!==v);break}}g?n.push({item:o.item,reason:g}):i.push(o.item)}return{plan:r,accepted:i,rejected:n}}p(Qt,"applyAnswers");function es(e){return["You are helping generate a werkmeister service-registry fragment for the repository in your working directory.","A deterministic scan already filled every field it could read from package manifests, Dockerfiles, compose files and Kubernetes manifests.","The questions below are the fields it had to guess. Answer each one from the repository's own files, using Read, Glob and Grep.","","Rules:","- Answer only the questions listed, using each question's `id` as `item`.","- When a question has `choices`, `value` must be one of them; for list questions, a subset of them.","- Leave a question out if the repository doesn't settle it. A missing answer keeps the scan's guess; a wrong answer is worse than none.","- Never put credentials, tokens or keys in environment values. Those belong in `secrets`.",'- `reason` is one short sentence naming the evidence, e.g. "apps/api/src/main.ts registers GET /healthz". It is written into the file as a comment.',"- `files_read` lists the files that support the answer.","","Questions (JSON):",JSON.stringify(e,null,2)].join(`
|
|
3
|
+
import{b as st}from"./chunk-3IYW4GH7.js";import{f as _e,g as $e,h as H,i as be}from"./chunk-IIJXCSAC.js";import{a as ve,b as S,c as se,d as K,f as y,g as w,i as ye}from"./chunk-ICWQFEAC.js";import{r as ke}from"./chunk-VVBFEHYG.js";import{A as he,X as ge,a as F,w as ue}from"./chunk-J4T3Y5M5.js";import{a as p,e as M,f as $}from"./chunk-XF4O72WE.js";$();var ie=M(F(),1);import*as z from"node:fs";import*as oe from"node:path";var re=class extends Error{static{p(this,"AllocationError")}};function Ct(e=he()){try{let t=(0,ie.parse)(z.readFileSync(e,"utf8"))?.feature_slots?.ports_per_slot;return Number.isInteger(t)&&t>0?t:20}catch{return 20}}p(Ct,"portsPerSlot");function ne(e,t){for(let r of["services","infrastructure"])for(let a of Object.values(e?.[r]??{})){if(!a||typeof a!="object")continue;let i=a;Number.isInteger(i.port_offset)&&t.offsets.add(i.port_offset),Number.isInteger(i.k8s_forward_port)&&t.forwards.add(i.k8s_forward_port)}}p(ne,"collect");function xe(e,t,r,a){let i={offsets:new Set,forwards:new Set};for(let n of H(e))oe.resolve(n.path)!==oe.resolve(t)&&ne(n.doc,i);return z.existsSync(r)&&ne((0,ie.parse)(z.readFileSync(r,"utf8"))??null,i),ne(a,i),i}p(xe,"takenPorts");function we(e,t,r){let a=new Set(t),i=new Map;for(let n of[...e].sort()){let s=0;for(;a.has(s);)s++;if(s>=r)throw new re(`port_offset exhausted: ${r} offsets (ports.yaml ports_per_slot) are all used \u2014 raise ports_per_slot or free one`);a.add(s),i.set(n,s)}return i}p(we,"allocateOffsets");function Se(e,t,r=9050){let a=new Set(t),i=new Map;for(let n of[...e].sort()){let s=r;for(;a.has(s);)s++;a.add(s),i.set(n,s)}return i}p(Se,"allocateForwards");var nt=p(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeRe");function je(e,t,r){let a={...e},i=[];for(let n of t){let s=a[n];if(s===void 0)continue;let o=s;for(let c of r)o=o.replace(new RegExp(`(?<![\\w.-])${nt(c.host??c.name)}:${c.port}\\b`,"g"),`k8s-${c.name}:${c.forward}`);o!==s&&(a[n]=o,i.push(n))}return{env:a,rewritten:i}}p(je,"rewriteEnv");$();var Ie=M(F(),1);$();$();import*as U from"node:path";var ae={redis:{health:"redis",port:6379},postgres:{health:"postgres",port:5432},postgis:{health:"postgres",port:5432},mysql:{health:"",port:3306},mariadb:{health:"",port:3306},mongo:{health:"",port:27017},rabbitmq:{health:"",port:5672}};function Ae(e){return(e.split("@")[0].split("/").pop()??e).split(":")[0]}p(Ae,"imageRepoName");var Oe=p((e,t)=>e.name.localeCompare(t.name),"byName");function Ee(e){let t=e.image?Ae(e.image):"";return Object.hasOwn(ae,t)?t:null}p(Ee,"datastoreOf");function Ne(e,t){let r=e.filter(f=>f.kind==="package"||f.kind==="dockerfile"),a=e.filter(f=>f.kind==="k8s"||f.kind==="compose"),i=[...new Set(r.map(f=>f.dir))].sort(),n=p(f=>f==="."?t:U.posix.basename(f),"base"),s=p(f=>{let h=U.posix.dirname(f);return h==="."?t:U.posix.basename(h)},"parent"),o=new Map;for(let f of i)o.set(n(f),(o.get(n(f))??0)+1);let c=i.map(f=>({dir:f,name:(o.get(n(f))??0)>1?`${s(f)}-${n(f)}`:n(f),findings:r.filter(h=>h.dir===f)})),u=[(f,h)=>f.kind==="k8s"&&f.dir!==null&&h.dir!=="."&&(f.dir===h.dir||f.dir.startsWith(`${h.dir}/`)),(f,h)=>f.kind==="compose"&&f.dir!==null&&f.dir===h.dir,(f,h)=>f.name===h.name,(f,h)=>!!f.image&&Ae(f.image)===h.name],m=[];for(let f of a){let h=Ee(f)?[u[2]]:u,b;for(let N of h)if(b=c.find(j=>N(f,j)),b)break;b?b.findings.push(f):m.push(f)}let d=[],g=new Map,k=[];for(let f of m){let h=Ee(f);if(h){let b=g.get(f.name)??{name:f.name,datastore:h,findings:[]};b.findings.push(f),g.set(f.name,b)}else{k.push(f);let b=f.kind==="k8s"?"Deployment":"compose service";d.push({item:f.file,reason:`found ${b} ${f.name} \u2014 no source dir in this repo, skipped`})}}return{services:c.filter(f=>{let h=f.findings.some(b=>b.kind!=="package"||b.runnable);return h||d.push({item:f.dir,reason:"library package (no Dockerfile, deploy config or dev/start script), skipped"}),h}).sort(Oe),infrastructure:[...g.values()].sort(Oe),unmatched:k,skipped:d}}p(Ne,"correlate");var ot={type:["package"],archetype:["package"],test:["package"],internal_port:["k8s","compose","dockerfile"],health_endpoint:["k8s","compose"],setup_service:["package"],image:["dockerfile","package"],command:["package","compose","dockerfile"],memory_limit:["k8s"],memory_reservation:["k8s"],node_modules_volume:["package"],secrets:["k8s"],k8s_deployment:["k8s"],k8s_namespace:["k8s"],k8s_port:["k8s"],k8s_port_name:["k8s"],k8s_pod_prefix:["k8s"],feature_router:["k8s"],depends_on:["compose"]},ce=p((e,t)=>JSON.stringify(e)===JSON.stringify(t),"same");function rt(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}p(rt,"sortKeys");function Pe(e,t){return Object.assign({},...e.filter(r=>r.kind===t&&r.fields.environment).map(r=>r.fields.environment.value))}p(Pe,"envOf");function V(e){let t={path:y(e.dir,"source directory")},r=[];for(let[o,c]of Object.entries(ot)){let u=c.flatMap(g=>e.findings.filter(k=>k.kind===g&&k.fields[o]!==void 0).map(k=>k.fields[o]));if(!u.length)continue;let m=u[0];if(t[o]=m,m.confidence!=="stated")continue;let d=u.slice(1).filter(g=>g.confidence==="stated"&&!ce(g.value,m.value)).filter((g,k,v)=>v.findIndex(f=>ce(f.value,g.value))===k);d.length&&r.push({service:e.name,key:o,chosen:m,also:d})}t.internal_port??=w(3e3,"no port in any source \u2014 default 3000"),t.health_endpoint??=w("","no readiness probe or healthcheck \u2014 TCP-only"),t.type??=w("api","no package.json \u2014 assumed a service"),t.image??=w("alpine:3","no usable FROM and no package.json \u2014 set the dev image"),!t.feature_router&&t.type.value==="web"&&(t.feature_router=w({},"type: web \u2014 routed through Caddy"));let a=Pe(e.findings,"k8s"),i=Pe(e.findings,"compose"),n={...a,...i};if(Object.keys(n).length){let o=[Object.keys(i).length?"compose environment":"",Object.keys(a).length?"k8s env":""];t.environment=y(rt(n),o.filter(Boolean).join(" + "))}let s=Object.keys(a).filter(o=>!(o in i)).sort();return{name:e.name,dir:e.dir,fields:t,conflicts:r,k8sEnvKeys:s,findings:e.findings}}p(V,"resolveService");function Me(e,t=[]){let r=ae[e.datastore],a=e.findings.filter(o=>o.kind==="k8s"),i=a[0];for(let o of a.slice(1))for(let c of["internal_port","k8s_namespace"]){let u=i.fields[c],m=o.fields[c];u&&m&&!ce(u.value,m.value)&&t.push({item:o.file,reason:`infrastructure ${e.name}: ${c} ${m.value} disagrees with ${u.value} (${u.source}), kept ${u.value}`})}let n=i?.fields.internal_port??e.findings.find(o=>o.fields.internal_port)?.fields.internal_port,s="no k8s manifest for this datastore";return{name:e.name,fields:{internal_port:n??y(r.port,`${e.datastore} default port`),k8s_namespace:i?.fields.k8s_namespace??w("default",s),k8s_pod_prefix:i?.fields.k8s_pod_prefix??w(e.name,s),health_endpoint:y(r.health,r.health?`${e.datastore} wire probe`:"no wire probe for this datastore \u2014 TCP-only")}}}p(Me,"resolveInfra");var Xt={type:"object",required:["answers"],additionalProperties:!1,properties:{answers:{type:"array",items:{type:"object",required:["item","value","reason","files_read"],additionalProperties:!1,properties:{item:{type:"string"},value:{},reason:{type:"string"},files_read:{type:"array",items:{type:"string"}}}}}}};function it(e){let t=e.existing?(0,Ie.parse)(e.existing)??{}:{},r=p((n,s)=>t?.services?.[n]?.[s]!==void 0,"inFile"),a=e.services.map(n=>n.name),i=[];for(let n of e.services){let s=n.fields,o=p((m,d)=>{r(n.name,m)||i.push({id:`${n.name}.${m}`,service:n.name,...d})},"ask");s.command?.confidence==="guessed"&&o("command",{kind:"command",prompt:`What command starts ${n.name} for local development? It runs with the repo root mounted at /app as the working directory.`,facts:{dir:n.dir,guess:s.command.value,why:s.command.source}}),s.health_endpoint?.confidence==="guessed"&&o("health_endpoint",{kind:"health_endpoint",prompt:`Which HTTP path answers 200 when ${n.name} is healthy? Answer "" if it has none.`,facts:{dir:n.dir,port:s.internal_port?.value}});let c=e.envExample[n.name]??[];c.length&&(o("environment",{kind:"environment",prompt:`Which environment variables does ${n.name} need for local development, with development values? Leave secrets out.`,facts:{dir:n.dir,env_example_keys:c,current:s.environment?.value??{}}}),s.secrets||o("secrets",{kind:"secrets",prompt:`Which of these keys must be set for ${n.name} to start at all? A declared secret that is missing stops \`werkmeister feature up\`.`,facts:{dir:n.dir},choices:c}));let u=a.filter(m=>m!==n.name);u.length&&!s.depends_on&&o("depends_on",{kind:"depends_on",prompt:`Which of these services must be running before ${n.name} starts (it calls them at startup)? Answer [] for none.`,facts:{dir:n.dir},choices:u});for(let m of n.conflicts)o(m.key,{kind:"conflict",prompt:`Sources disagree on ${n.name}.${m.key}. Which value is right for local development?`,facts:{sources:[m.chosen,...m.also].map(d=>({value:d.value,source:d.source}))},choices:[m.chosen.value,...m.also.map(d=>d.value)]})}for(let n of[...new Set(e.unmatched.map(s=>s.name))]){let s=e.unmatched.filter(c=>c.name===n),o=s.map(c=>c.file).join(", ");i.push({id:`unmatched.${n}`,kind:"unmatched",service:null,prompt:`${o} define${s.length>1?"":"s"} ${n}, but no source directory matched it. Which service is it? Answer null if its code lives in another repo.`,facts:{files:s.map(c=>c.file),image:s.find(c=>c.image)?.image??null},choices:[...a,null]})}return i}p(it,"collectQuestions");var at=p(e=>!!e&&typeof e=="object"&&!Array.isArray(e)&&Object.values(e).every(t=>typeof t=="string"),"isStringMap"),De=p((e,t)=>Array.isArray(e)&&e.every(r=>typeof r=="string"&&t.includes(r)),"subsetOf"),ct=p((e,t)=>JSON.stringify(e)===JSON.stringify(t),"same");function ft(e,t,r,a){if(r===null)return null;let i=typeof r=="string"?e.services.find(o=>o.name===r):void 0,n=e.unmatched.filter(o=>`unmatched.${o.name}`===t);if(!i||!n.length)return"expected one of this repo's services, or null";let s=V({name:i.name,dir:i.dir,findings:[...i.findings,...n]});for(let[o,c]of Object.entries(s.fields))o in i.fields||(i.fields[o]={...c,confidence:"inferred",source:`${c.source}; matched by Claude: ${a}`});return i.findings.push(...n),e.unmatched=e.unmatched.filter(o=>!n.includes(o)),e.skipped=e.skipped.filter(o=>!n.some(c=>o.item===c.file&&o.reason.includes(` ${c.name} \u2014 `))),null}p(ft,"applyUnmatched");function Qt(e,t){let r=structuredClone(e),a=new Map(it(e).map(o=>[o.id,o])),i=[],n=[],s=new Set;for(let o of t){let c=a.get(o.item);if(!c){n.push({item:o.item,reason:"not one of the questions asked"});continue}if(s.has(o.item)){n.push({item:o.item,reason:"answered twice; kept the first"});continue}s.add(o.item);let u=o.reason?.trim()||"no reason given",m=p(k=>({value:k,source:u,confidence:"inferred"}),"inferred"),d=c.service?r.services.find(k=>k.name===c.service):void 0,g=null;if(c.kind==="unmatched")g=ft(r,c.id,o.value,u);else if(!d)g=`no service named ${c.service} in this plan`;else switch(c.kind){case"command":typeof o.value=="string"&&o.value.trim()?d.fields.command=m(o.value.trim()):g="expected a non-empty command string";break;case"health_endpoint":typeof o.value=="string"&&(o.value===""||o.value.startsWith("/"))?d.fields.health_endpoint=m(o.value):g='expected "" or a path starting with /';break;case"environment":{if(!at(o.value)){g="expected an object of string values";break}let k=d.fields.environment?.value??{},v=Object.fromEntries(Object.entries({...o.value,...k}).sort(([h],[b])=>h.localeCompare(b))),f=d.fields.environment?.source;d.fields.environment=m(v),f&&(d.fields.environment.source=`${f}; Claude added keys: ${u}`);break}case"secrets":De(o.value,c.choices??[])?o.value.length&&(d.fields.secrets=m([...o.value].sort())):g="expected a list of keys from .env.example";break;case"depends_on":De(o.value,c.choices??[])?o.value.length&&(d.fields.depends_on=m([...o.value].sort())):g="expected a list of this repo's other services";break;case"conflict":{let k=(c.choices??[]).find(f=>ct(f,o.value));if(k===void 0){g="not one of the conflicting values";break}let v=c.id.slice(d.name.length+1);d.fields[v]=m(k),d.conflicts=d.conflicts.filter(f=>f.key!==v);break}}g?n.push({item:o.item,reason:g}):i.push(o.item)}return{plan:r,accepted:i,rejected:n}}p(Qt,"applyAnswers");function es(e){return["You are helping generate a werkmeister service-registry fragment for the repository in your working directory.","A deterministic scan already filled every field it could read from package manifests, Dockerfiles, compose files and Kubernetes manifests.","The questions below are the fields it had to guess. Answer each one from the repository's own files, using Read, Glob and Grep.","","Rules:","- Answer only the questions listed, using each question's `id` as `item`.","- When a question has `choices`, `value` must be one of them; for list questions, a subset of them.","- Leave a question out if the repository doesn't settle it. A missing answer keeps the scan's guess; a wrong answer is worse than none.","- Never put credentials, tokens or keys in environment values. Those belong in `secrets`.",'- `reason` is one short sentence naming the evidence, e.g. "apps/api/src/main.ts registers GET /healthz". It is written into the file as a comment.',"- `files_read` lists the files that support the answer.","","Questions (JSON):",JSON.stringify(e,null,2)].join(`
|
|
4
4
|
`)}p(es,"assistPrompt");$();var Je=M(F(),1);import*as X from"node:fs";import*as T from"node:path";$();var Te=M(F(),1);import*as Z from"node:path";var fe=/(^|\/)(docker-)?compose(\.[\w-]+)?\.ya?ml$/;function Fe(e){if(typeof e=="number")return Number.isInteger(e)&&e>0?e:void 0;if(typeof e=="string"){let t=(e.split(":").pop()??"").split("/")[0].split("-")[0],r=Number(t);return Number.isInteger(r)&&r>0?r:void 0}if(e&&typeof e=="object"){let t=e.target;return typeof t=="number"&&Number.isInteger(t)?t:void 0}}p(Fe,"containerPort");function pt(e){return Array.isArray(e)?Object.fromEntries(e.map(String).filter(t=>t.includes("=")).map(t=>[t.slice(0,t.indexOf("=")),t.slice(t.indexOf("=")+1)])):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null).map(([t,r])=>[t,String(r)])):{}}p(pt,"envMap");function mt(e){let t=e?.test,r=Array.isArray(t)?t.join(" "):String(t??"");return/https?:\/\/[^/\s"']+(\/[^\s"']*)/.exec(r)?.[1]}p(mt,"healthPath");function Re(e){let t=[];for(let r of e.files.filter(a=>fe.test(a))){let a;try{a=(0,Te.parse)(S(e,r),{merge:!0})}catch(i){e.skipped.push({item:r,reason:`unparsable YAML: ${i instanceof Error?i.message:String(i)}`});continue}for(let[i,n]of Object.entries(a?.services??{})){if(!n||typeof n!="object")continue;let s=n,o=p(f=>`${r} \u2192 services.${i}.${f}`,"src"),c=typeof s.build=="string"?s.build:s.build?.context,u=c===void 0?null:Z.posix.normalize(Z.posix.join(Z.posix.dirname(r),String(c))).replace(/\/$/,"")||".",m={},d=pt(s.environment);Object.keys(d).length&&(m.environment=y(d,o("environment")));let g=Array.isArray(s.depends_on)?s.depends_on.map(String):s.depends_on&&typeof s.depends_on=="object"?Object.keys(s.depends_on):[];g.length&&(m.depends_on=y([...g].sort(),o("depends_on"))),s.command!==void 0&&(m.command=y(Array.isArray(s.command)?s.command.join(" "):String(s.command),o("command")));let k=Fe(s.ports?.[0])??Fe(s.expose?.[0]);k&&(m.internal_port=y(k,o(s.ports?"ports":"expose")));let v=mt(s.healthcheck);v&&(m.health_endpoint=y(v,o("healthcheck"))),t.push({kind:"compose",name:i,dir:u,file:r,...s.image?{image:String(s.image)}:{},fields:m})}}return t}p(Re,"detectCompose");$();import*as R from"node:path";var lt=/^(?!.*\.(md|dockerignore)$)(Dockerfile(\..+)?|.+\.Dockerfile)$/,dt=/(^|\.)dev(\.|$)/i;function ut(e){let t=[];for(let r of e.replace(/\\\r?\n/g," ").split(/\r?\n/)){let a=r.trim();if(!a||a.startsWith("#"))continue;let i=/^(\w+)\s+(.*)$/.exec(a);i&&t.push([i[1].toUpperCase(),i[2].trim()])}return t}p(ut,"dockerInstructions");function ht(e){if(e.startsWith("["))try{let t=JSON.parse(e);if(Array.isArray(t))return t.map(String).join(" ")}catch{}return e}p(ht,"commandText");function qe(e){let t=p(a=>dt.test(R.posix.basename(a)),"isDev");return e.files.filter(a=>lt.test(R.posix.basename(a))).sort((a,i)=>Number(t(i))-Number(t(a))||a.localeCompare(i)).map(a=>{let i=R.posix.dirname(a),n=ut(S(e,a)),s={},c=n.find(([k])=>k==="FROM")?.[1].split(/\s+/).find(k=>!k.startsWith("--"));c&&!c.includes("$")&&(s.image=y(c,`${a} \u2192 FROM`));let u=n.find(([k])=>k==="EXPOSE"),m=Number(/(\d+)/.exec(u?.[1]??"")?.[1]);Number.isInteger(m)&&m>0&&(s.internal_port=y(m,`${a} \u2192 EXPOSE`));let d=p(k=>[...n].reverse().find(([v])=>v===k),"last"),g=d("CMD")??d("ENTRYPOINT");if(g){let k=ht(g[1]);s.command=w(i==="."?k:`cd ${i} && exec ${k}`,`${a} \u2192 ${g[0]} is the production entrypoint`)}return{kind:"dockerfile",name:i==="."?R.basename(e.root):R.posix.basename(i),dir:i,file:a,fields:s}})}p(qe,"detectDockerfiles");$();var Ke=M(F(),1);import*as P from"node:path";$();import*as G from"node:path";var gt=new Set(["Deployment","StatefulSet"]);function Ce(e){let t=/^(\d+)([KMG])?i?$/.exec(String(e??""));return t?`${t[1]}${t[2]??""}`:void 0}p(Ce,"memory");function kt(e){let t=e?.spec?.rules??[];return[e?.spec?.defaultBackend?.service?.name,...t.flatMap(r=>(r?.http?.paths??[]).map(a=>a?.backend?.service?.name))].filter(r=>typeof r=="string")}p(kt,"ingressBackends");function J(e){let t=e.flatMap(n=>n.docs.flatMap(s=>s?.kind==="List"&&Array.isArray(s.items)?s.items:[s]).filter(s=>s&&typeof s=="object"&&typeof s.kind=="string").map(s=>({doc:s,source:n}))),r=t.filter(n=>n.doc.kind==="Service").map(n=>n.doc),a=new Set(t.filter(n=>n.doc.kind==="Ingress").flatMap(n=>kt(n.doc))),i=[];for(let{doc:n,source:s}of t.filter(o=>gt.has(o.doc.kind))){let o=n.metadata?.name,c=n.spec?.template?.spec?.containers?.[0];if(typeof o!="string"||!c)continue;let u=p(x=>`${s.file} \u2192 ${x}`,"src"),m={k8s_namespace:n.metadata?.namespace?y(n.metadata.namespace,u("metadata.namespace")):y("default",`${s.file} \u2192 no metadata.namespace (Kubernetes default)`),k8s_pod_prefix:y(o,u(`${n.kind} ${o}`))};n.kind==="Deployment"&&(m.k8s_deployment=y(o,u(`Deployment ${o}`)));let d=c.ports?.[0]?.containerPort;Number.isInteger(d)&&(m.internal_port=y(d,u("containerPort")));let g=c.readinessProbe?.httpGet?.path?["readinessProbe",c.readinessProbe.httpGet.path]:c.livenessProbe?.httpGet?.path?["livenessProbe",c.livenessProbe.httpGet.path]:null;g&&(m.health_endpoint=y(String(g[1]),u(`${g[0]}.httpGet.path`)));let k=Ce(c.resources?.limits?.memory),v=Ce(c.resources?.requests?.memory);k&&(m.memory_limit=y(k,u("resources.limits.memory"))),v&&(m.memory_reservation=y(v,u("resources.requests.memory")));let f={},h=[];for(let x of Array.isArray(c.env)?c.env:[])typeof x?.name=="string"&&(x.valueFrom?.secretKeyRef?h.push(x.name):x.value!==void 0&&x.value!==null&&(f[x.name]=String(x.value)));Object.keys(f).length&&(m.environment=y(f,u("env"))),h.length&&(m.secrets=y([...h].sort(),u("env[].valueFrom.secretKeyRef")));let b=n.spec?.template?.metadata?.labels??{},N=r.find(x=>{let Y=x.spec?.selector??{};return Object.keys(Y).length>0&&Object.entries(Y).every(([Q,ee])=>b[Q]===ee)}),j=N?.metadata?.name,I=N?.spec?.ports?.[0];Number.isInteger(I?.port)&&(m.k8s_port=y(I.port,u(`Service ${j} port`))),typeof I?.name=="string"&&(m.k8s_port_name=y(I.name,u(`Service ${j} port name`))),j&&a.has(j)&&(m.feature_router=y({},u(`Ingress \u2192 Service ${j}`))),i.push({kind:"k8s",name:o,dir:s.dir,file:s.file,...typeof c.image=="string"?{image:c.image}:{},fields:m})}return i}p(J,"findingsFromManifests");function pe(e){return e.filter(t=>G.posix.basename(t)==="Chart.yaml").map(t=>G.posix.dirname(t))}p(pe,"chartDirs");var me=/(^|\/)kustomization\.ya?ml$/,vt=[/(^|\/)values[^/]*\.ya?ml$/,/\.values\.ya?ml$/,/^pnpm-workspace\.yaml$/,fe],yt=/^\s*kind:\s*(Deployment|StatefulSet|Service|Ingress|List)\b/m;function We(e){let t=[...pe(e.files),...e.files.filter(i=>me.test(i)).map(i=>G.posix.dirname(i))],r=p(i=>t.some(n=>n==="."||i.startsWith(`${n}/`)),"ownedElsewhere"),a=[];for(let i of e.files){if(!/\.ya?ml$/.test(i)||r(i)||vt.some(s=>s.test(i)))continue;let n=S(e,i);if(yt.test(n))try{a.push({file:i,dir:G.posix.dirname(i),docs:K(n)})}catch(s){e.skipped.push({item:i,reason:`unparsable YAML: ${s instanceof Error?s.message:String(s)}`})}}return J(a)}p(We,"detectK8s");function _t(e,t){try{let r=(0,Ke.parse)(S(e,`${t}/Chart.yaml`))?.name;return typeof r=="string"&&r?r:P.posix.basename(t)}catch{return P.posix.basename(t)}}p(_t,"chartName");function Le(e){let t=pe(e.files),r=[];for(let a of t){let i=P.posix.dirname(a),n=t.filter(c=>P.posix.dirname(c)===i),s=e.files.filter(c=>P.posix.dirname(c)===i&&/[^/]\.values\.ya?ml$/.test(c));if(s.length&&n.length>1){if(a===n[0])for(let c of s)e.skipped.push({item:c,reason:`several charts in ${i}/ \u2014 can't tell which one ${c} is for`});continue}let o=s.length?s.map(c=>({release:P.posix.basename(c).replace(/\.values\.ya?ml$/,""),values:c})):[{release:_t(e,a),values:null}];for(let{release:c,values:u}of o){let m=["helm","template",c,P.join(e.root,a)];u&&m.push("-f",P.join(e.root,u));let[d,g]=e.runner(m);if(d===127)return e.skipped.push({item:"helm charts",reason:"helm is not installed \u2014 charts skipped"}),r;let k=u??a;if(d!==0){e.skipped.push({item:k,reason:`helm template failed: ${g.split(`
|
|
5
5
|
`)[0]}`});continue}try{r.push(...J([{file:`${k} (helm template)`,dir:null,docs:K(g)}]))}catch(v){e.skipped.push({item:k,reason:`unparsable helm output: ${v instanceof Error?v.message:String(v)}`})}}}return r}p(Le,"detectHelm");$();var Ye=M(F(),1);import*as q from"node:path";function $t(e,t){let r=new Set;for(let a of t){let i;try{i=(0,Ye.parse)(S(e,a))}catch{continue}let n=q.posix.dirname(a);for(let s of[i?.resources,i?.bases,i?.components].flatMap(o=>Array.isArray(o)?o:[]))typeof s=="string"&&r.add(q.posix.normalize(q.posix.join(n,s)).replace(/\/$/,""))}return r}p($t,"referencedDirs");function ze(e){let t=[],r=e.files.filter(i=>me.test(i)),a=$t(e,r);for(let i of r){let n=q.posix.dirname(i);if(a.has(n))continue;let[s,o]=e.runner(["kubectl","kustomize",q.join(e.root,n)]);if(s===127)return e.skipped.push({item:"kustomize overlays",reason:"kubectl is not installed \u2014 overlays skipped"}),t;if(s!==0){e.skipped.push({item:i,reason:`kubectl kustomize failed: ${o.split(`
|
|
6
6
|
`)[0]}`});continue}try{t.push(...J([{file:`${i} (kubectl kustomize)`,dir:null,docs:K(o)}]))}catch(c){e.skipped.push({item:i,reason:`unparsable kustomize output: ${c instanceof Error?c.message:String(c)}`})}}return t}p(ze,"detectKustomize");$();import*as B from"node:path";var bt=["next","vite","react","expo"],xt=["express","fastify","@nestjs/core","koa"],wt=["sharp","better-sqlite3","esbuild","@swc/core"];function St(e,t,r,a){let i=a.map(s=>s==="test"?s:`run ${s}`),n=p(s=>i.map(s).join(" && "),"chain");return t==="."?n(s=>`${e.pm} ${s}`):r!==void 0?e.pm==="pnpm"?n(s=>`pnpm --filter ${r} ${s}`):e.pm==="yarn"?n(s=>`yarn workspace ${r} ${s}`):n(s=>`npm ${s} -w ${r}`):e.pm==="pnpm"?n(s=>`pnpm --filter ./${t} ${s}`):e.pm==="yarn"?`cd ${t} && ${n(s=>`yarn ${s}`)}`:n(s=>`npm ${s} -w ${t}`)}p(St,"testCommand");function jt(e,t,r,a){for(let i of[r.engines?.node,a?.engines?.node]){let n=/(\d+)/.exec(String(i??""));if(n)return n[1]}for(let i of[B.posix.join(t,".nvmrc"),".nvmrc"]){if(!e.files.includes(i))continue;let n=/(\d+)/.exec(S(e,i));if(n)return n[1]}return"22"}p(jt,"nodeMajor");function Ge(e,t){let r=se(e,"package.json"),a=t.packageDirs.length?t.packageDirs:r?["."]:[],i=[];for(let n of a){let s=n==="."?"package.json":`${n}/package.json`,o=se(e,s);if(!o)continue;let c=o.scripts??{},u={...o.dependencies,...o.devDependencies},m={},d=c.dev?"dev":c.start?"start":null;if(d){let h=`exec ${t.pm} run ${d}`;m.command=y(n==="."?h:`cd ${n} && ${h}`,`${s} \u2192 scripts.${d}`)}if(c.test){let h=c.typecheck?["typecheck","test"]:["test"];m.test=y(St(t,n,o.name,h),`${s} \u2192 ${h.map(b=>`scripts.${b}`).join(", ")}`)}let g=bt.find(h=>h in u),k=xt.find(h=>h in u),v=g?["web","node-web",`${s} \u2192 dependency ${g}`]:k?["api","node-service",`${s} \u2192 dependency ${k}`]:o.bin?["cli","node-tool",`${s} \u2192 bin`]:null;if(v)m.type=y(v[0],v[2]),m.archetype=y(v[1],v[2]);else{let h=`no web, api or bin marker in ${s} \u2014 assumed a service`;m.type=w("api",h),m.archetype=w("node-service",h)}let f=wt.find(h=>h in u);m.image=w(`node:${jt(e,n,o,r)}${f?"":"-alpine"}`,`no Dockerfile \u2014 Node major from engines/.nvmrc${f?`; glibc image because of ${f}`:""}`),t.setupName&&(m.setup_service=y(t.setupName,"shared workspace install"),m.node_modules_volume=y(t.setupFields.node_modules_volume.value,"shared workspace install")),i.push({kind:"package",name:n==="."?B.basename(e.root):B.posix.basename(n),dir:n,file:s,runnable:!!d,fields:m})}return i}p(Ge,"detectPackages");var Ot=[".env.example",".env.sample",".env.template"];function C(e,t,r,a){try{return a()}catch(i){return e.push({item:t,reason:`${t} failed: ${i instanceof Error?i.message:String(i)}`}),r}}p(C,"safely");function Et(e,t){let r=new Set,a=Ot.flatMap(i=>[T.posix.join(t,i),i]);for(let i of new Set(a))if(e.files.includes(i))for(let n of S(e,i).split(/\r?\n/)){let s=/^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=/.exec(n);s&&r.add(s[1])}return[...r].sort()}p(Et,"envExampleKeys");function Hs(e,t){let r=T.resolve(e),a=T.basename(r),i=T.join(r,_e),n=X.existsSync(i)?X.readFileSync(i,"utf8"):null,s=n?(0,Je.parse)(n)??null:null,o={root:r,files:ve(r,t.runner),runner:t.runner,skipped:[]},c=Object.values(s?.services??{}).map(l=>l?.setup_service).find(l=>typeof l=="string")??null,u=Object.values(s?.services??{}).map(l=>l?.node_modules_volume).find(l=>typeof l=="string")??null,m={pm:"npm",packageDirs:[],setupName:null,setupFields:{}},d=C(o.skipped,"workspace detection",m,()=>ye(o,c,u)),g=[...C(o.skipped,"package.json detection",[],()=>Ge(o,d)),...C(o.skipped,"Dockerfile detection",[],()=>qe(o)),...C(o.skipped,"k8s manifest detection",[],()=>We(o)),...C(o.skipped,"Helm detection",[],()=>Le(o)),...C(o.skipped,"kustomize detection",[],()=>ze(o)),...C(o.skipped,"compose detection",[],()=>Re(o))],k=Ne(g,a),v=k.services.map(V),f=k.infrastructure.map(l=>Me(l,k.skipped)),h=p((l,_,O)=>Object.entries(s?.[l]??{}).find(([,A])=>A?.[_]===O)?.[0],"adopt"),b=new Map;for(let l of v){let _=h("services","path",l.dir);if(_&&_!==l.name){b.set(l.name,_),l.name=_;for(let O of l.conflicts)O.service=_}}let N=new Map(f.map(l=>[l.name,l.name]));for(let l of f){let _=h("infrastructure","k8s_pod_prefix",l.fields.k8s_pod_prefix.value);_&&_!==l.name&&(b.set(l.name,_),N.set(_,l.name),l.name=_)}let j=p((l,_)=>l.name.localeCompare(_.name),"byName");v.sort(j),f.sort(j);let I=new Set(v.map(l=>l.name)),x=p((l,_,O)=>s?.[l]?.[_]?.[O]!==void 0,"inFile"),Y=xe(t.reposRoot,i,t.localPath,s),Q=we(v.filter(l=>!x("services",l.name,"port_offset")).map(l=>l.name),Y.offsets,t.portsPerSlot);for(let l of v){let _=Q.get(l.name);_!==void 0&&(l.fields.port_offset=y(_,"lowest free offset across registered repos"))}let ee=Se(f.filter(l=>!x("infrastructure",l.name,"k8s_forward_port")).map(l=>l.name),Y.forwards);for(let l of f){let _=ee.get(l.name);_!==void 0&&(l.fields.k8s_forward_port=y(_,"lowest free forward port from 9050"))}let et=f.map(l=>({name:l.name,host:N.get(l.name),port:Number(s?.infrastructure?.[l.name]?.internal_port??l.fields.internal_port.value),forward:Number(s?.infrastructure?.[l.name]?.k8s_forward_port??l.fields.k8s_forward_port?.value)}));for(let l of v){let _=l.fields.environment;if(!_)continue;let{env:O,rewritten:A}=je(_.value,l.k8sEnvKeys,et);A.length&&(l.fields.environment=w(O,`${_.source}; ${A.join(", ")} rewritten from the in-cluster address to the werkmeister tunnel`))}for(let l of v){let _=l.fields.depends_on;if(!_)continue;let O=[...new Set(_.value.map(A=>b.get(A)??A))].filter(A=>I.has(A)&&A!==l.name).sort();O.length?l.fields.depends_on={..._,value:O}:delete l.fields.depends_on}let te=v.filter(l=>l.fields.setup_service),tt=d.setupName&&te.length?{name:d.setupName,fields:{image:{...te[0].fields.image,source:`same image as ${te[0].name}`},...d.setupFields}}:null,de={};for(let l of v){let _=new Set([...Object.keys(l.fields.environment?.value??{}),...l.fields.secrets?.value??[]]),O=Et(o,l.dir).filter(A=>!_.has(A));O.length&&(de[l.name]=O)}return{repo:a,root:r,fragmentPath:i,existing:n,services:v,infrastructure:f,setup:tt,envExample:de,unmatched:k.unmatched,skipped:[...o.skipped,...k.skipped]}}p(Hs,"planFragment");function Us(e){let t=p(r=>Object.fromEntries(Object.entries(r).map(([a,i])=>[a,{value:i.value,source:i.source,confidence:i.confidence}])),"fields");return{repo:e.repo,fragment:e.fragmentPath,existed:e.existing!==null,services:e.services.map(r=>({name:r.name,dir:r.dir,fields:t(r.fields),conflicts:r.conflicts.map(a=>({key:a.key,chosen:a.chosen,also:a.also}))})),infrastructure:e.infrastructure.map(r=>({name:r.name,fields:t(r.fields)})),setup:e.setup?{name:e.setup.name,fields:t(e.setup.fields)}:null,envExample:e.envExample,skipped:e.skipped}}p(Us,"planSummary");$();var D=M(F(),1);var At=["# Werkmeister service-registry fragment for this repo.","#","# `werkmeister registry sync` (run by `werkmeister machine setup`) merges every","# <repo>/.werkmeister/services.yaml under paths.repos_root into","# ~/.werkmeister/services.yaml. Only `services:`, `setup_services:` and","# `infrastructure:` may appear here; `repo:` is the checkout's directory name","# and `repos:` is derived. Generated by `werkmeister machine detect`; re-running it only","# adds what is missing, so edit freely.","",""].join(`
|
|
@@ -21,4 +21,4 @@ import{b as st}from"./chunk-KFPZ5GPD.js";import{f as _e,g as $e,h as H,i as be}f
|
|
|
21
21
|
|
|
22
22
|
`)+n.join(`
|
|
23
23
|
`)),{path:e.fragmentPath,yaml:u,added:s,changed:u!==t,skipped:o}}p(Qs,"renderFragment");$();var le=M(st(),1),Qe=M(F(),1);import*as L from"node:fs";import*as Xe from"node:os";import*as W from"node:path";var Ft=le.default.default??le.default;function Tt(){return W.join(ge(),"infra","schemas","services-fragment.schema.json")}p(Tt,"defaultSchemaPath");function an(e,t,r,a=Tt()){let i;try{i=(0,Qe.parse)(e.yaml)??{}}catch(o){return[`generated YAML does not parse: ${o instanceof Error?o.message:String(o)}`]}let n=new Ft({allErrors:!0,strict:!1}).compile(JSON.parse(L.readFileSync(a,"utf8"))),s=n(i)?[]:(n.errors??[]).map(o=>`${o.instancePath||"/"} ${o.message??"is invalid"}`);try{let o=H(r).filter(c=>W.resolve(c.path)!==W.resolve(t.fragmentPath));be([...o,{repo:t.repo,path:t.fragmentPath,doc:i}],{defaults:{},local:{},paths:{home:Xe.homedir(),repos_root:r,workspaces_root:r,werkmeister_home:ue(),local_domain:ke().local_domain}})}catch(o){if(!(o instanceof $e))throw o;s.push(o.message)}return s}p(an,"validateFragment");function cn(e){L.mkdirSync(W.dirname(e.path),{recursive:!0}),L.writeFileSync(e.path,e.yaml)}p(cn,"writeFragment");$();export{re as a,Ct as b,Xt as c,it as d,Qt as e,es as f,Hs as g,Us as h,Qs as i,an as j,cn as k};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-GZNJ7GIP.js.map
|