@godaddy/cli 0.2.2 → 0.2.3
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/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -335,7 +335,7 @@ ${St(Qa(a,8),`
|
|
|
335
335
|
`))));case"zsh":return Y2(e.command,a).pipe(V(c=>Zr(St(c,`
|
|
336
336
|
`))))}}case"ShowWizard":{let a=p1(e.summary)?aa:hs([ms,lt("--"),ms,e.summary]),c=Xe(me(hs([lt("The wizard mode will assist you with constructing commands for"),ms,Ql(`${e.name} (${e.version})`),lt(".")])),me("Please answer all prompts provided by the wizard.")),u=Ed([[lt("Instructions"),c]]),p=Uc(hs([Ql("Wizard Mode for CLI Application:"),ms,Ql(e.name),ms,Ql(`(${e.version})`),a])),f=Xe(p,u),d=ir(f),h=Ze(ZO(e.command))[0],m=ALe(n,h,r);return Zr(d).pipe(tt(tH(n.command,m,i)),Dr(x=>Zr(ir(CLe(x)))),V(x=>c0({message:"Would you like to run the command?",initial:!0,active:"yes",inactive:"no"}).pipe(V(E=>{let b=LF(s,2),v=El(x,1),S=Le(b,v);return E?Zr().pipe(tt(R0(e,S,o))):Te}))),st(x=>{if(Rse(x)){let E=me(_re(`
|
|
337
337
|
|
|
338
|
-
Quitting wizard mode...`));return Zr(ir(E))}return C(x)}))}case"ShowVersion":{let a=me(e.version);return Zr(ir(a))}}},TLe=e=>{let t=e,r=De();for(;t!==void 0;)switch(t._tag){case"Standard":{r=Ae(t.name),t=void 0;break}case"GetUserInput":{r=Ae(t.name),t=void 0;break}case"Map":{t=t.command;break}case"Subcommands":{t=t.parent;break}}return r},ALe=(e,t,r)=>{let n=Z2(e.command),[o,i]=$m(r,a=>!r6(n,a)),s=Mo(i,{onEmpty:()=>qm(o,a=>a!=="--wizard"),onNonEmpty:a=>dn(o,a)});return Le(t.split(/\s+/),s)},CLe=e=>{let t=y(qm(e,n=>n.length>0),St(" ")),r=lt("You may now execute your command directly with the following options and arguments:");return f1([me(pk(Ql("Wizard Mode Complete!"))),me(r),me(Bo(lt(" "),yd(t,zI)))])},oce=e=>e&&(e==="--log-level"||e.startsWith("--log-level="));var kLe="@effect/cli/Command",sH=Symbol.for(kLe),RLe=e=>{let t=[],r=0,n=[],o=0;function i(a){let c={};for(let u in a)c[u]=s(a[u]);return c}function s(a){return Mu(a)?{_tag:"Array",children:we(a,s)}:C0(a)?(t.push(a),{_tag:"Args",index:r++}):O0(a)?(n.push(a),{_tag:"Options",index:o++}):{_tag:"ParsedConfig",tree:i(a)}}return{args:t,options:n,tree:i(e)}},sce=(e,t,r)=>{let n={};for(let i in e)n[i]=o(e[i]);return n;function o(i){return i._tag==="Args"?t[i.index]:i._tag==="Options"?r[i.index]:i._tag==="Array"?we(i.children,o):sce(i.tree,t,r)}},ace={...ix,[sH]:sH,commit(){return this.tag},pipe(){return W(this,arguments)}},aH=Je("@effect/cli/Command/registeredDescriptors",()=>new WeakMap),NLe=e=>aH.get(e.tag)??e.descriptor,DLe=(e,t,r,n=de)=>{let o=Object.create(ace);return o.descriptor=e,o.handler=t,o.transform=n,o.tag=r,o},cce=(e,t)=>{let r=Object.create(ace);return r.descriptor=t.descriptor??e.descriptor,r.handler=t.handler??e.handler,r.transform=t.transform?(n,o)=>t.transform(e.transform(n,o),o):e.transform,r.tag=e.tag,r},lce=g(e=>Kae(e[0]),(e,t)=>{let r=DLe(e,t??(n=>hU(()=>ece(NLe(r)))),br(`@effect/cli/Command/(${Ze(ZO(e)).join("|")})`));return r}),PLe=(e,t)=>{let{args:r,options:n,tree:o}=RLe(t);return eH(Gae(e,Np(n),F2(r)),({args:i,options:s})=>sce(o,i,s))},uce=(e,t={},r)=>lce(PLe(e,t),r);var FLe=g(2,(e,t)=>cce(e,{descriptor:t(e.descriptor)}));var pce=g(2,(e,t)=>FLe(e,Yae(t))),fce=g(2,(e,t)=>{let r=Zae(e.descriptor,we(t,i=>[i.tag,i.descriptor])),n=vi(t,new Map,(i,s)=>(i.set(s.tag,s),aH.set(s.tag,s.descriptor),i));function o(i){if(i.subcommand._tag==="Some"){let[s,a]=i.subcommand.value,c=n.get(s),u=c.transform(c.handler(a),a);return MI(u,e.tag,i)}return e.handler(i)}return cce(e,{descriptor:r,handler:o})});var dce=g(2,(e,t)=>{let r=ice({...t,command:e.descriptor});aH.set(e.tag,e.descriptor);let n=o=>e.transform(e.handler(o),o);return o=>R0(r,o,n)});var _t=uce;var wt=pce;var hi=fce;var mce=dce;l();l();l();l();l();l();var cH=Symbol.for("@effect/platform/CommandExecutor"),hce=Symbol.for("@effect/platform/Process"),gce=uO(),yce=uO(),xce=br("@effect/platform/CommandExecutor"),Ece=e=>{let t=n=>Id(oe(e(n),o=>o.stdout)),r=(n,o)=>{let i=new TextDecoder(o);return Hie(jie(t(n),Hm(s=>i.decode(s))))};return{[cH]:cH,start:e,exitCode:n=>La(V(e(n),o=>o.exitCode)),stream:t,string:(n,o="utf-8")=>{let i=new TextDecoder(o);return y(e(n),V(s=>NR(s.stdout,MLe)),oe(s=>i.decode(s)),La)},lines:(n,o="utf-8")=>y(r(n,o),Bie,oe(G4)),streamLines:r}},MLe=Fie(new Uint8Array,(e,t)=>mS(t,e,(r,n)=>{let o=new Uint8Array(r.length+n.length);return o.set(r),o.set(n,r.length),o}));var lH=Symbol.for("@effect/platform/Command");var bce=e=>Array.from(uH(e)),uH=e=>{switch(e._tag){case"StandardCommand":return Pt(e);case"PipedCommand":return Cr(uH(e.left),uH(e.right))}};var Sce={[lH]:lH,pipe(){return W(this,arguments)},...uT},qLe={...Sce,_tag:"StandardCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,command:this.command,args:this.args,env:Object.fromEntries(this.env),cwd:this.cwd.toJSON(),shell:this.shell,gid:this.gid.toJSON(),uid:this.uid.toJSON()}}},ULe=e=>Object.assign(Object.create(qLe),e),jLe={...Sce,_tag:"PipedCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,left:this.left.toJSON(),right:this.right.toJSON()}}},BLe=e=>Object.assign(Object.create(jLe),e);var pH=g(2,(e,t)=>{switch(e._tag){case"StandardCommand":return ULe({...e,stdin:t});case"PipedCommand":return BLe({...e,left:pH(e.left,t)})}});var fH=bce;var dH=pH;l();var vce=xce,mH=hce,Oce=gce,_ce=yce,wce=Ece;import*as N0 from"node:child_process";l();var Rr=(e,t)=>(r,[n])=>{let o="Unknown";switch(r.code){case"ENOENT":o="NotFound";break;case"EACCES":o="PermissionDenied";break;case"EEXIST":o="AlreadyExists";break;case"EISDIR":o="BadResource";break;case"ENOTDIR":o="BadResource";break;case"EBUSY":o="Busy";break;case"ELOOP":o="BadResource";break}return new Nd({reason:o,module:e,method:t,pathOrDescriptor:n,syscall:r.syscall,description:r.message,cause:r})};l();l();var hH=(e,t,r)=>fE(zLe(e,t,r));var zLe=(e,t,r)=>IB(()=>GLe(e(),t,Aa(void 0),r)),Tce=(e,t,{encoding:r,endOnDone:n=!0}={},o=Te)=>{let i=KLe(e,r),s=n?cs(a=>{"closed"in e&&e.closed?a(Te):(e.once("finish",()=>a(Te)),e.end())}):Te;return{awaitRead:()=>Te,emit:i,error:a=>tt(s,t(a)),done:a=>tt(s,o)}},KLe=(e,t)=>r=>r.length===0?Te:cs(n=>{let o=r[Symbol.iterator](),i=o.next();function s(){let a=i;i=o.next();let c=e.write(a.value,t);i.done?n(Te):c?s():e.once("drain",s)}s()}),GLe=(e,t,r,n)=>{if(!e.readable)return CO;let o=SU(!1);function i(){o.unsafeOpen()}function s(p){r.current=Vf(t(p)),o.unsafeOpen()}function a(){r.current=Fl,o.unsafeOpen()}e.on("readable",i),e.on("error",s),e.on("end",a);let c=n?.chunkSize?Number(n.chunkSize):void 0,u=IB(function p(){let f=e.read(c);if(f===null)return r.current?Die(r.current):(o.unsafeClose(),Cd(o.await,p));let d=[f];for(;;){if(f=e.read(c),f===null)return Cd(IR(mn(d)),p);d.push(f)}});return Nie(u,Re(()=>{e.off("readable",i),e.off("error",s),e.off("end",a),n?.closeOnDone!==!1&&"closed"in e&&!e.closed&&e.destroy()}))};var Ace=(e,t,r)=>Mie(QLe(e,t,r)),QLe=(e,t,r)=>Cd(ra(Re(()=>e()),Mr()),([n,o])=>CB(JLe(n,o,t),Tce(n,i=>ql(o,i),r,wI(o,Te)))),JLe=(e,t,r)=>ot(()=>{function n(o){Pa(t,C(r(o)))}return e.on("error",n),Ii(Xt(t),Re(()=>{e.removeListener("error",n)}))});var YLe=e=>typeof e=="string"?e:"pipe",Cce=e=>typeof e=="string"?e:"pipe",e_=e=>e instanceof globalThis.Error?e:new globalThis.Error(String(e)),Bd=(e,t,r)=>{let n=fH(r).reduce((o,i)=>{let s=`${i.command} ${i.args.join(" ")}`;return o.length===0?s:`${o} | ${s}`},"");return Rr("Command",e)(t,[n])},ZLe={[mH]:mH,...uT,toJSON(){return{_id:"@effect/platform/CommandExecutor/Process",pid:this.pid}}},t_=e=>t=>{switch(t._tag){case"StandardCommand":{let r=V(Mr(),i=>cs(s=>{let a=N0.spawn(t.command,t.args,{stdio:[YLe(t.stdin),Cce(t.stdout),Cce(t.stderr)],cwd:Ie(t.cwd,py),shell:t.shell,env:{...process.env,...Object.fromEntries(t.env)},detached:process.platform!=="win32"});return a.on("error",c=>{s(C(Bd("spawn",c,t)))}),a.on("exit",(...c)=>{Pa(i,k(c))}),a.on("spawn",()=>{s(k([a,i]))}),Re(()=>{a.kill("SIGTERM")})})),n=process.platform==="win32"?(i,s)=>cs(a=>{N0.exec(`taskkill /pid ${i.pid} /T /F`,c=>{a(c?C(Bd("kill",e_(c),t)):Te)})}):(i,s)=>ea({try:()=>process.kill(-i.pid,s),catch:a=>Bd("kill",e_(a),t)}),o=(i,s)=>ot(()=>i.kill(s)?Te:C(Bd("kill",new globalThis.Error("Failed to kill process"),t)));return y(Ce(t.cwd,{onNone:()=>Te,onSome:i=>e.access(i)}),tt(To(r,([i,s])=>V(id(s),a=>a?V(Xt(s),([c])=>c!==0&&c!==null?n(i,"SIGTERM").pipe(ad):Te):n(i,"SIGTERM").pipe(ud(()=>o(i,"SIGTERM")),tt(Xt(s)),ad)))),oe(([i,s])=>{let a=Pie;i.stdin!==null&&(a=Ace(()=>i.stdin,m=>Bd("toWritable",e_(m),t)));let c=V(Xt(s),([m,x])=>m!==null?k(Oce(m)):C(Bd("exitCode",new globalThis.Error(`Process interrupted due to receipt of signal: ${x}`),t))),u=Ree(id(s)),p=(m="SIGTERM")=>n(i,m).pipe(ud(()=>o(i,m)),tt(ta(Xt(s)))),f=_ce(i.pid),d=hH(()=>i.stderr,m=>Bd("fromReadable(stderr)",e_(m),t)),h=hH(()=>i.stdout,m=>Bd("fromReadable(stdout)",e_(m),t));return typeof t.stdout!="string"&&(h=Vie(h,t.stdout)),Object.assign(Object.create(ZLe),{pid:f,exitCode:c,isRunning:u,kill:p,stdin:a,stderr:d,stdout:h})}),typeof t.stdin=="string"?de:Dr(i=>Nx(NR(t.stdin,i.stdin))))}case"PipedCommand":{let r=fH(t);if(r.length===1)return y(r[0],t_(e));let n=r[0],o=r.slice(1),i=o.slice(0,o.length-1),s=o[o.length-1],a=i.reduce((c,u)=>y(dH(u,c),t_(e),oe(p=>p.stdout),Id),y(t_(e)(n),oe(c=>c.stdout),Id));return y(dH(s,a),t_(e))}}},Ice=Od(vce,y(mr,oe(e=>wce(t_(e)))));var kce=Ice;l();l();l();l();var Rce=(e,t,r)=>(...n)=>cs(o=>{try{e(...n,(i,s)=>{o(i?C(t?t(i,n):i):k(s))})}catch(i){o(r?C(r(i,n)):Ul(i))}});var cn=Rce;import*as Nce from"node:crypto";import*as et from"node:fs";import*as Dce from"node:os";import*as $E from"node:path";var en=e=>t=>new di({module:"FileSystem",method:e,cause:t}),rMe=(()=>{let e=cn(et.access,Rr("FileSystem","access"),en("access"));return(t,r)=>{let n=et.constants.F_OK;return r?.readable&&(n|=et.constants.R_OK),r?.writable&&(n|=et.constants.W_OK),e(t,n)}})(),nMe=(()=>{let e=cn(et.cp,Rr("FileSystem","copy"),en("copy"));return(t,r,n)=>e(t,r,{force:n?.overwrite??!1,preserveTimestamps:n?.preserveTimestamps??!1,recursive:!0})})(),oMe=(()=>{let e=cn(et.copyFile,Rr("FileSystem","copyFile"),en("copyFile"));return(t,r)=>e(t,r)})(),iMe=(()=>{let e=cn(et.chmod,Rr("FileSystem","chmod"),en("chmod"));return(t,r)=>e(t,r)})(),sMe=(()=>{let e=cn(et.chown,Rr("FileSystem","chown"),en("chown"));return(t,r,n)=>e(t,r,n)})(),aMe=(()=>{let e=cn(et.link,Rr("FileSystem","link"),en("link"));return(t,r)=>e(t,r)})(),cMe=(()=>{let e=cn(et.mkdir,Rr("FileSystem","makeDirectory"),en("makeDirectory"));return(t,r)=>e(t,{recursive:r?.recursive??!1,mode:r?.mode})})(),gH=e=>{let t=cn(et.mkdtemp,Rr("FileSystem",e),en(e));return r=>ot(()=>{let n=r?.prefix??"",o=typeof r?.directory=="string"?$E.join(r.directory,"."):Dce.tmpdir();return t(n?$E.join(o,n):o+"/")})},lMe=gH("makeTempDirectory"),yH=e=>{let t=cn(et.rm,Rr("FileSystem",e),en(e));return(r,n)=>t(r,{recursive:n?.recursive??!1,force:n?.force??!1})},uMe=yH("remove"),pMe=(()=>{let e=gH("makeTempDirectoryScoped"),t=yH("makeTempDirectoryScoped");return r=>To(e(r),n=>In(t(n,{recursive:!0})))})(),Pce=e=>{let t=cn(et.open,Rr("FileSystem",e),en(e)),r=cn(et.close,Rr("FileSystem",e),en(e));return(n,o)=>y(To(t(n,o?.flag??"r",o?.mode),i=>In(r(i))),oe(i=>dMe(wse(i),o?.flag?.startsWith("a")??!1)))},fMe=Pce("open"),dMe=(()=>{let e=p=>cn(et.read,Rr("FileSystem",p),en(p)),t=e("read"),r=e("readAlloc"),n=cn(et.fstat,Rr("FileSystem","stat"),en("stat")),o=cn(et.ftruncate,Rr("FileSystem","truncate"),en("truncate")),i=cn(et.fsync,Rr("FileSystem","sync"),en("sync")),s=p=>cn(et.write,Rr("FileSystem",p),en(p)),a=s("write"),c=s("writeAll");class u{fd;append;[YR];semaphore=qee(1);position=0n;constructor(f,d){this.fd=f,this.append=d,this[YR]=YR}get stat(){return oe(n(this.fd),Lce)}get sync(){return i(this.fd)}seek(f,d){let h=xE(f);return this.semaphore.withPermits(1)(Re(()=>(d==="start"?this.position=h:d==="current"&&(this.position=this.position+h),this.position)))}read(f){return this.semaphore.withPermits(1)(oe(ot(()=>t(this.fd,{buffer:f,position:this.position})),d=>{let h=xE(d);return this.position=this.position+h,h}))}readAlloc(f){let d=Number(f);return this.semaphore.withPermits(1)(V(Re(()=>Buffer.allocUnsafeSlow(d)),h=>oe(r(this.fd,{buffer:h,position:this.position}),m=>{if(m===0)return M();if(this.position=this.position+BigInt(m),m===d)return N(h);let x=Buffer.allocUnsafeSlow(m);return h.copy(x,0,0,m),N(x)})))}truncate(f){return this.semaphore.withPermits(1)(oe(o(this.fd,f?Number(f):void 0),()=>{if(!this.append){let d=BigInt(f??0);this.position>d&&(this.position=d)}}))}write(f){return this.semaphore.withPermits(1)(oe(ot(()=>a(this.fd,f,void 0,void 0,this.append?void 0:Number(this.position))),d=>{let h=xE(d);return this.append||(this.position=this.position+h),h}))}writeAllChunk(f){return V(ot(()=>c(this.fd,f,void 0,void 0,this.append?void 0:Number(this.position))),d=>d===0?C(new Nd({module:"FileSystem",method:"writeAll",reason:"WriteZero",pathOrDescriptor:this.fd,description:"write returned 0 bytes written"})):(this.append||(this.position=this.position+BigInt(d)),d<f.length?this.writeAllChunk(f.subarray(d)):Te))}writeAll(f){return this.semaphore.withPermits(1)(this.writeAllChunk(f))}}return(p,f)=>new u(p,f)})(),Fce=e=>{let t=gH(e),r=Pce(e),n=o=>Re(()=>Nce.randomBytes(o).toString("hex"));return o=>y(ra(t(o),n(6)),oe(([i,s])=>$E.join(i,s+(o?.suffix??""))),Dr(i=>La(r(i,{flag:"w+"}))))},mMe=Fce("makeTempFile"),hMe=(()=>{let e=Fce("makeTempFileScoped"),t=yH("makeTempFileScoped");return r=>To(e(r),n=>In(t($E.dirname(n),{recursive:!0})))})(),gMe=(e,t)=>ur({try:()=>et.promises.readdir(e,t),catch:r=>Rr("FileSystem","readDirectory")(r,[e])}),yMe=e=>cs((t,r)=>{try{et.readFile(e,{signal:r},(n,o)=>{t(n?C(Rr("FileSystem","readFile")(n,[e])):k(o))})}catch(n){t(C(en("readFile")(n)))}}),xMe=(()=>{let e=cn(et.readlink,Rr("FileSystem","readLink"),en("readLink"));return t=>e(t)})(),EMe=(()=>{let e=cn(et.realpath,Rr("FileSystem","realPath"),en("realPath"));return t=>e(t)})(),bMe=(()=>{let e=cn(et.rename,Rr("FileSystem","rename"),en("rename"));return(t,r)=>e(t,r)})(),Lce=e=>({type:e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":e.isBlockDevice()?"BlockDevice":e.isCharacterDevice()?"CharacterDevice":e.isFIFO()?"FIFO":e.isSocket()?"Socket":"Unknown",mtime:Ar(e.mtime),atime:Ar(e.atime),birthtime:Ar(e.birthtime),dev:e.dev,rdev:Ar(e.rdev),ino:Ar(e.ino),mode:e.mode,nlink:Ar(e.nlink),uid:Ar(e.uid),gid:Ar(e.gid),size:xE(e.size),blksize:Vr(Ar(e.blksize),xE),blocks:Ar(e.blocks)}),xH=(()=>{let e=cn(et.stat,Rr("FileSystem","stat"),en("stat"));return t=>oe(e(t),Lce)})(),SMe=(()=>{let e=cn(et.symlink,Rr("FileSystem","symlink"),en("symlink"));return(t,r)=>e(t,r)})(),vMe=(()=>{let e=cn(et.truncate,Rr("FileSystem","truncate"),en("truncate"));return(t,r)=>e(t,r!==void 0?Number(r):void 0)})(),OMe=(()=>{let e=cn(et.utimes,Rr("FileSystem","utime"),en("utime"));return(t,r,n)=>e(t,r,n)})(),_Me=(e,t)=>qie(r=>To(Re(()=>{let n=et.watch(e,{recursive:t?.recursive},(o,i)=>{if(i)switch(o){case"rename":{r.fromEffect(Ao(xH(i),{onSuccess:s=>k(Tse({path:i})),onFailure:s=>s._tag==="SystemError"&&s.reason==="NotFound"?k(Cse({path:i})):C(s)}));return}case"change":{r.single(Ase({path:i}));return}}});return n.on("error",o=>{r.fail(new Nd({module:"FileSystem",reason:"Unknown",method:"watch",pathOrDescriptor:e,cause:o}))}),n.on("close",()=>{r.end()}),n}),n=>Re(()=>n.close()))),wMe=(e,t,r)=>xH(t).pipe(oe(n=>e.pipe(Qo(o=>o.register(t,n,r)),Ie(()=>_Me(t,r)))),Wie),TMe=(e,t,r)=>cs((n,o)=>{try{et.writeFile(e,t,{signal:o,flag:r?.flag,mode:r?.mode},i=>{n(i?C(Rr("FileSystem","writeFile")(i,[e])):Te)})}catch(i){n(C(en("writeFile")(i)))}}),AMe=oe(Dv(JR),e=>_se({access:rMe,chmod:iMe,chown:sMe,copy:nMe,copyFile:oMe,link:aMe,makeDirectory:cMe,makeTempDirectory:lMe,makeTempDirectoryScoped:pMe,makeTempFile:mMe,makeTempFileScoped:hMe,open:fMe,readDirectory:gMe,readFile:yMe,readLink:xMe,realPath:EMe,remove:uMe,rename:bMe,stat:xH,symlink:SMe,truncate:vMe,utimes:OMe,watch(t,r){return wMe(e,t,r)},writeFile:TMe})),Mce=Od(mr,AMe);var $ce=Mce;l();l();import*as r_ from"node:path";import*as D0 from"node:url";var EH=e=>ea({try:()=>D0.fileURLToPath(e),catch:t=>new di({module:"Path",method:"fromFileUrl",description:`Invalid file URL: ${e}`,cause:t})}),bH=e=>ea({try:()=>D0.pathToFileURL(e),catch:t=>new di({module:"Path",method:"toFileUrl",description:`Invalid path: ${e}`,cause:t})}),kMe=Sp(ua,ua.of({[dg]:dg,...r_.posix,fromFileUrl:EH,toFileUrl:bH})),RMe=Sp(ua,ua.of({[dg]:dg,...r_.win32,fromFileUrl:EH,toFileUrl:bH})),qce=Sp(ua,ua.of({[dg]:dg,...r_,fromFileUrl:EH,toFileUrl:bH}));var Uce=qce;l();l();l();l();var L0=Symbol.for("effect/Mailbox"),SH=Symbol.for("effect/Mailbox/ReadonlyMailbox");var vg=Nr(),jce=Zt(vg),P0=Zt(!1),F0=Zt(!0),Bce=[vg,!0],vH=class extends Ci{scheduler;capacity;strategy;[L0]=L0;[SH]=SH;state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=Nr();constructor(t,r,n){super(),this.scheduler=t,this.capacity=r,this.strategy=n}offer(t){return je(()=>{if(this.state._tag!=="Open")return P0;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return P0;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),F0):this.offerRemainingSingle(t);case"sliding":return this.unsafeTake(),this.messages.push(t),F0}return this.messages.push(t),this.scheduleReleaseTaker(),F0})}unsafeOffer(t){return this.state._tag!=="Open"?!1:this.messages.length+this.messagesChunk.length>=this.capacity?this.strategy==="sliding"?(this.unsafeTake(),this.messages.push(t),!0):this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),!0):!1:(this.messages.push(t),this.scheduleReleaseTaker(),!0)}offerAll(t){return je(()=>{if(this.state._tag!=="Open")return ie(Oi(t));let r=this.unsafeOfferAllArray(t);return r.length===0?jce:this.strategy==="dropping"?ie(mn(r)):this.offerRemainingArray(r)})}unsafeOfferAll(t){return mn(this.unsafeOfferAllArray(t))}unsafeOfferAllArray(t){if(this.state._tag!=="Open")return Ze(t);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=Cr(this.messagesChunk,mn(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(Cr(Oi(t)),ZF(this.capacity)):fS(t)?this.messagesChunk=Cr(this.messagesChunk,t):this.messages=Ze(t),this.scheduleReleaseTaker(),[];let r=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(r===0)return Ze(t);let n=[],o=0;for(let i of t)o<r?this.messages.push(i):n.push(i),o++;return this.scheduleReleaseTaker(),n}fail(t){return this.done(Zu(t))}failCause(t){return this.done(Wt(t))}unsafeDone(t){return this.state._tag!=="Open"?!1:this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(t),!0):(this.state={...this.state,_tag:"Closing",exit:t},!0)}shutdown=Q(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=vg;let t=this.state.offers;if(this.finalize(this.state._tag==="Open"?gn:this.state.exit),t.size>0){for(let r of t)r._tag==="Single"?r.resume(P0):r.resume(Zt(mn(r.remaining.slice(r.offset))));t.clear()}return!0});done(t){return Q(()=>this.unsafeDone(t))}end=this.done(gn);clear=je(()=>{if(this.state._tag==="Done")return Yy(this.state.exit,vg);let t=this.unsafeTakeAll();return this.releaseCapacity(),ie(t)});takeAll=je(()=>{if(this.state._tag==="Done")return Yy(this.state.exit,Bce);let t=this.unsafeTakeAll();return t.length===0?Yt(this.awaitTake,this.takeAll):ie([t,this.releaseCapacity()])});takeN(t){return je(()=>{if(this.state._tag==="Done")return Yy(this.state.exit,Bce);if(t<=0)return ie([vg,!1]);t=Math.min(t,this.capacity);let r;if(t<=this.messagesChunk.length)r=_y(this.messagesChunk,t),this.messagesChunk=_c(this.messagesChunk,t);else if(t<=this.messages.length+this.messagesChunk.length)this.messagesChunk=Cr(this.messagesChunk,mn(this.messages)),this.messages=[],r=_y(this.messagesChunk,t),this.messagesChunk=_c(this.messagesChunk,t);else return Yt(this.awaitTake,this.takeN(t));return ie([r,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return BA(this.state.exit,Zu(new v7));let t;if(this.messagesChunk.length>0)t=dS(this.messagesChunk),this.messagesChunk=_c(this.messagesChunk,1);else if(this.messages.length>0)t=this.messages[0],this.messagesChunk=_c(mn(this.messages),1),this.messages=[];else return this.capacity<=0&&this.state.offers.size>0?(this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?Zt(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),Zt(t)}take=je(()=>this.unsafeTake()??Yt(this.awaitTake,this.take));await=_l(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.awaiters.add(t),Q(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(t)})));unsafeSize(){let t=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?M():N(t)}size=Q(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return W(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return bt(this)}[nt](){return bt(this)}offerRemainingSingle(t){return _l(r=>{if(this.state._tag!=="Open")return r(P0);let n={_tag:"Single",message:t,resume:r};return this.state.offers.add(n),Q(()=>{this.state._tag==="Open"&&this.state.offers.delete(n)})})}offerRemainingArray(t){return _l(r=>{if(this.state._tag!=="Open")return r(Zt(mn(t)));let n={_tag:"Array",remaining:t,offset:0,resume:r};return this.state.offers.add(n),Q(()=>{this.state._tag==="Open"&&this.state.offers.delete(n)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";if(this.state.offers.size===0)return this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(this.state.exit),this.state.exit._tag==="Success"):!1;let t=this.capacity-this.messages.length-this.messagesChunk.length;for(let r of this.state.offers){if(t===0)return!1;if(r._tag==="Single")this.messages.push(r.message),t--,r.resume(F0),this.state.offers.delete(r);else{for(;r.offset<r.remaining.length;r.offset++){if(t===0)return!1;this.messages.push(r.remaining[r.offset]),t--}r.resume(jce),this.state.offers.delete(r)}}return!1}awaitTake=_l(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.takers.add(t),Q(()=>{this.state._tag!=="Done"&&this.state.takers.delete(t)})));scheduleRunning=!1;scheduleReleaseTaker(){this.scheduleRunning||(this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0))}releaseTaker=()=>{if(this.scheduleRunning=!1,this.state._tag!=="Done"&&this.state.takers.size!==0){for(let t of this.state.takers)if(this.state.takers.delete(t),t(gn),this.messages.length+this.messagesChunk.length===0)break}};unsafeTakeAll(){if(this.messagesChunk.length>0){let t=this.messages.length>0?Cr(this.messagesChunk,mn(this.messages)):this.messagesChunk;return this.messagesChunk=vg,this.messages=[],t}else if(this.messages.length>0){let t=mn(this.messages);return this.messages=[],t}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,Pt(this.messages.pop());return vg}finalize(t){if(this.state._tag==="Done")return;let r=this.state;this.state={_tag:"Done",exit:t};for(let n of r.takers)n(t);r.takers.clear();for(let n of r.awaiters)n(t);r.awaiters.clear()}},Hce=e=>Ct(t=>ie(new vH(t.currentScheduler,typeof e=="number"?e:e?.capacity??Number.POSITIVE_INFINITY,typeof e=="number"?"suspend":e?.strategy??"suspend")));var Vce=e=>{let t=xt(e.takeAll,([r,n])=>n?r.length===0?Ho:Kt(r):wp(Kt(r),t));return t};var FMe=L0;var Wce=e=>se(e,FMe);var M0=Hce;var zce=Vce;import*as $0 from"node:readline";var Gce=e=>e.key.ctrl&&(e.key.name==="c"||e.key.name==="d"),Qce=Lv(function*(e=Gce){let t=process.stdin,r=process.stdout,n=yield*nie({acquire:To(Re(()=>{let p=$0.createInterface({input:t,escapeCodeTimeout:50});return $0.emitKeypressEvents(t,p),t.isTTY&&t.setRawMode(!0),p}),p=>Re(()=>{t.isTTY&&t.setRawMode(!1),p.close()}))}),o=Re(()=>r.columns??0),i=Re(()=>r.rows??0),s=Re(()=>!!r.isTTY),a=R(function*(){yield*xB(n);let p=yield*M0(),f=(d,h)=>{let m={input:Ar(d),key:{name:h.name??"",ctrl:!!h.ctrl,meta:!!h.meta,shift:!!h.shift}};p.unsafeOffer(m),e(m)&&p.unsafeDone(Fl)};return yield*DI(()=>Re(()=>t.off("keypress",f))),t.on("keypress",f),p}),c=xB(n).pipe(V(p=>cs(f=>{let d=h=>f(k(h));return p.once("line",d),Re(()=>p.off("line",d))})),La),u=p=>jl(cs(f=>{r.write(p,d=>f(d?C(new di({module:"Terminal",method:"display",description:"Failed to write prompt to stdout",cause:d})):Te))}));return kr.of({columns:o,rows:i,isTTY:s,readInput:a,readLine:c,display:u})}),Jce=vj(kr,Qce(Gce));var Yce=Jce;l();l();l();l();l();var OH=Symbol.for("effect/FiberSet"),$Me=e=>se(e,OH),qMe={[OH]:OH,[Symbol.iterator](){return this.state._tag==="Closed"?E4():this.state.backing[Symbol.iterator]()},toString(){return bt(this.toJSON())},toJSON(){return{_id:"FiberMap",state:this.state}},[nt](){return this.toJSON()},pipe(){return W(this,arguments)}},UMe=(e,t)=>{let r=Object.create(qMe);return r.state={_tag:"Open",backing:e},r.deferred=t,r},Zce=()=>To(oe(Mr(),e=>UMe(new Set,e)),e=>Ph(t=>{let r=e.state;if(r._tag==="Closed")return Te;e.state={_tag:"Closed"};let n=r.backing;return xX(n,wS(t.id(),ele)).pipe(Pv(e.deferred))}));var Xce=-1,ele=e6(Xce,0),jMe=S7(void 0,{emptyCase:bi,failCase:bi,dieCase:bi,interruptCase:(e,t)=>BT(TS(t),Xce),sequentialCase:(e,t,r)=>t||r,parallelCase:(e,t,r)=>t||r}),tle=g(e=>$Me(e[0]),(e,t,r)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(wS(r?.interruptAs??ri,ele));return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(n=>{e.state._tag!=="Closed"&&(e.state.backing.delete(t),Pl(n)&&(r?.propagateInterruption===!0?!jMe(n.cause):!E7(n.cause))&&Pa(e.deferred,n))})});var rle=e=>Xt(e.deferred);l();var n_=class extends Ji("@effect/platform/Transferable/Collector")(){},nle=()=>{let e=[],t=o=>{e.push(...o)},r=()=>e,n=()=>{let o=e;return e=[],o};return n_.of({unsafeAddAll:t,addAll:o=>Re(()=>t(o)),unsafeRead:r,read:Re(r),unsafeClear:n,clear:Re(n)})};l();l();var ole=Symbol.for("@effect/platform/WorkerError");var ile=ole;var lu=class extends NO()("WorkerError",{reason:No("spawn","decode","send","unknown","encode"),cause:Rd}){[ile]=ile;static Cause=Sse({error:this,defect:Rd});static encodeCause=Ej(this.Cause);static decodeCause=xj(this.Cause);get message(){switch(this.reason){case"send":return"An error occurred calling .postMessage";case"spawn":return"An error occurred while spawning a worker";case"decode":return"An error occurred during decoding";case"encode":return"An error occurred during encoding";case"unknown":return"An unexpected error occurred"}}};var _H=Symbol.for("@effect/platform/Worker/PlatformWorker"),q0=br("@effect/platform/Worker/PlatformWorker"),wH=Symbol.for("@effect/platform/Worker/WorkerManager"),TH=br("@effect/platform/Worker/WorkerManager"),sle=br("@effect/platform/Worker/Spawner"),ale=R(function*(){let e=yield*q0,t=0;return TH.of({[wH]:wH,spawn({encode:r,initialMessage:n}){return R(function*(){let o=t++,i=0,s=new Map,a=nle(),c=r?E=>tt(a.clear,MI(r(E),n_,a)):k,u=yield*Mr(),p=yield*e.spawn(o);yield*p.run(E=>E[0]===0?wI(u,Te):f(E[1])).pipe(PI(E=>yn(s.values(),b=>od in b?ql(b,E):b.failCause(E))),Dx(Mee),Iee(aie(1e3)),$ee({package:"@effect/platform",module:"Worker"}),jo,Nv),yield*DI(()=>tt(yn(s.values(),E=>od in E?pU(E):E.end,{discard:!0}),Re(()=>s.clear())));let f=E=>ot(()=>{let b=s.get(E[0]);if(!b)return Te;switch(E[1]){case 0:return od in b?wo(b,E[2][0]):b.offerAll(E[2]);case 1:return E.length===2?od in b?pU(b):b.end:od in b?wo(b,E[2][0]):tt(b.offerAll(E[2]),b.end);case 2:case 3:{if(E[1]===2)return od in b?uU(b,E[2]):b.fail(E[2]);let v=lu.decodeCause(E[2]);return od in b?ql(b,v):b.failCause(v)}}}),d=(E,b)=>Ph(v=>{let S=v.getFiberRef(Vne),w=zs(S,rZ).pipe(PF(A=>A._tag==="Span")),T=i++;return b.pipe(Dr(A=>(s.set(T,A),c(E).pipe(Dr(L=>p.send([T,0,L,w._tag==="Some"?[w.value.traceId,w.value.spanId,w.value.sampled]:void 0],a.unsafeRead())),up(L=>Wce(A)?A.failCause(L):ql(A,L))))),oe(A=>({id:T,mailbox:A})))}),h=({id:E},b)=>{let v=Re(()=>s.delete(E));return Pl(b)?tt(In(p.send([E,1])),v):v},m=E=>fE(Rie(d(E,M0()),({mailbox:b})=>zce(b),h)),x=E=>Rv(d(E,Mr()),({mailbox:b})=>Xt(b),h);return yield*Xt(u),n&&(yield*Re(n).pipe(V(x),_r(E=>new lu({reason:"spawn",cause:E})))),{id:o,execute:m,executeEffect:x}})}})}),cle=Od(TH,ale);var lle=()=>e=>q0.of({[_H]:_H,spawn(t){return R(function*(){let r=yield*sle,n,o=[];return{run:a=>Rx(c=>R(function*(){let u=yield*FI,p=yield*e.setup({worker:r(t),scope:u});n=p,yield*sp(u,Re(()=>{n=void 0}));let f=(yield*pd()).pipe(iie(W4(Y7))),d=yield*Zce(),h=EB(f);if(yield*e.listen({port:p,scope:u,emit(m){tle(d,h(a(m)))},deferred:d.deferred}),o.length>0){for(let[m,x]of o)p.postMessage([0,m],x);o.length=0}return yield*c(rle(d))}).pipe(La)),send:(a,c)=>ea({try:()=>{n===void 0?o.push([a,c]):n.postMessage([0,a],c)},catch:u=>new lu({reason:"send",cause:u})})}})}});var ule=lle,ple=q0;var fle=cle;var KMe=ule()({setup({scope:e,worker:t}){return V(Mr(),r=>{let n="postMessage"in t?{postMessage(o,i){t.postMessage(o,i)},kill:()=>t.terminate(),worker:t}:{postMessage(o,i){t.send(o)},kill:()=>t.kill("SIGKILL"),worker:t};return t.on("exit",()=>{Pa(r,Fl)}),uo(sp(e,ot(()=>(n.postMessage([1]),Xt(r))).pipe(jo,Pee(5e3),up(()=>Re(()=>n.kill())))),n)})},listen({deferred:e,emit:t,port:r}){return r.worker.on("message",n=>{t(n)}),r.worker.on("messageerror",n=>{Pa(e,new lu({reason:"decode",cause:n}))}),r.worker.on("error",n=>{Pa(e,new lu({reason:"unknown",cause:n}))}),r.worker.on("exit",n=>{Pa(e,new lu({reason:"unknown",cause:new Error(`exited with code ${n}`)}))}),Te}}),dle=Sp(ple,KMe),mle=Pk(fle,dle);var hle=mle;var gle=y(Xx(Uce,kce,Yce,hle),qne($ce));var AH={name:"@godaddy/cli",version:"0.2.2",description:"GoDaddy CLI for managing applications and webhooks",keywords:["godaddy","cli","developer-tools"],main:"./dist/cli.js",type:"module",bin:{godaddy:"./dist/cli.js"},files:["dist"],scripts:{format:"pnpm biome format --write",lint:"pnpm biome lint --write",check:"pnpm biome check --fix --unsafe","generate:api-catalog":"pnpm tsx scripts/generate-api-catalog.ts",build:"node build.mjs","build:dev":"NODE_ENV=development node build.mjs --dev && NODE_OPTIONS=--enable-source-maps node dist/cli-dev.js",prepare:"pnpm run build",test:"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage",changeset:"changeset",version:"changeset version",release:"pnpm build && changeset publish"},devDependencies:{"@biomejs/biome":"1.9.4","@changesets/cli":"^2.29.8","@types/node":"^22.14.1","@types/picomatch":"^4.0.2","@types/prompts":"^2.4.9","@types/react":"18.3.1","@types/semver":"^7.7.0","@vitest/coverage-v8":"^3.2.2","@vitest/ui":"^3.2.2",esbuild:"^0.25.12",ms:"^2.1.3",msw:"^2.4.0",tsx:"^4.19.3",vitest:"^3.2.2",yaml:"^2.8.2"},peerDependencies:{typescript:"^5.0.0"},dependencies:{"@clack/prompts":"^0.10.0","@effect/cli":"^0.73.2","@effect/platform":"^0.94.5","@effect/platform-node":"^0.104.1","@iarna/toml":"^2.2.5","@inkjs/ui":"^2.0.0","@tanstack/react-query":"^5.68.0",arktype:"^2.1.9","copy-to-clipboard":"^3.3.3",effect:"^3.19.19","gql.tada":"^1.8.10",graphql:"^16.10.0","graphql-request":"^7.1.2",ink:"^5.2.0","ink-select-input":"^6.0.0",open:"^10.1.1",picomatch:"^4.0.3",pino:"^9.6.0","pino-pretty":"^13.0.0",react:"18.3.1",semver:"^7.7.1",uuid:"^11.1.0"},publishConfig:{access:"public"},packageManager:"pnpm@10.14.0"};l();l();var Me=class extends $l("ValidationError"){},sr=class extends $l("NetworkError"){},Sr=class extends $l("AuthenticationError"){},ar=class extends $l("ConfigurationError"){},Hd=class extends $l("SecurityError"){};function CH(e){switch(e._tag){case"ValidationError":return"VALIDATION_ERROR";case"NetworkError":return"NETWORK_ERROR";case"AuthenticationError":return"AUTH_ERROR";case"ConfigurationError":return"CONFIG_ERROR";case"SecurityError":return"SECURITY_BLOCKED"}}var ZMe=new RegExp("\x1B\\[[0-9;]*m","g");function XMe(e){return e.replace(ZMe,"")}function e$e(e){if("error"in e&&e.error){let t=XMe(kre(e.error)).trim();if(t.length>0)return t}return"Invalid command input"}function t$e(e){let t=CH(e),r=e.userMessage||e.message;switch(e._tag){case"ValidationError":return{message:r,code:t,fix:"Review command arguments and try again with valid values."};case"AuthenticationError":return{message:r,code:"AUTH_REQUIRED",fix:"Run: godaddy auth login"};case"ConfigurationError":return{message:r,code:t,fix:"Check your config with: godaddy env info [environment]"};case"NetworkError":return{message:r,code:t,fix:"Verify environment connectivity with: godaddy env get and retry."};case"SecurityError":return{message:r,code:t,fix:"Resolve security findings and rerun: godaddy application deploy <name>"}}}function r$e(e){let t=e.toLowerCase();return t.includes("--output")?{message:e,code:"UNSUPPORTED_OPTION",fix:"Remove --output; all commands now emit JSON envelopes."}:t.includes("security")||t.includes("blocked")?{message:e,code:"SECURITY_BLOCKED",fix:"Resolve security findings and rerun: godaddy application deploy <name>"}:t.includes("not found")||t.includes("does not exist")?{message:e,code:"NOT_FOUND",fix:"Use discovery commands such as: godaddy application list or godaddy actions list."}:t.includes("auth")||t.includes("token")?{message:e,code:"AUTH_REQUIRED",fix:"Run: godaddy auth login"}:{message:e,code:"UNEXPECTED_ERROR",fix:"Run: godaddy for command discovery and retry with corrected input."}}function n$e(e){return typeof e=="object"&&e!==null&&"_tag"in e&&typeof e._tag=="string"&&["ValidationError","NetworkError","AuthenticationError","ConfigurationError","SecurityError"].includes(e._tag)}function yle(e){return n$e(e)?t$e(e):e instanceof Error?r$e(e.message):{message:"Unknown error",code:"UNEXPECTED_ERROR",fix:"Run: godaddy for command discovery."}}function xle(e){let t=e$e(e);if(t.includes("--output"))return{message:t,code:"UNSUPPORTED_OPTION",fix:"Remove --output; all commands now emit JSON envelopes."};switch(e._tag){case"CommandMismatch":return{message:t,code:"COMMAND_NOT_FOUND",fix:"Run: godaddy"};case"MissingFlag":case"MissingValue":case"InvalidArgument":case"InvalidValue":case"MultipleValuesDetected":case"NoBuiltInMatch":case"UnclusteredFlag":case"MissingSubcommand":case"CorrectedFlag":return{message:t,code:"VALIDATION_ERROR",fix:"Provide valid arguments/options shown in --help and retry."};case"HelpRequested":return{message:t,code:"VALIDATION_ERROR",fix:"Use --help for command usage details."};default:return{message:t,code:"VALIDATION_ERROR",fix:"Check command usage with --help and retry."}}}l();var Lp=class extends Ji("CliConfig")(){},o$e={prettyPrint:!1,verbosity:0,environmentOverride:null};function Ele(e){return Sp(Lp,{...o$e,...e})}l();var ht=class extends Ji("EnvelopeWriter")(){},ble=Od(ht,R(function*(){let e=yield*Lp,t=yield*ni(!1);function r(p){return e.prettyPrint?JSON.stringify(p,null,2):JSON.stringify(p)}function n(p){return Re(()=>{process.stdout.write(`${p}
|
|
338
|
+
Quitting wizard mode...`));return Zr(ir(E))}return C(x)}))}case"ShowVersion":{let a=me(e.version);return Zr(ir(a))}}},TLe=e=>{let t=e,r=De();for(;t!==void 0;)switch(t._tag){case"Standard":{r=Ae(t.name),t=void 0;break}case"GetUserInput":{r=Ae(t.name),t=void 0;break}case"Map":{t=t.command;break}case"Subcommands":{t=t.parent;break}}return r},ALe=(e,t,r)=>{let n=Z2(e.command),[o,i]=$m(r,a=>!r6(n,a)),s=Mo(i,{onEmpty:()=>qm(o,a=>a!=="--wizard"),onNonEmpty:a=>dn(o,a)});return Le(t.split(/\s+/),s)},CLe=e=>{let t=y(qm(e,n=>n.length>0),St(" ")),r=lt("You may now execute your command directly with the following options and arguments:");return f1([me(pk(Ql("Wizard Mode Complete!"))),me(r),me(Bo(lt(" "),yd(t,zI)))])},oce=e=>e&&(e==="--log-level"||e.startsWith("--log-level="));var kLe="@effect/cli/Command",sH=Symbol.for(kLe),RLe=e=>{let t=[],r=0,n=[],o=0;function i(a){let c={};for(let u in a)c[u]=s(a[u]);return c}function s(a){return Mu(a)?{_tag:"Array",children:we(a,s)}:C0(a)?(t.push(a),{_tag:"Args",index:r++}):O0(a)?(n.push(a),{_tag:"Options",index:o++}):{_tag:"ParsedConfig",tree:i(a)}}return{args:t,options:n,tree:i(e)}},sce=(e,t,r)=>{let n={};for(let i in e)n[i]=o(e[i]);return n;function o(i){return i._tag==="Args"?t[i.index]:i._tag==="Options"?r[i.index]:i._tag==="Array"?we(i.children,o):sce(i.tree,t,r)}},ace={...ix,[sH]:sH,commit(){return this.tag},pipe(){return W(this,arguments)}},aH=Je("@effect/cli/Command/registeredDescriptors",()=>new WeakMap),NLe=e=>aH.get(e.tag)??e.descriptor,DLe=(e,t,r,n=de)=>{let o=Object.create(ace);return o.descriptor=e,o.handler=t,o.transform=n,o.tag=r,o},cce=(e,t)=>{let r=Object.create(ace);return r.descriptor=t.descriptor??e.descriptor,r.handler=t.handler??e.handler,r.transform=t.transform?(n,o)=>t.transform(e.transform(n,o),o):e.transform,r.tag=e.tag,r},lce=g(e=>Kae(e[0]),(e,t)=>{let r=DLe(e,t??(n=>hU(()=>ece(NLe(r)))),br(`@effect/cli/Command/(${Ze(ZO(e)).join("|")})`));return r}),PLe=(e,t)=>{let{args:r,options:n,tree:o}=RLe(t);return eH(Gae(e,Np(n),F2(r)),({args:i,options:s})=>sce(o,i,s))},uce=(e,t={},r)=>lce(PLe(e,t),r);var FLe=g(2,(e,t)=>cce(e,{descriptor:t(e.descriptor)}));var pce=g(2,(e,t)=>FLe(e,Yae(t))),fce=g(2,(e,t)=>{let r=Zae(e.descriptor,we(t,i=>[i.tag,i.descriptor])),n=vi(t,new Map,(i,s)=>(i.set(s.tag,s),aH.set(s.tag,s.descriptor),i));function o(i){if(i.subcommand._tag==="Some"){let[s,a]=i.subcommand.value,c=n.get(s),u=c.transform(c.handler(a),a);return MI(u,e.tag,i)}return e.handler(i)}return cce(e,{descriptor:r,handler:o})});var dce=g(2,(e,t)=>{let r=ice({...t,command:e.descriptor});aH.set(e.tag,e.descriptor);let n=o=>e.transform(e.handler(o),o);return o=>R0(r,o,n)});var _t=uce;var wt=pce;var hi=fce;var mce=dce;l();l();l();l();l();l();var cH=Symbol.for("@effect/platform/CommandExecutor"),hce=Symbol.for("@effect/platform/Process"),gce=uO(),yce=uO(),xce=br("@effect/platform/CommandExecutor"),Ece=e=>{let t=n=>Id(oe(e(n),o=>o.stdout)),r=(n,o)=>{let i=new TextDecoder(o);return Hie(jie(t(n),Hm(s=>i.decode(s))))};return{[cH]:cH,start:e,exitCode:n=>La(V(e(n),o=>o.exitCode)),stream:t,string:(n,o="utf-8")=>{let i=new TextDecoder(o);return y(e(n),V(s=>NR(s.stdout,MLe)),oe(s=>i.decode(s)),La)},lines:(n,o="utf-8")=>y(r(n,o),Bie,oe(G4)),streamLines:r}},MLe=Fie(new Uint8Array,(e,t)=>mS(t,e,(r,n)=>{let o=new Uint8Array(r.length+n.length);return o.set(r),o.set(n,r.length),o}));var lH=Symbol.for("@effect/platform/Command");var bce=e=>Array.from(uH(e)),uH=e=>{switch(e._tag){case"StandardCommand":return Pt(e);case"PipedCommand":return Cr(uH(e.left),uH(e.right))}};var Sce={[lH]:lH,pipe(){return W(this,arguments)},...uT},qLe={...Sce,_tag:"StandardCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,command:this.command,args:this.args,env:Object.fromEntries(this.env),cwd:this.cwd.toJSON(),shell:this.shell,gid:this.gid.toJSON(),uid:this.uid.toJSON()}}},ULe=e=>Object.assign(Object.create(qLe),e),jLe={...Sce,_tag:"PipedCommand",toJSON(){return{_id:"@effect/platform/Command",_tag:this._tag,left:this.left.toJSON(),right:this.right.toJSON()}}},BLe=e=>Object.assign(Object.create(jLe),e);var pH=g(2,(e,t)=>{switch(e._tag){case"StandardCommand":return ULe({...e,stdin:t});case"PipedCommand":return BLe({...e,left:pH(e.left,t)})}});var fH=bce;var dH=pH;l();var vce=xce,mH=hce,Oce=gce,_ce=yce,wce=Ece;import*as N0 from"node:child_process";l();var Rr=(e,t)=>(r,[n])=>{let o="Unknown";switch(r.code){case"ENOENT":o="NotFound";break;case"EACCES":o="PermissionDenied";break;case"EEXIST":o="AlreadyExists";break;case"EISDIR":o="BadResource";break;case"ENOTDIR":o="BadResource";break;case"EBUSY":o="Busy";break;case"ELOOP":o="BadResource";break}return new Nd({reason:o,module:e,method:t,pathOrDescriptor:n,syscall:r.syscall,description:r.message,cause:r})};l();l();var hH=(e,t,r)=>fE(zLe(e,t,r));var zLe=(e,t,r)=>IB(()=>GLe(e(),t,Aa(void 0),r)),Tce=(e,t,{encoding:r,endOnDone:n=!0}={},o=Te)=>{let i=KLe(e,r),s=n?cs(a=>{"closed"in e&&e.closed?a(Te):(e.once("finish",()=>a(Te)),e.end())}):Te;return{awaitRead:()=>Te,emit:i,error:a=>tt(s,t(a)),done:a=>tt(s,o)}},KLe=(e,t)=>r=>r.length===0?Te:cs(n=>{let o=r[Symbol.iterator](),i=o.next();function s(){let a=i;i=o.next();let c=e.write(a.value,t);i.done?n(Te):c?s():e.once("drain",s)}s()}),GLe=(e,t,r,n)=>{if(!e.readable)return CO;let o=SU(!1);function i(){o.unsafeOpen()}function s(p){r.current=Vf(t(p)),o.unsafeOpen()}function a(){r.current=Fl,o.unsafeOpen()}e.on("readable",i),e.on("error",s),e.on("end",a);let c=n?.chunkSize?Number(n.chunkSize):void 0,u=IB(function p(){let f=e.read(c);if(f===null)return r.current?Die(r.current):(o.unsafeClose(),Cd(o.await,p));let d=[f];for(;;){if(f=e.read(c),f===null)return Cd(IR(mn(d)),p);d.push(f)}});return Nie(u,Re(()=>{e.off("readable",i),e.off("error",s),e.off("end",a),n?.closeOnDone!==!1&&"closed"in e&&!e.closed&&e.destroy()}))};var Ace=(e,t,r)=>Mie(QLe(e,t,r)),QLe=(e,t,r)=>Cd(ra(Re(()=>e()),Mr()),([n,o])=>CB(JLe(n,o,t),Tce(n,i=>ql(o,i),r,wI(o,Te)))),JLe=(e,t,r)=>ot(()=>{function n(o){Pa(t,C(r(o)))}return e.on("error",n),Ii(Xt(t),Re(()=>{e.removeListener("error",n)}))});var YLe=e=>typeof e=="string"?e:"pipe",Cce=e=>typeof e=="string"?e:"pipe",e_=e=>e instanceof globalThis.Error?e:new globalThis.Error(String(e)),Bd=(e,t,r)=>{let n=fH(r).reduce((o,i)=>{let s=`${i.command} ${i.args.join(" ")}`;return o.length===0?s:`${o} | ${s}`},"");return Rr("Command",e)(t,[n])},ZLe={[mH]:mH,...uT,toJSON(){return{_id:"@effect/platform/CommandExecutor/Process",pid:this.pid}}},t_=e=>t=>{switch(t._tag){case"StandardCommand":{let r=V(Mr(),i=>cs(s=>{let a=N0.spawn(t.command,t.args,{stdio:[YLe(t.stdin),Cce(t.stdout),Cce(t.stderr)],cwd:Ie(t.cwd,py),shell:t.shell,env:{...process.env,...Object.fromEntries(t.env)},detached:process.platform!=="win32"});return a.on("error",c=>{s(C(Bd("spawn",c,t)))}),a.on("exit",(...c)=>{Pa(i,k(c))}),a.on("spawn",()=>{s(k([a,i]))}),Re(()=>{a.kill("SIGTERM")})})),n=process.platform==="win32"?(i,s)=>cs(a=>{N0.exec(`taskkill /pid ${i.pid} /T /F`,c=>{a(c?C(Bd("kill",e_(c),t)):Te)})}):(i,s)=>ea({try:()=>process.kill(-i.pid,s),catch:a=>Bd("kill",e_(a),t)}),o=(i,s)=>ot(()=>i.kill(s)?Te:C(Bd("kill",new globalThis.Error("Failed to kill process"),t)));return y(Ce(t.cwd,{onNone:()=>Te,onSome:i=>e.access(i)}),tt(To(r,([i,s])=>V(id(s),a=>a?V(Xt(s),([c])=>c!==0&&c!==null?n(i,"SIGTERM").pipe(ad):Te):n(i,"SIGTERM").pipe(ud(()=>o(i,"SIGTERM")),tt(Xt(s)),ad)))),oe(([i,s])=>{let a=Pie;i.stdin!==null&&(a=Ace(()=>i.stdin,m=>Bd("toWritable",e_(m),t)));let c=V(Xt(s),([m,x])=>m!==null?k(Oce(m)):C(Bd("exitCode",new globalThis.Error(`Process interrupted due to receipt of signal: ${x}`),t))),u=Ree(id(s)),p=(m="SIGTERM")=>n(i,m).pipe(ud(()=>o(i,m)),tt(ta(Xt(s)))),f=_ce(i.pid),d=hH(()=>i.stderr,m=>Bd("fromReadable(stderr)",e_(m),t)),h=hH(()=>i.stdout,m=>Bd("fromReadable(stdout)",e_(m),t));return typeof t.stdout!="string"&&(h=Vie(h,t.stdout)),Object.assign(Object.create(ZLe),{pid:f,exitCode:c,isRunning:u,kill:p,stdin:a,stderr:d,stdout:h})}),typeof t.stdin=="string"?de:Dr(i=>Nx(NR(t.stdin,i.stdin))))}case"PipedCommand":{let r=fH(t);if(r.length===1)return y(r[0],t_(e));let n=r[0],o=r.slice(1),i=o.slice(0,o.length-1),s=o[o.length-1],a=i.reduce((c,u)=>y(dH(u,c),t_(e),oe(p=>p.stdout),Id),y(t_(e)(n),oe(c=>c.stdout),Id));return y(dH(s,a),t_(e))}}},Ice=Od(vce,y(mr,oe(e=>wce(t_(e)))));var kce=Ice;l();l();l();l();var Rce=(e,t,r)=>(...n)=>cs(o=>{try{e(...n,(i,s)=>{o(i?C(t?t(i,n):i):k(s))})}catch(i){o(r?C(r(i,n)):Ul(i))}});var cn=Rce;import*as Nce from"node:crypto";import*as et from"node:fs";import*as Dce from"node:os";import*as $E from"node:path";var en=e=>t=>new di({module:"FileSystem",method:e,cause:t}),rMe=(()=>{let e=cn(et.access,Rr("FileSystem","access"),en("access"));return(t,r)=>{let n=et.constants.F_OK;return r?.readable&&(n|=et.constants.R_OK),r?.writable&&(n|=et.constants.W_OK),e(t,n)}})(),nMe=(()=>{let e=cn(et.cp,Rr("FileSystem","copy"),en("copy"));return(t,r,n)=>e(t,r,{force:n?.overwrite??!1,preserveTimestamps:n?.preserveTimestamps??!1,recursive:!0})})(),oMe=(()=>{let e=cn(et.copyFile,Rr("FileSystem","copyFile"),en("copyFile"));return(t,r)=>e(t,r)})(),iMe=(()=>{let e=cn(et.chmod,Rr("FileSystem","chmod"),en("chmod"));return(t,r)=>e(t,r)})(),sMe=(()=>{let e=cn(et.chown,Rr("FileSystem","chown"),en("chown"));return(t,r,n)=>e(t,r,n)})(),aMe=(()=>{let e=cn(et.link,Rr("FileSystem","link"),en("link"));return(t,r)=>e(t,r)})(),cMe=(()=>{let e=cn(et.mkdir,Rr("FileSystem","makeDirectory"),en("makeDirectory"));return(t,r)=>e(t,{recursive:r?.recursive??!1,mode:r?.mode})})(),gH=e=>{let t=cn(et.mkdtemp,Rr("FileSystem",e),en(e));return r=>ot(()=>{let n=r?.prefix??"",o=typeof r?.directory=="string"?$E.join(r.directory,"."):Dce.tmpdir();return t(n?$E.join(o,n):o+"/")})},lMe=gH("makeTempDirectory"),yH=e=>{let t=cn(et.rm,Rr("FileSystem",e),en(e));return(r,n)=>t(r,{recursive:n?.recursive??!1,force:n?.force??!1})},uMe=yH("remove"),pMe=(()=>{let e=gH("makeTempDirectoryScoped"),t=yH("makeTempDirectoryScoped");return r=>To(e(r),n=>In(t(n,{recursive:!0})))})(),Pce=e=>{let t=cn(et.open,Rr("FileSystem",e),en(e)),r=cn(et.close,Rr("FileSystem",e),en(e));return(n,o)=>y(To(t(n,o?.flag??"r",o?.mode),i=>In(r(i))),oe(i=>dMe(wse(i),o?.flag?.startsWith("a")??!1)))},fMe=Pce("open"),dMe=(()=>{let e=p=>cn(et.read,Rr("FileSystem",p),en(p)),t=e("read"),r=e("readAlloc"),n=cn(et.fstat,Rr("FileSystem","stat"),en("stat")),o=cn(et.ftruncate,Rr("FileSystem","truncate"),en("truncate")),i=cn(et.fsync,Rr("FileSystem","sync"),en("sync")),s=p=>cn(et.write,Rr("FileSystem",p),en(p)),a=s("write"),c=s("writeAll");class u{fd;append;[YR];semaphore=qee(1);position=0n;constructor(f,d){this.fd=f,this.append=d,this[YR]=YR}get stat(){return oe(n(this.fd),Lce)}get sync(){return i(this.fd)}seek(f,d){let h=xE(f);return this.semaphore.withPermits(1)(Re(()=>(d==="start"?this.position=h:d==="current"&&(this.position=this.position+h),this.position)))}read(f){return this.semaphore.withPermits(1)(oe(ot(()=>t(this.fd,{buffer:f,position:this.position})),d=>{let h=xE(d);return this.position=this.position+h,h}))}readAlloc(f){let d=Number(f);return this.semaphore.withPermits(1)(V(Re(()=>Buffer.allocUnsafeSlow(d)),h=>oe(r(this.fd,{buffer:h,position:this.position}),m=>{if(m===0)return M();if(this.position=this.position+BigInt(m),m===d)return N(h);let x=Buffer.allocUnsafeSlow(m);return h.copy(x,0,0,m),N(x)})))}truncate(f){return this.semaphore.withPermits(1)(oe(o(this.fd,f?Number(f):void 0),()=>{if(!this.append){let d=BigInt(f??0);this.position>d&&(this.position=d)}}))}write(f){return this.semaphore.withPermits(1)(oe(ot(()=>a(this.fd,f,void 0,void 0,this.append?void 0:Number(this.position))),d=>{let h=xE(d);return this.append||(this.position=this.position+h),h}))}writeAllChunk(f){return V(ot(()=>c(this.fd,f,void 0,void 0,this.append?void 0:Number(this.position))),d=>d===0?C(new Nd({module:"FileSystem",method:"writeAll",reason:"WriteZero",pathOrDescriptor:this.fd,description:"write returned 0 bytes written"})):(this.append||(this.position=this.position+BigInt(d)),d<f.length?this.writeAllChunk(f.subarray(d)):Te))}writeAll(f){return this.semaphore.withPermits(1)(this.writeAllChunk(f))}}return(p,f)=>new u(p,f)})(),Fce=e=>{let t=gH(e),r=Pce(e),n=o=>Re(()=>Nce.randomBytes(o).toString("hex"));return o=>y(ra(t(o),n(6)),oe(([i,s])=>$E.join(i,s+(o?.suffix??""))),Dr(i=>La(r(i,{flag:"w+"}))))},mMe=Fce("makeTempFile"),hMe=(()=>{let e=Fce("makeTempFileScoped"),t=yH("makeTempFileScoped");return r=>To(e(r),n=>In(t($E.dirname(n),{recursive:!0})))})(),gMe=(e,t)=>ur({try:()=>et.promises.readdir(e,t),catch:r=>Rr("FileSystem","readDirectory")(r,[e])}),yMe=e=>cs((t,r)=>{try{et.readFile(e,{signal:r},(n,o)=>{t(n?C(Rr("FileSystem","readFile")(n,[e])):k(o))})}catch(n){t(C(en("readFile")(n)))}}),xMe=(()=>{let e=cn(et.readlink,Rr("FileSystem","readLink"),en("readLink"));return t=>e(t)})(),EMe=(()=>{let e=cn(et.realpath,Rr("FileSystem","realPath"),en("realPath"));return t=>e(t)})(),bMe=(()=>{let e=cn(et.rename,Rr("FileSystem","rename"),en("rename"));return(t,r)=>e(t,r)})(),Lce=e=>({type:e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":e.isBlockDevice()?"BlockDevice":e.isCharacterDevice()?"CharacterDevice":e.isFIFO()?"FIFO":e.isSocket()?"Socket":"Unknown",mtime:Ar(e.mtime),atime:Ar(e.atime),birthtime:Ar(e.birthtime),dev:e.dev,rdev:Ar(e.rdev),ino:Ar(e.ino),mode:e.mode,nlink:Ar(e.nlink),uid:Ar(e.uid),gid:Ar(e.gid),size:xE(e.size),blksize:Vr(Ar(e.blksize),xE),blocks:Ar(e.blocks)}),xH=(()=>{let e=cn(et.stat,Rr("FileSystem","stat"),en("stat"));return t=>oe(e(t),Lce)})(),SMe=(()=>{let e=cn(et.symlink,Rr("FileSystem","symlink"),en("symlink"));return(t,r)=>e(t,r)})(),vMe=(()=>{let e=cn(et.truncate,Rr("FileSystem","truncate"),en("truncate"));return(t,r)=>e(t,r!==void 0?Number(r):void 0)})(),OMe=(()=>{let e=cn(et.utimes,Rr("FileSystem","utime"),en("utime"));return(t,r,n)=>e(t,r,n)})(),_Me=(e,t)=>qie(r=>To(Re(()=>{let n=et.watch(e,{recursive:t?.recursive},(o,i)=>{if(i)switch(o){case"rename":{r.fromEffect(Ao(xH(i),{onSuccess:s=>k(Tse({path:i})),onFailure:s=>s._tag==="SystemError"&&s.reason==="NotFound"?k(Cse({path:i})):C(s)}));return}case"change":{r.single(Ase({path:i}));return}}});return n.on("error",o=>{r.fail(new Nd({module:"FileSystem",reason:"Unknown",method:"watch",pathOrDescriptor:e,cause:o}))}),n.on("close",()=>{r.end()}),n}),n=>Re(()=>n.close()))),wMe=(e,t,r)=>xH(t).pipe(oe(n=>e.pipe(Qo(o=>o.register(t,n,r)),Ie(()=>_Me(t,r)))),Wie),TMe=(e,t,r)=>cs((n,o)=>{try{et.writeFile(e,t,{signal:o,flag:r?.flag,mode:r?.mode},i=>{n(i?C(Rr("FileSystem","writeFile")(i,[e])):Te)})}catch(i){n(C(en("writeFile")(i)))}}),AMe=oe(Dv(JR),e=>_se({access:rMe,chmod:iMe,chown:sMe,copy:nMe,copyFile:oMe,link:aMe,makeDirectory:cMe,makeTempDirectory:lMe,makeTempDirectoryScoped:pMe,makeTempFile:mMe,makeTempFileScoped:hMe,open:fMe,readDirectory:gMe,readFile:yMe,readLink:xMe,realPath:EMe,remove:uMe,rename:bMe,stat:xH,symlink:SMe,truncate:vMe,utimes:OMe,watch(t,r){return wMe(e,t,r)},writeFile:TMe})),Mce=Od(mr,AMe);var $ce=Mce;l();l();import*as r_ from"node:path";import*as D0 from"node:url";var EH=e=>ea({try:()=>D0.fileURLToPath(e),catch:t=>new di({module:"Path",method:"fromFileUrl",description:`Invalid file URL: ${e}`,cause:t})}),bH=e=>ea({try:()=>D0.pathToFileURL(e),catch:t=>new di({module:"Path",method:"toFileUrl",description:`Invalid path: ${e}`,cause:t})}),kMe=Sp(ua,ua.of({[dg]:dg,...r_.posix,fromFileUrl:EH,toFileUrl:bH})),RMe=Sp(ua,ua.of({[dg]:dg,...r_.win32,fromFileUrl:EH,toFileUrl:bH})),qce=Sp(ua,ua.of({[dg]:dg,...r_,fromFileUrl:EH,toFileUrl:bH}));var Uce=qce;l();l();l();l();var L0=Symbol.for("effect/Mailbox"),SH=Symbol.for("effect/Mailbox/ReadonlyMailbox");var vg=Nr(),jce=Zt(vg),P0=Zt(!1),F0=Zt(!0),Bce=[vg,!0],vH=class extends Ci{scheduler;capacity;strategy;[L0]=L0;[SH]=SH;state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set};messages=[];messagesChunk=Nr();constructor(t,r,n){super(),this.scheduler=t,this.capacity=r,this.strategy=n}offer(t){return je(()=>{if(this.state._tag!=="Open")return P0;if(this.messages.length+this.messagesChunk.length>=this.capacity)switch(this.strategy){case"dropping":return P0;case"suspend":return this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),F0):this.offerRemainingSingle(t);case"sliding":return this.unsafeTake(),this.messages.push(t),F0}return this.messages.push(t),this.scheduleReleaseTaker(),F0})}unsafeOffer(t){return this.state._tag!=="Open"?!1:this.messages.length+this.messagesChunk.length>=this.capacity?this.strategy==="sliding"?(this.unsafeTake(),this.messages.push(t),!0):this.capacity<=0&&this.state.takers.size>0?(this.messages.push(t),this.releaseTaker(),!0):!1:(this.messages.push(t),this.scheduleReleaseTaker(),!0)}offerAll(t){return je(()=>{if(this.state._tag!=="Open")return ie(Oi(t));let r=this.unsafeOfferAllArray(t);return r.length===0?jce:this.strategy==="dropping"?ie(mn(r)):this.offerRemainingArray(r)})}unsafeOfferAll(t){return mn(this.unsafeOfferAllArray(t))}unsafeOfferAllArray(t){if(this.state._tag!=="Open")return Ze(t);if(this.capacity===Number.POSITIVE_INFINITY||this.strategy==="sliding")return this.messages.length>0&&(this.messagesChunk=Cr(this.messagesChunk,mn(this.messages))),this.strategy==="sliding"?this.messagesChunk=this.messagesChunk.pipe(Cr(Oi(t)),ZF(this.capacity)):fS(t)?this.messagesChunk=Cr(this.messagesChunk,t):this.messages=Ze(t),this.scheduleReleaseTaker(),[];let r=this.capacity<=0?this.state.takers.size:this.capacity-this.messages.length-this.messagesChunk.length;if(r===0)return Ze(t);let n=[],o=0;for(let i of t)o<r?this.messages.push(i):n.push(i),o++;return this.scheduleReleaseTaker(),n}fail(t){return this.done(Zu(t))}failCause(t){return this.done(Wt(t))}unsafeDone(t){return this.state._tag!=="Open"?!1:this.state.offers.size===0&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(t),!0):(this.state={...this.state,_tag:"Closing",exit:t},!0)}shutdown=Q(()=>{if(this.state._tag==="Done")return!0;this.messages=[],this.messagesChunk=vg;let t=this.state.offers;if(this.finalize(this.state._tag==="Open"?gn:this.state.exit),t.size>0){for(let r of t)r._tag==="Single"?r.resume(P0):r.resume(Zt(mn(r.remaining.slice(r.offset))));t.clear()}return!0});done(t){return Q(()=>this.unsafeDone(t))}end=this.done(gn);clear=je(()=>{if(this.state._tag==="Done")return Yy(this.state.exit,vg);let t=this.unsafeTakeAll();return this.releaseCapacity(),ie(t)});takeAll=je(()=>{if(this.state._tag==="Done")return Yy(this.state.exit,Bce);let t=this.unsafeTakeAll();return t.length===0?Yt(this.awaitTake,this.takeAll):ie([t,this.releaseCapacity()])});takeN(t){return je(()=>{if(this.state._tag==="Done")return Yy(this.state.exit,Bce);if(t<=0)return ie([vg,!1]);t=Math.min(t,this.capacity);let r;if(t<=this.messagesChunk.length)r=_y(this.messagesChunk,t),this.messagesChunk=_c(this.messagesChunk,t);else if(t<=this.messages.length+this.messagesChunk.length)this.messagesChunk=Cr(this.messagesChunk,mn(this.messages)),this.messages=[],r=_y(this.messagesChunk,t),this.messagesChunk=_c(this.messagesChunk,t);else return Yt(this.awaitTake,this.takeN(t));return ie([r,this.releaseCapacity()])})}unsafeTake(){if(this.state._tag==="Done")return BA(this.state.exit,Zu(new v7));let t;if(this.messagesChunk.length>0)t=dS(this.messagesChunk),this.messagesChunk=_c(this.messagesChunk,1);else if(this.messages.length>0)t=this.messages[0],this.messagesChunk=_c(mn(this.messages),1),this.messages=[];else return this.capacity<=0&&this.state.offers.size>0?(this.capacity=1,this.releaseCapacity(),this.capacity=0,this.messages.length>0?Zt(this.messages.pop()):void 0):void 0;return this.releaseCapacity(),Zt(t)}take=je(()=>this.unsafeTake()??Yt(this.awaitTake,this.take));await=_l(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.awaiters.add(t),Q(()=>{this.state._tag!=="Done"&&this.state.awaiters.delete(t)})));unsafeSize(){let t=this.messages.length+this.messagesChunk.length;return this.state._tag==="Done"?M():N(t)}size=Q(()=>this.unsafeSize());commit(){return this.takeAll}pipe(){return W(this,arguments)}toJSON(){return{_id:"effect/Mailbox",state:this.state._tag,size:this.unsafeSize().toJSON()}}toString(){return bt(this)}[nt](){return bt(this)}offerRemainingSingle(t){return _l(r=>{if(this.state._tag!=="Open")return r(P0);let n={_tag:"Single",message:t,resume:r};return this.state.offers.add(n),Q(()=>{this.state._tag==="Open"&&this.state.offers.delete(n)})})}offerRemainingArray(t){return _l(r=>{if(this.state._tag!=="Open")return r(Zt(mn(t)));let n={_tag:"Array",remaining:t,offset:0,resume:r};return this.state.offers.add(n),Q(()=>{this.state._tag==="Open"&&this.state.offers.delete(n)})})}releaseCapacity(){if(this.state._tag==="Done")return this.state.exit._tag==="Success";if(this.state.offers.size===0)return this.state._tag==="Closing"&&this.messages.length===0&&this.messagesChunk.length===0?(this.finalize(this.state.exit),this.state.exit._tag==="Success"):!1;let t=this.capacity-this.messages.length-this.messagesChunk.length;for(let r of this.state.offers){if(t===0)return!1;if(r._tag==="Single")this.messages.push(r.message),t--,r.resume(F0),this.state.offers.delete(r);else{for(;r.offset<r.remaining.length;r.offset++){if(t===0)return!1;this.messages.push(r.remaining[r.offset]),t--}r.resume(jce),this.state.offers.delete(r)}}return!1}awaitTake=_l(t=>this.state._tag==="Done"?t(this.state.exit):(this.state.takers.add(t),Q(()=>{this.state._tag!=="Done"&&this.state.takers.delete(t)})));scheduleRunning=!1;scheduleReleaseTaker(){this.scheduleRunning||(this.scheduleRunning=!0,this.scheduler.scheduleTask(this.releaseTaker,0))}releaseTaker=()=>{if(this.scheduleRunning=!1,this.state._tag!=="Done"&&this.state.takers.size!==0){for(let t of this.state.takers)if(this.state.takers.delete(t),t(gn),this.messages.length+this.messagesChunk.length===0)break}};unsafeTakeAll(){if(this.messagesChunk.length>0){let t=this.messages.length>0?Cr(this.messagesChunk,mn(this.messages)):this.messagesChunk;return this.messagesChunk=vg,this.messages=[],t}else if(this.messages.length>0){let t=mn(this.messages);return this.messages=[],t}else if(this.state._tag!=="Done"&&this.state.offers.size>0)return this.capacity=1,this.releaseCapacity(),this.capacity=0,Pt(this.messages.pop());return vg}finalize(t){if(this.state._tag==="Done")return;let r=this.state;this.state={_tag:"Done",exit:t};for(let n of r.takers)n(t);r.takers.clear();for(let n of r.awaiters)n(t);r.awaiters.clear()}},Hce=e=>Ct(t=>ie(new vH(t.currentScheduler,typeof e=="number"?e:e?.capacity??Number.POSITIVE_INFINITY,typeof e=="number"?"suspend":e?.strategy??"suspend")));var Vce=e=>{let t=xt(e.takeAll,([r,n])=>n?r.length===0?Ho:Kt(r):wp(Kt(r),t));return t};var FMe=L0;var Wce=e=>se(e,FMe);var M0=Hce;var zce=Vce;import*as $0 from"node:readline";var Gce=e=>e.key.ctrl&&(e.key.name==="c"||e.key.name==="d"),Qce=Lv(function*(e=Gce){let t=process.stdin,r=process.stdout,n=yield*nie({acquire:To(Re(()=>{let p=$0.createInterface({input:t,escapeCodeTimeout:50});return $0.emitKeypressEvents(t,p),t.isTTY&&t.setRawMode(!0),p}),p=>Re(()=>{t.isTTY&&t.setRawMode(!1),p.close()}))}),o=Re(()=>r.columns??0),i=Re(()=>r.rows??0),s=Re(()=>!!r.isTTY),a=R(function*(){yield*xB(n);let p=yield*M0(),f=(d,h)=>{let m={input:Ar(d),key:{name:h.name??"",ctrl:!!h.ctrl,meta:!!h.meta,shift:!!h.shift}};p.unsafeOffer(m),e(m)&&p.unsafeDone(Fl)};return yield*DI(()=>Re(()=>t.off("keypress",f))),t.on("keypress",f),p}),c=xB(n).pipe(V(p=>cs(f=>{let d=h=>f(k(h));return p.once("line",d),Re(()=>p.off("line",d))})),La),u=p=>jl(cs(f=>{r.write(p,d=>f(d?C(new di({module:"Terminal",method:"display",description:"Failed to write prompt to stdout",cause:d})):Te))}));return kr.of({columns:o,rows:i,isTTY:s,readInput:a,readLine:c,display:u})}),Jce=vj(kr,Qce(Gce));var Yce=Jce;l();l();l();l();l();var OH=Symbol.for("effect/FiberSet"),$Me=e=>se(e,OH),qMe={[OH]:OH,[Symbol.iterator](){return this.state._tag==="Closed"?E4():this.state.backing[Symbol.iterator]()},toString(){return bt(this.toJSON())},toJSON(){return{_id:"FiberMap",state:this.state}},[nt](){return this.toJSON()},pipe(){return W(this,arguments)}},UMe=(e,t)=>{let r=Object.create(qMe);return r.state={_tag:"Open",backing:e},r.deferred=t,r},Zce=()=>To(oe(Mr(),e=>UMe(new Set,e)),e=>Ph(t=>{let r=e.state;if(r._tag==="Closed")return Te;e.state={_tag:"Closed"};let n=r.backing;return xX(n,wS(t.id(),ele)).pipe(Pv(e.deferred))}));var Xce=-1,ele=e6(Xce,0),jMe=S7(void 0,{emptyCase:bi,failCase:bi,dieCase:bi,interruptCase:(e,t)=>BT(TS(t),Xce),sequentialCase:(e,t,r)=>t||r,parallelCase:(e,t,r)=>t||r}),tle=g(e=>$Me(e[0]),(e,t,r)=>{if(e.state._tag==="Closed"){t.unsafeInterruptAsFork(wS(r?.interruptAs??ri,ele));return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(n=>{e.state._tag!=="Closed"&&(e.state.backing.delete(t),Pl(n)&&(r?.propagateInterruption===!0?!jMe(n.cause):!E7(n.cause))&&Pa(e.deferred,n))})});var rle=e=>Xt(e.deferred);l();var n_=class extends Ji("@effect/platform/Transferable/Collector")(){},nle=()=>{let e=[],t=o=>{e.push(...o)},r=()=>e,n=()=>{let o=e;return e=[],o};return n_.of({unsafeAddAll:t,addAll:o=>Re(()=>t(o)),unsafeRead:r,read:Re(r),unsafeClear:n,clear:Re(n)})};l();l();var ole=Symbol.for("@effect/platform/WorkerError");var ile=ole;var lu=class extends NO()("WorkerError",{reason:No("spawn","decode","send","unknown","encode"),cause:Rd}){[ile]=ile;static Cause=Sse({error:this,defect:Rd});static encodeCause=Ej(this.Cause);static decodeCause=xj(this.Cause);get message(){switch(this.reason){case"send":return"An error occurred calling .postMessage";case"spawn":return"An error occurred while spawning a worker";case"decode":return"An error occurred during decoding";case"encode":return"An error occurred during encoding";case"unknown":return"An unexpected error occurred"}}};var _H=Symbol.for("@effect/platform/Worker/PlatformWorker"),q0=br("@effect/platform/Worker/PlatformWorker"),wH=Symbol.for("@effect/platform/Worker/WorkerManager"),TH=br("@effect/platform/Worker/WorkerManager"),sle=br("@effect/platform/Worker/Spawner"),ale=R(function*(){let e=yield*q0,t=0;return TH.of({[wH]:wH,spawn({encode:r,initialMessage:n}){return R(function*(){let o=t++,i=0,s=new Map,a=nle(),c=r?E=>tt(a.clear,MI(r(E),n_,a)):k,u=yield*Mr(),p=yield*e.spawn(o);yield*p.run(E=>E[0]===0?wI(u,Te):f(E[1])).pipe(PI(E=>yn(s.values(),b=>od in b?ql(b,E):b.failCause(E))),Dx(Mee),Iee(aie(1e3)),$ee({package:"@effect/platform",module:"Worker"}),jo,Nv),yield*DI(()=>tt(yn(s.values(),E=>od in E?pU(E):E.end,{discard:!0}),Re(()=>s.clear())));let f=E=>ot(()=>{let b=s.get(E[0]);if(!b)return Te;switch(E[1]){case 0:return od in b?wo(b,E[2][0]):b.offerAll(E[2]);case 1:return E.length===2?od in b?pU(b):b.end:od in b?wo(b,E[2][0]):tt(b.offerAll(E[2]),b.end);case 2:case 3:{if(E[1]===2)return od in b?uU(b,E[2]):b.fail(E[2]);let v=lu.decodeCause(E[2]);return od in b?ql(b,v):b.failCause(v)}}}),d=(E,b)=>Ph(v=>{let S=v.getFiberRef(Vne),w=zs(S,rZ).pipe(PF(A=>A._tag==="Span")),T=i++;return b.pipe(Dr(A=>(s.set(T,A),c(E).pipe(Dr(L=>p.send([T,0,L,w._tag==="Some"?[w.value.traceId,w.value.spanId,w.value.sampled]:void 0],a.unsafeRead())),up(L=>Wce(A)?A.failCause(L):ql(A,L))))),oe(A=>({id:T,mailbox:A})))}),h=({id:E},b)=>{let v=Re(()=>s.delete(E));return Pl(b)?tt(In(p.send([E,1])),v):v},m=E=>fE(Rie(d(E,M0()),({mailbox:b})=>zce(b),h)),x=E=>Rv(d(E,Mr()),({mailbox:b})=>Xt(b),h);return yield*Xt(u),n&&(yield*Re(n).pipe(V(x),_r(E=>new lu({reason:"spawn",cause:E})))),{id:o,execute:m,executeEffect:x}})}})}),cle=Od(TH,ale);var lle=()=>e=>q0.of({[_H]:_H,spawn(t){return R(function*(){let r=yield*sle,n,o=[];return{run:a=>Rx(c=>R(function*(){let u=yield*FI,p=yield*e.setup({worker:r(t),scope:u});n=p,yield*sp(u,Re(()=>{n=void 0}));let f=(yield*pd()).pipe(iie(W4(Y7))),d=yield*Zce(),h=EB(f);if(yield*e.listen({port:p,scope:u,emit(m){tle(d,h(a(m)))},deferred:d.deferred}),o.length>0){for(let[m,x]of o)p.postMessage([0,m],x);o.length=0}return yield*c(rle(d))}).pipe(La)),send:(a,c)=>ea({try:()=>{n===void 0?o.push([a,c]):n.postMessage([0,a],c)},catch:u=>new lu({reason:"send",cause:u})})}})}});var ule=lle,ple=q0;var fle=cle;var KMe=ule()({setup({scope:e,worker:t}){return V(Mr(),r=>{let n="postMessage"in t?{postMessage(o,i){t.postMessage(o,i)},kill:()=>t.terminate(),worker:t}:{postMessage(o,i){t.send(o)},kill:()=>t.kill("SIGKILL"),worker:t};return t.on("exit",()=>{Pa(r,Fl)}),uo(sp(e,ot(()=>(n.postMessage([1]),Xt(r))).pipe(jo,Pee(5e3),up(()=>Re(()=>n.kill())))),n)})},listen({deferred:e,emit:t,port:r}){return r.worker.on("message",n=>{t(n)}),r.worker.on("messageerror",n=>{Pa(e,new lu({reason:"decode",cause:n}))}),r.worker.on("error",n=>{Pa(e,new lu({reason:"unknown",cause:n}))}),r.worker.on("exit",n=>{Pa(e,new lu({reason:"unknown",cause:new Error(`exited with code ${n}`)}))}),Te}}),dle=Sp(ple,KMe),mle=Pk(fle,dle);var hle=mle;var gle=y(Xx(Uce,kce,Yce,hle),qne($ce));var AH={name:"@godaddy/cli",version:"0.2.3",description:"GoDaddy CLI for managing applications and webhooks",keywords:["godaddy","cli","developer-tools"],main:"./dist/cli.js",type:"module",bin:{godaddy:"./dist/cli.js"},files:["dist"],scripts:{format:"pnpm biome format --write",lint:"pnpm biome lint --write",check:"pnpm biome check --fix --unsafe","generate:api-catalog":"pnpm tsx scripts/generate-api-catalog.ts",build:"node build.mjs","build:dev":"NODE_ENV=development node build.mjs --dev && NODE_OPTIONS=--enable-source-maps node dist/cli-dev.js",prepare:"pnpm run build",test:"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage",changeset:"changeset",version:"changeset version",release:"pnpm build && changeset publish"},devDependencies:{"@biomejs/biome":"1.9.4","@changesets/cli":"^2.29.8","@types/node":"^22.14.1","@types/picomatch":"^4.0.2","@types/prompts":"^2.4.9","@types/react":"18.3.1","@types/semver":"^7.7.0","@vitest/coverage-v8":"^3.2.2","@vitest/ui":"^3.2.2",esbuild:"^0.25.12",ms:"^2.1.3",msw:"^2.4.0",tsx:"^4.19.3",vitest:"^3.2.2",yaml:"^2.8.2"},peerDependencies:{typescript:"^5.0.0"},dependencies:{"@clack/prompts":"^0.10.0","@effect/cli":"^0.73.2","@effect/platform":"^0.94.5","@effect/platform-node":"^0.104.1","@iarna/toml":"^2.2.5","@inkjs/ui":"^2.0.0","@tanstack/react-query":"^5.68.0",arktype:"^2.1.9","copy-to-clipboard":"^3.3.3",effect:"^3.19.19","gql.tada":"^1.8.10",graphql:"^16.10.0","graphql-request":"^7.1.2",ink:"^5.2.0","ink-select-input":"^6.0.0",open:"^10.1.1",picomatch:"^4.0.3",pino:"^9.6.0","pino-pretty":"^13.0.0",react:"18.3.1",semver:"^7.7.1",uuid:"^11.1.0"},publishConfig:{access:"public"},packageManager:"pnpm@10.14.0"};l();l();var Me=class extends $l("ValidationError"){},sr=class extends $l("NetworkError"){},Sr=class extends $l("AuthenticationError"){},ar=class extends $l("ConfigurationError"){},Hd=class extends $l("SecurityError"){};function CH(e){switch(e._tag){case"ValidationError":return"VALIDATION_ERROR";case"NetworkError":return"NETWORK_ERROR";case"AuthenticationError":return"AUTH_ERROR";case"ConfigurationError":return"CONFIG_ERROR";case"SecurityError":return"SECURITY_BLOCKED"}}var ZMe=new RegExp("\x1B\\[[0-9;]*m","g");function XMe(e){return e.replace(ZMe,"")}function e$e(e){if("error"in e&&e.error){let t=XMe(kre(e.error)).trim();if(t.length>0)return t}return"Invalid command input"}function t$e(e){let t=CH(e),r=e.userMessage||e.message;switch(e._tag){case"ValidationError":return{message:r,code:t,fix:"Review command arguments and try again with valid values."};case"AuthenticationError":return{message:r,code:"AUTH_REQUIRED",fix:"Run: godaddy auth login"};case"ConfigurationError":return{message:r,code:t,fix:"Check your config with: godaddy env info [environment]"};case"NetworkError":return{message:r,code:t,fix:"Verify environment connectivity with: godaddy env get and retry."};case"SecurityError":return{message:r,code:t,fix:"Resolve security findings and rerun: godaddy application deploy <name>"}}}function r$e(e){let t=e.toLowerCase();return t.includes("--output")?{message:e,code:"UNSUPPORTED_OPTION",fix:"Remove --output; all commands now emit JSON envelopes."}:t.includes("security")||t.includes("blocked")?{message:e,code:"SECURITY_BLOCKED",fix:"Resolve security findings and rerun: godaddy application deploy <name>"}:t.includes("not found")||t.includes("does not exist")?{message:e,code:"NOT_FOUND",fix:"Use discovery commands such as: godaddy application list or godaddy actions list."}:t.includes("auth")||t.includes("token")?{message:e,code:"AUTH_REQUIRED",fix:"Run: godaddy auth login"}:{message:e,code:"UNEXPECTED_ERROR",fix:"Run: godaddy for command discovery and retry with corrected input."}}function n$e(e){return typeof e=="object"&&e!==null&&"_tag"in e&&typeof e._tag=="string"&&["ValidationError","NetworkError","AuthenticationError","ConfigurationError","SecurityError"].includes(e._tag)}function yle(e){return n$e(e)?t$e(e):e instanceof Error?r$e(e.message):{message:"Unknown error",code:"UNEXPECTED_ERROR",fix:"Run: godaddy for command discovery."}}function xle(e){let t=e$e(e);if(t.includes("--output"))return{message:t,code:"UNSUPPORTED_OPTION",fix:"Remove --output; all commands now emit JSON envelopes."};switch(e._tag){case"CommandMismatch":return{message:t,code:"COMMAND_NOT_FOUND",fix:"Run: godaddy"};case"MissingFlag":case"MissingValue":case"InvalidArgument":case"InvalidValue":case"MultipleValuesDetected":case"NoBuiltInMatch":case"UnclusteredFlag":case"MissingSubcommand":case"CorrectedFlag":return{message:t,code:"VALIDATION_ERROR",fix:"Provide valid arguments/options shown in --help and retry."};case"HelpRequested":return{message:t,code:"VALIDATION_ERROR",fix:"Use --help for command usage details."};default:return{message:t,code:"VALIDATION_ERROR",fix:"Check command usage with --help and retry."}}}l();var Lp=class extends Ji("CliConfig")(){},o$e={prettyPrint:!1,verbosity:0,environmentOverride:null};function Ele(e){return Sp(Lp,{...o$e,...e})}l();var ht=class extends Ji("EnvelopeWriter")(){},ble=Od(ht,R(function*(){let e=yield*Lp,t=yield*ni(!1);function r(p){return e.prettyPrint?JSON.stringify(p,null,2):JSON.stringify(p)}function n(p){return Re(()=>{process.stdout.write(`${p}
|
|
339
339
|
`)})}let o=(p,f,d)=>R(function*(){let h=yield*_o(t),m={ok:!0,command:p,result:f,next_actions:d};return h||(yield*n(r(m)),yield*Dc(t,!0)),m}),i=(p,f,d,h)=>R(function*(){let m=yield*_o(t),x={ok:!1,command:p,error:f,fix:d,next_actions:h};return m||(yield*n(r(x)),yield*Dc(t,!0),yield*Re(()=>{process.exitCode=1})),x}),s=p=>n(r(p)),a=(p,f,d)=>R(function*(){yield*n(r({type:"result",ok:!0,command:p,result:f,next_actions:d})),yield*Dc(t,!0)}),c=(p,f,d,h)=>R(function*(){yield*n(r({type:"error",ok:!1,command:p,error:f,fix:d,next_actions:h})),yield*Dc(t,!0),yield*Re(()=>{process.exitCode=1})}),u=_o(t);return{emitSuccess:o,emitError:i,emitStreamEvent:s,emitStreamResult:a,emitStreamError:c,hasWritten:u}}));l();import Cz from"node:crypto";import LWe from"node:http";import{URL as ehe}from"node:url";l();var Og=class extends Ji("Browser")(){};l();var aN=Cm(Spe(),1);import Dje from"pino-pretty";var Wd=0,SV="[REDACTED]",Ope=["token","secret","password","authorization","cookie","api_key","apikey","code_verifier"],_pe=()=>{let e=process.env.NODE_ENV==="development",t=Wd>0?"debug":"info",r={paths:["headers.Authorization","headers.authorization","body.headers.Authorization","body.headers.authorization"],censor:"[REDACTED]"};if(e||Wd>0){let n=Dje({colorize:!0,translateTime:"HH:MM:ss",ignore:"pid,hostname",destination:2});return(0,aN.default)({level:t,redact:r},n)}return(0,aN.default)({level:t,redact:r},aN.default.destination(2))},BE=_pe(),wpe=e=>{Wd=e,BE=_pe()};var HE=()=>BE,vV=e=>{Wd>=2?BE.debug({type:"http_request",method:e.method},`\u2192 ${e.method}`):Wd===1&&BE.debug(`\u2192 ${e.method}`)},OV=e=>{Wd>=2?BE.debug({type:"http_response",method:e.method,status:e.status,statusText:e.statusText,headers:e.headers,body:e.body,duration:e.duration},`\u2190 ${e.status} ${e.method} ${e.duration?`(${e.duration}ms)`:""}`):Wd===1&&BE.debug(`\u2190 ${e.status} ${e.method} ${e.duration?`(${e.duration}ms)`:""}`)},bV=e=>{if(typeof e!="object"||e===null)return e;if(Array.isArray(e))return e.map(bV);let t={};for(let[r,n]of Object.entries(e)){let o=r.toLowerCase();Ope.some(i=>o.includes(i.toLowerCase()))?t[r]=SV:typeof n=="object"&&n!==null?t[r]=bV(n):t[r]=n}return t};function Pje(e){let t=e.toLowerCase();return Ope.some(r=>t.includes(r))}function Fje(e){if(e){if(e instanceof Headers){let t={};return e.forEach((r,n)=>{t[n]=r}),t}if(Array.isArray(e)){let t={};for(let[r,n]of e)t[r]=n;return t}return{...e}}}function vpe(e){let t=Fje(e);if(!t)return;let r={};for(let[n,o]of Object.entries(t))r[n]=Pje(n)?SV:o;return r}function Lje(e){try{let t=new URL(e).pathname.toLowerCase();return t.includes("/oauth/token")||t.includes("/oauth2/token")}catch{let t=e.toLowerCase();return t.includes("/oauth/token")||t.includes("/oauth2/token")}}var Tpe=async(e,t,r)=>{let n=t?.method??"(unknown)",o=Lje(e),i=(r?.includeResponseBody??!0)&&!o;vV({method:n});let s=Date.now(),a=await fetch(e,t),c=Date.now()-s,u,p;if(Wd>=2&&a.ok&&i){let f=a.headers.get("content-type");if(p=vpe(a.headers),f?.includes("application/json")){let d=a.clone();try{let h=await d.json();u=bV(h)}catch{u=void 0}}}else i||(u=SV,p=vpe(a.headers));return OV({method:n,status:a.status,statusText:a.statusText,headers:p,body:u,duration:c}),a};l();import{homedir as bWe}from"node:os";import{join as SWe}from"node:path";l();function vs(e){return V(mr,t=>t.exists(e).pipe($r(()=>!1)))}l();import*as em from"node:fs";import{join as xb}from"node:path";var xu=Cm(nfe(),1);l();l();l();l();l();l();var zd=e=>Array.isArray(e)?e:[e],ofe=(e,t)=>{let r=[[],[]];for(let n of e)t(n)?r[0].push(n):r[1].push(n);return r},hN=Array,Ya=(e,t)=>e.includes(t),ife=(e,t=0)=>[...new Array(e)].map((r,n)=>n+t),Ht=(e,t,r)=>e===void 0?t===void 0?[]:Array.isArray(t)?t:[t]:(r?.prepend?Array.isArray(t)?e.unshift(...t):e.unshift(t):Array.isArray(t)?e.push(...t):e.push(t),e),Mp=(e,t)=>t==null?e??[]:e==null?zd(t):e.concat(t),sfe=(...e)=>e.reduce(Mp,[]),du=(e,t,r)=>{if(e===void 0)return Array.isArray(t)?t:[t];let n=r?.isEqual??((o,i)=>o===i);for(let o of zd(t))e.some(i=>n(i,o))||e.push(o);return e},afe=(e,t)=>e.reduce((r,n)=>{let o=n[t];return r[o]=Ht(r[o],n),r},{}),$p=(e,t,r)=>e.length===t.length&&e.every(r?.isEqual?(n,o)=>r.isEqual(n,t[o]):(n,o)=>n===t[o]);l();l();l();var _s=(e,t)=>mo(e)===t,mo=e=>{let t=typeof e;return t==="object"?e===null?"null":"object":t==="function"?"object":t},ws={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},cfe={...ws,function:"a function"};l();l();var RV=class extends Error{},cr=e=>kg(e,RV),kg=(e,t=Error)=>{throw new t(e)},WE=class extends Error{name="ParseError"},z=e=>kg(e,WE),rl=e=>` ${e}`,lfe="\u200B";l();var Tt=(e,t)=>{let r={},n=Array.isArray(e),o=!1;for(let[i,s]of Object.entries(e).entries()){let a=n?t(i,s[1]):t(...s,i);o||=typeof a[0]=="number";let c=Array.isArray(a[0])||a.length===0?a:[a];for(let[u,p]of c)typeof u=="object"?r[u.group]=Ht(r[u.group],p):r[u]=p}return o?Object.values(r):r};var NV=Object.entries;var ho=(e,t)=>e in t,KE=(e,t)=>t in e;var gN=class{constructor(t){Object.assign(this,t)}},ufe=class{},zE=class extends ufe{},uBe=(e,t)=>{let r={},n={},o;for(o in e)o in t?r[o]=e[o]:n[o]=e[o];return[r,n]};var yN=(e,t)=>uBe(e,t)[1],mu=e=>Object.keys(e).length===0,Rg=e=>[...Object.entries(e),...Object.getOwnPropertySymbols(e).map(t=>[t,e[t]])],pfe=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),ffe=e=>{let t=Object.keys(e).sort(),r={};for(let n=0;n<t.length;n++)r[t[n]]=e[t[n]];return r};var Ts=rl(`unset${lfe}`),dfe=e=>Object.values(e).filter(t=>typeof t=="number"?!0:typeof e[t]!="number");var DV={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},PV=globalThis.File??Blob,FV={ArrayBuffer,Blob,File:PV,FormData,Headers,Request,Response,URL},pBe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Ng={...DV,...FV,...pBe,String,Number,Boolean},u_=e=>{let t=Object.getPrototypeOf(e);for(;t?.constructor&&(!ho(t.constructor.name,Ng)||!(e instanceof Ng[t.constructor.name]));)t=Object.getPrototypeOf(t);let r=t?.constructor?.name;if(!(r===void 0||r==="Object"))return r},p_=e=>typeof e=="object"&&e!==null?u_(e)??"object":mo(e);var jr=Array.isArray,fBe={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},dBe={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},mBe={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},mfe={...fBe,...dBe,...mBe},f_=e=>{let t=Object(e).name??null;return t&&ho(t,Ng)&&Ng[t]===e?t:null};var LV=(e,t)=>{let r=e.prototype;for(;r!==null;){if(r===t.prototype)return!0;r=Object.getPrototypeOf(r)}return!1};var hfe=e=>gfe(e,new Map),gfe=(e,t)=>{if(typeof e!="object"||e===null)return e;if(t?.has(e))return t.get(e);let r=f_(e.constructor);if(r==="Date")return new Date(e.getTime());if(r&&r!=="Array")return e;let n=Array.isArray(e)?e.slice():Object.create(Object.getPrototypeOf(e)),o=Object.getOwnPropertyDescriptors(e);if(t){t.set(e,n);for(let i in o){let s=o[i];"get"in s||"set"in s||(s.value=gfe(s.value,t))}}return Object.defineProperties(n,o),n};l();l();var hBe=e=>{let t=Ts;return()=>t===Ts?t=e():t},Kd=e=>typeof e=="function"&&e.length===0;var yfe=class extends Function{constructor(...e){let t=e.slice(0,-1),r=e[e.length-1];try{super(...t,r)}catch(n){return cr(`Encountered an unexpected error while compiling your definition:
|
|
340
340
|
Message: ${n}
|
|
341
341
|
Source: (${e.slice(0,-1)}) => {
|