@netlify/agent-runner-cli 1.167.0 → 1.168.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -132,7 +132,7 @@ For example, you can use the \`pathToFileURL()\` method of the \`url\` core modu
132
132
  `,LF:`
133
133
  `,concatBytes:r$},J$e=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},X$e={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:J$e};import{Buffer as Q$e}from"buffer";var Cre=(t,e)=>t?void 0:e1e.bind(void 0,e),e1e=function*(t,e){if(typeof e!="string"&&!Bt(e)&&!Q$e.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Ire=(t,e)=>t?t1e.bind(void 0,e):r1e.bind(void 0,e),t1e=function*(t,e){Pre(t,e),yield e},r1e=function*(t,e){if(Pre(t,e),typeof e!="string"&&!Bt(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Pre=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
134
134
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
135
- if (condition) { yield value; }`)};import{Buffer as n1e}from"buffer";import{StringDecoder as i1e}from"string_decoder";var Iw=(t,e,r)=>{if(r)return;if(t)return{transform:o1e.bind(void 0,new TextEncoder)};let n=new i1e(e);return{transform:s1e.bind(void 0,n),final:a1e.bind(void 0,n)}},o1e=function*(t,e){n1e.isBuffer(e)?yield hs(e):typeof e=="string"?yield t.encode(e):yield e},s1e=function*(t,e){yield Bt(e)?t.write(e):e},a1e=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as Ore}from"util";var i$=Ore(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),Pw=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=l1e}=e[r];for await(let i of n(t))yield*Pw(i,e,r+1)},Nre=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*c1e(r,Number(e),t)},c1e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Pw(n,r,e+1)},kre=Ore(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),l1e=function*(t){yield t};var o$=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},Mre=(t,e)=>[...e.flatMap(r=>[...Dl(r,t,0)]),...k_(t)],Dl=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=d1e}=e[r];for(let i of n(t))yield*Dl(i,e,r+1)},k_=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*u1e(r,Number(e),t)},u1e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Dl(n,r,e+1)},d1e=function*(t){yield t};var s$=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=Lre(t,s,o),l=Ml(e),u=Ml(r),d=l?i$.bind(void 0,Pw,a):o$.bind(void 0,Dl),f=l||u?i$.bind(void 0,Nre,a):o$.bind(void 0,k_),p=l||u?kre.bind(void 0,a):void 0;return{stream:new f1e({writableObjectMode:n,writableHighWaterMark:Dre(n),readableObjectMode:i,readableHighWaterMark:Dre(i),transform(m,y,S){d([m,c,0],this,S)},flush(m){f([c],this,m)},destroy:p})}},Ow=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=Lre(s,r,a);t=Mre(c,t)}return t},Lre=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:Cre(n,a)},Iw(r,s,n),Cw(r,o,n,c),{transform:t,final:e},{transform:Ire(i,a)},Rre({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)};var $re=(t,e)=>{for(let r of p1e(t))h1e(t,r,e)},p1e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),h1e=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Ma[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>m1e(a,n));r.input=b_(s)},m1e=(t,e)=>{let r=Ow(t,e,"utf8",!0);return g1e(r),b_(r)},g1e=t=>{let e=t.find(r=>typeof r!="string"&&!Bt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as E1e,appendFileSync as v1e}from"fs";var Nw=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&hf(r,n)&&!yn.has(e)&&_1e(n)&&(t.some(({type:i,value:o})=>i==="native"&&y1e.has(o))||t.every(({type:i})=>Kn.has(i))),_1e=t=>t===1||t===2,y1e=new Set(["pipe","overlapped"]),Ure=async(t,e,r,n)=>{for await(let i of t)S1e(e)||Bre(i,r,n)},Fre=(t,e,r)=>{for(let n of t)Bre(n,e,r)},S1e=t=>t._readableState.pipes.length>0,Bre=(t,e,r)=>{let n=HA(t);fo({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var jre=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>T1e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},T1e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=zte(t,o,d),p=hs(f),{stdioItems:h,objectMode:m}=e[r],y=b1e([p],h,c,n),{serializedResult:S,finalResult:b=S}=A1e({chunks:y,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});w1e({serializedResult:S,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let w=a[r]?b:void 0;try{return n.error===void 0&&x1e(S,h,i),w}catch(T){return n.error=T,w}},b1e=(t,e,r,n)=>{try{return Ow(t,e,r,!1)}catch(i){return n.error=i,t}},A1e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:b_(t)};let s=r7(t,r);return n[o]?{serializedResult:s,finalResult:n$(s,!i[o],e)}:{serializedResult:s}},w1e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!Nw({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=n$(t,!1,s);try{Fre(a,e,n)}catch(c){r.error??=c}},x1e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>xw.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?v1e(n,t):(r.add(o),E1e(n,t))}};var zre=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,_s(e,r,"all")]:Array.isArray(e)?[_s(t,r,"all"),...e]:Bt(t)&&Bt(e)?fL([t,e]):`${t}${e}`};import{once as a$}from"events";var Gre=async(t,e)=>{let[r,n]=await R1e(t);return e.isForcefullyTerminated??=!1,[r,n]},R1e=async t=>{let[e,r]=await Promise.allSettled([a$(t,"spawn"),a$(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?qre(t):r.value},qre=async t=>{try{return await a$(t,"exit")}catch{return qre(t)}},Vre=async t=>{let[e,r]=await t;if(!C1e(e,r)&&c$(e,r))throw new xi;return[e,r]},C1e=(t,e)=>t===void 0&&e===void 0,c$=(t,e)=>t!==0||e!==null;var Hre=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=I1e(t,e,r),s=o?.code==="ETIMEDOUT",a=jte(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},I1e=(t,e,r)=>t!==void 0?t:c$(e,r)?new xi:void 0;var Wre=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=O1e(t,e,r),d=M1e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Af(d,c,l)},O1e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=YA(t,e,r),a=N1e(r),{file:c,commandArguments:l,options:u}=hw(t,e,a);k1e(u);let d=bre(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},N1e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,k1e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&kw("ipcInput"),t&&kw("ipc: true"),r&&kw("detached: true"),n&&kw("cancelSignal")},kw=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},M1e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=D1e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Hre(c,r),{output:h,error:m=l}=jre({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),y=h.map((b,w)=>_s(b,r,w)),S=_s(zre(h,r),r,"all");return $1e({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:y,all:S,options:r,command:n,escapedCommand:i,startTime:a})},D1e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{$re(o,r);let a=L1e(r);return P1e(...mw(t,e,a))}catch(a){return bf({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},L1e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Tw(e)}),$1e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?bw({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):N_({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as AFe}from"events";import{spawn as wFe}from"child_process";import Xre from"process";import{once as l$,on as U1e}from"events";var Yre=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(_f({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:cw(t)}),F1e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),F1e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{iw(e,i);let o=ka(t,e,r),s=new AbortController;try{return await Promise.race([B1e(o,n,s),j1e(o,r,s),z1e(o,r,s)])}catch(a){throw yf(t),a}finally{s.abort(),ow(e,i)}},B1e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await l$(t,"message",{signal:r});return n}for await(let[n]of U1e(t,"message",{signal:r}))if(e(n))return n},j1e=async(t,e,{signal:r})=>{await l$(t,"disconnect",{signal:r}),Mee(e)},z1e=async(t,e,{signal:r})=>{let[n]=await l$(t,"strict:error",{signal:r});throw tw(n,e)};import{once as Zre,on as G1e}from"events";var Jre=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>u$({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),u$=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{_f({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:cw(t)}),iw(e,o);let s=ka(t,e,r),a=new AbortController,c={};return q1e(t,s,a),V1e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),H1e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},q1e=async(t,e,r)=>{try{await Zre(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},V1e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await Zre(t,"strict:error",{signal:r.signal});n.error=tw(i,e),r.abort()}catch{}},H1e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of G1e(r,"message",{signal:o.signal}))Kre(s),yield c}catch{Kre(s)}finally{o.abort(),ow(e,a),n||yf(t),i&&await t}},Kre=({error:t})=>{if(t)throw t};var Qre=(t,{ipc:e})=>{Object.assign(t,tne(t,!1,e))},ene=()=>{let t=Xre,e=!0,r=Xre.channel!==void 0;return{...tne(t,e,r),getCancelSignal:ate.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},tne=(t,e,r)=>({sendMessage:fw.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Yre.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Jre.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as W1e}from"child_process";import{PassThrough as Y1e,Readable as K1e,Writable as Z1e,Duplex as J1e}from"stream";var rne=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{e$(n);let a=new W1e;X1e(a,n),Object.assign(a,{readable:Q1e,writable:eUe,duplex:tUe});let c=bf({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=rUe(c,s,i);return{subprocess:a,promise:l}},X1e=(t,e)=>{let r=M_(),n=M_(),i=M_(),o=Array.from({length:e.length-3},M_),s=M_(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},M_=()=>{let t=new Y1e;return t.end(),t},Q1e=()=>new K1e({read(){}}),eUe=()=>new Z1e({write(){}}),tUe=()=>new J1e({read(){},write(){}}),rUe=async(t,e,r)=>Af(t,e,r);import{createReadStream as nne,createWriteStream as ine}from"fs";import{Buffer as nUe}from"buffer";import{Readable as D_,Writable as iUe,Duplex as oUe}from"stream";var sne=(t,e)=>Rw(sUe,t,e,!1),L_=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ma[t]}.`)},one={fileNumber:L_,generator:s$,asyncGenerator:s$,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:oUe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},sUe={input:{...one,fileUrl:({value:t})=>({stream:nne(t)}),filePath:({value:{file:t}})=>({stream:nne(t)}),webStream:({value:t})=>({stream:D_.fromWeb(t)}),iterable:({value:t})=>({stream:D_.from(t)}),asyncIterable:({value:t})=>({stream:D_.from(t)}),string:({value:t})=>({stream:D_.from(t)}),uint8Array:({value:t})=>({stream:D_.from(nUe.from(t))})},output:{...one,fileUrl:({value:t})=>({stream:ine(t)}),filePath:({value:{file:t,append:e}})=>({stream:ine(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:iUe.fromWeb(t)}),iterable:L_,asyncIterable:L_,string:L_,uint8Array:L_}};import{on as aUe,once as ane}from"events";import{PassThrough as cUe,getDefaultHighWaterMark as lUe}from"stream";import{finished as une}from"stream/promises";function Ll(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)f$(i);let e=t.some(({readableObjectMode:i})=>i),r=uUe(t,e),n=new d$({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var uUe=(t,e)=>{if(t.length===0)return lUe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},d$=class extends cUe{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(f$(e),this.#e.has(e))return;this.#e.add(e),this.#n??=dUe(this,this.#e,this.#o);let r=hUe({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(f$(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},dUe=async(t,e,r)=>{Mw(t,cne);let n=new AbortController;try{await Promise.race([fUe(t,n),pUe(t,e,r,n)])}finally{n.abort(),Mw(t,-cne)}},fUe=async(t,{signal:e})=>{try{await une(t,{signal:e,cleanup:!0})}catch(r){throw dne(t,r),r}},pUe=async(t,e,r,{signal:n})=>{for await(let[i]of aUe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},f$=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},hUe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{Mw(t,lne);let a=new AbortController;try{await Promise.race([mUe(o,e,a),gUe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),_Ue({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),Mw(t,-lne)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?p$(t):yUe(t))},mUe=async(t,e,{signal:r})=>{try{await t,r.aborted||p$(e)}catch(n){r.aborted||dne(e,n)}},gUe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await une(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;fne(s)?i.add(e):pne(t,s)}},_Ue=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await ane(t,i,{signal:o}),!t.readable)return ane(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},yUe=t=>{t.writable&&t.end()},dne=(t,e)=>{fne(e)?p$(t):pne(t,e)},fne=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",p$=t=>{(t.readable||t.writable)&&t.destroy()},pne=(t,e)=>{t.destroyed||(t.once("error",SUe),t.destroy(e))},SUe=()=>{},Mw=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},cne=2,lne=1;import{finished as hne}from"stream/promises";var xf=(t,e)=>{t.pipe(e),EUe(t,e),vUe(t,e)},EUe=async(t,e)=>{if(!(wi(t)||wi(e))){try{await hne(t,{cleanup:!0,readable:!0,writable:!1})}catch{}h$(e)}},h$=t=>{t.writable&&t.end()},vUe=async(t,e)=>{if(!(wi(t)||wi(e))){try{await hne(e,{cleanup:!0,readable:!1,writable:!0})}catch{}m$(t)}},m$=t=>{t.readable&&t.destroy()};var mne=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Kn.has(c)))TUe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Kn.has(c)))AUe({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Ll(o);xf(s,i)}},TUe=(t,e,r,n)=>{r==="output"?xf(t.stdio[n],e):xf(e,t.stdio[n]);let i=bUe[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},bUe=["stdin","stdout","stderr"],AUe=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;wUe(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},wUe=(t,{signal:e})=>{wi(t)&&Nl(t,xUe,e)},xUe=2;import{addAbortListener as IUe}from"events";var $l=[];$l.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&$l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Dw=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",g$=Symbol.for("signal-exit emitter"),_$=globalThis,RUe=Object.defineProperty.bind(Object),y$=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_$[g$])return _$[g$];RUe(_$,g$,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},Lw=class{},CUe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),S$=class extends Lw{onExit(){return()=>{}}load(){}unload(){}},E$=class extends Lw{#e=v$.platform==="win32"?"SIGINT":"SIGHUP";#r=new y$;#t;#n;#o;#i={};#s=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of $l)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!Dw(this.#t))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of $l)try{let r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#c(e,...r),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,$l.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#r.count-=1)}#a(e){return Dw(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&Dw(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let i=n.call(this.#t,e,...r);return this.#r.emit("exit",this.#t.exitCode,null),i}else return n.call(this.#t,e,...r)}},v$=globalThis.process,{onExit:gne,load:Xvt,unload:Qvt}=CUe(Dw(v$)?new E$(v$):new S$);var _ne=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=gne(()=>{t.kill()});IUe(n,()=>{i()})};var Sne=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=WA(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=PUe(r,n,i),{sourceStream:d,sourceError:f}=NUe(t,l),{options:p,fileDescriptors:h}=ho.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:o}},PUe=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=OUe(t,e,...r),a=nw(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},OUe=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(yne,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||uL(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=$A(r,...n);return{destination:e(yne)(i,o,s),pipeOptions:s}}if(ho.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},yne=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),NUe=(t,e)=>{try{return{sourceStream:Sf(t,e)}}catch(r){return{sourceError:r}}};var vne=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=kUe({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw T$({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},kUe=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return m$(t),n;if(e!==void 0)return h$(r),e},T$=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>bf({error:t,command:Ene,escapedCommand:Ene,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Ene="source.pipe(destination)";var Tne=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as MUe}from"stream/promises";var bne=(t,e,r)=>{let n=$w.has(e)?LUe(t,e):DUe(t,e);return Nl(t,UUe,r.signal),Nl(e,FUe,r.signal),$Ue(e),n},DUe=(t,e)=>{let r=Ll([t]);return xf(r,e),$w.set(e,r),r},LUe=(t,e)=>{let r=$w.get(e);return r.add(t),r},$Ue=async t=>{try{await MUe(t,{cleanup:!0,readable:!1,writable:!0})}catch{}$w.delete(t)},$w=new WeakMap,UUe=2,FUe=1;import{aborted as BUe}from"util";var Ane=(t,e)=>t===void 0?[]:[jUe(t,e)],jUe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await BUe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw T$({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var Uw=(t,...e)=>{if(Ot(e[0]))return Uw.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Sne(t,...e),i=zUe({...n,destination:r});return i.pipe=Uw.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},zUe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=GUe(t,i);vne({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=bne(e,o,d);return await Promise.race([Tne(u),...Ane(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},GUe=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as ZUe}from"timers/promises";import{on as qUe}from"events";import{getDefaultHighWaterMark as VUe}from"stream";var Fw=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return HUe(e,s),xne({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},HUe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},b$=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;WUe(e,s,t);let a=t.readableObjectMode&&!o;return xne({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},WUe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},xne=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=qUe(t,"data",{signal:e.signal,highWaterMark:wne,highWatermark:wne});return YUe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},A$=VUe(!0),wne=A$,YUe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=KUe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Dl(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*k_(a)}},KUe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Iw(t,r,!e),Cw(t,i,!n,{})].filter(Boolean);var Rne=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=JUe({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([XUe(t),d]);return}let f=t$(c,r),p=b$({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([QUe({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return h},JUe=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!Nw({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=b$({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await Ure(a,t,r,o)},XUe=async t=>{await ZUe(),t.readableFlowing===null&&t.resume()},QUe=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Sw(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Ew(r,{maxBuffer:o})):await Tf(r,{maxBuffer:o})}catch(a){return Cne(Ute({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},w$=async t=>{try{return await t}catch(e){return Cne(e)}},Cne=({bufferedData:t})=>e7(t)?new Uint8Array(t):t;import{finished as eFe}from"stream/promises";var $_=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=tFe(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],eFe(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||iFe(a,e,r,n)}finally{s.abort()}},tFe=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&rFe(t,r,n),n},rFe=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{nFe(e,r),n.call(t,...i)}},nFe=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},iFe=(t,e,r,n)=>{if(!oFe(t,e,r,n))throw t},oFe=(t,e,r,n=!0)=>r.propagating?Ine(t)||Bw(t):(r.propagating=!0,x$(r,e)===n?Ine(t):Bw(t)),x$=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Bw=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Ine=t=>t?.code==="EPIPE";var Pne=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>R$({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),R$=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=$_(t,e,l);if(x$(l,e)){await u;return}let[d]=await Promise.all([Rne({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var One=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ll([t,e].filter(Boolean)):void 0,Nne=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>R$({...sFe(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:aFe(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),sFe=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},aFe=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as cFe}from"events";var kne=t=>hf(t,"ipc"),Mne=(t,e)=>{let r=HA(t);fo({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Dne=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=kne(o),a=ms(e,"ipc"),c=ms(r,"ipc");for await(let l of u$({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Fte(t,i,c),i.push(l)),s&&Mne(l,o);return i},Lne=async(t,e)=>(await Promise.allSettled([t]),e);var $ne=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:y,controller:S})=>{let b=Gre(t,f),w={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:b,propagating:!1},T=Pne({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:w}),C=Nne({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:w}),O=[],k=Dne({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),P=lFe(m,t,w),M=uFe(h,w);try{return await Promise.race([Promise.all([{},Vre(b),Promise.all(T),C,k,_te(t,d),...P,...M]),y,dFe(t,S),...fte(t,o,f,S),...kee({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:S}),...ute({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:S})])}catch(F){return f.terminationReason??="other",Promise.all([{error:F},b,Promise.all(T.map(_=>w$(_))),w$(C),Lne(k,O),Promise.allSettled(P),Promise.allSettled(M)])}},lFe=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:$_(n,i,r)),uFe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Ci(o,{checkOpen:!1})&&!wi(o)).map(({type:i,value:o,stream:s=o})=>$_(s,n,e,{isSameDirection:Kn.has(i),stopOnExit:i==="native"}))),dFe=async(t,{signal:e})=>{let[r]=await cFe(t,"error",{signal:e});throw r};var Une=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),U_=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=po();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Rf=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as fFe}from"stream";import{callbackify as pFe}from"util";import{finished as Fne}from"stream/promises";var C$=async t=>{if(t!==void 0)try{await I$(t)}catch{}},Bne=async t=>{if(t!==void 0)try{await P$(t)}catch{}},I$=async t=>{await Fne(t,{cleanup:!0,readable:!1,writable:!0})},P$=async t=>{await Fne(t,{cleanup:!0,readable:!0,writable:!1})},jw=async(t,e)=>{if(await t,e)throw e},zw=(t,e,r)=>{r&&!Bw(r)?t.destroy(r):e&&t.destroy()};var jne=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||yn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=O$(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=N$(a,s),{read:f,onStdoutDataDone:p}=k$({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),h=new fFe({read:f,destroy:pFe(D$.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return M$({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},O$=(t,e,r)=>{let n=Sf(t,e),i=U_(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},N$=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:A$},k$=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=po(),s=Fw({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){hFe(this,s,o)},onStdoutDataDone:o}},hFe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},M$=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await P$(t),await n,await C$(i),await e,r.readable&&r.push(null)}catch(o){await C$(i),zne(r,o)}},D$=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Rf(r,e)&&(zne(t,n),await jw(e,n))},zne=(t,e)=>{zw(t,t.readable,e)};import{Writable as mFe}from"stream";import{callbackify as Gne}from"util";var qne=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=L$(t,r,e),s=new mFe({...$$(n,t,i),destroy:Gne(F$.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return U$(n,s),s},L$=(t,e,r)=>{let n=nw(t,e),i=U_(r,n,"writableFinal"),o=U_(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},$$=(t,e,r)=>({write:gFe.bind(void 0,t),final:Gne(_Fe.bind(void 0,t,e,r))}),gFe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},_Fe=async(t,e,r)=>{await Rf(r,e)&&(t.writable&&t.end(),await e)},U$=async(t,e,r)=>{try{await I$(t),e.writable&&e.end()}catch(n){await Bne(r),Vne(e,n)}},F$=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Rf(r,e),await Rf(n,e)&&(Vne(t,i),await jw(e,i))},Vne=(t,e)=>{zw(t,t.writable,e)};import{Duplex as yFe}from"stream";import{callbackify as SFe}from"util";var Hne=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||yn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=O$(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=L$(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=N$(c,a),{read:y,onStdoutDataDone:S}=k$({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),b=new yFe({read:y,...$$(u,t,d),destroy:SFe(EFe.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return M$({subprocessStdout:c,onStdoutDataDone:S,readable:b,subprocess:t,subprocessStdin:u}),U$(u,b,c),b},EFe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([D$({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),F$({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var B$=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||yn.has(e),s=Sf(t,r),a=Fw({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return vFe(a,s,t)},vFe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Wne=(t,{encoding:e})=>{let r=Une();t.readable=jne.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=qne.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Hne.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=B$.bind(void 0,t,e),t[Symbol.asyncIterator]=B$.bind(void 0,t,e,{})};var Yne=(t,e)=>{for(let[r,n]of bFe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},TFe=(async()=>{})().constructor.prototype,bFe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(TFe,t)]);var Kne=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=xFe(t,e,r),{subprocess:f,promise:p}=CFe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=Uw.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),Yne(f,p),ho.set(f,{options:u,fileDescriptors:d}),f},xFe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=YA(t,e,r),{file:a,commandArguments:c,options:l}=hw(t,e,r),u=RFe(l),d=sne(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},RFe=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},CFe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=wFe(...mw(t,e,r))}catch(h){return rne({error:h,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;AFe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];mne(c,a,l),_ne(c,r,l);let d={},f=po();c.kill=Oee.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=One(c,r),Wne(c,r),Qre(c,r);let p=IFe({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},IFe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,y]=await $ne({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let S=h.map((T,C)=>_s(T,e,C)),b=_s(m,e,"all"),w=PFe({errorInfo:d,exitCode:f,signal:p,stdio:S,all:b,ipcOutput:y,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Af(w,n,e)},PFe=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?N_({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof mo,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):bw({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u});var Gw=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,OFe(n,t[n],i)]));return{...t,...r}},OFe=(t,e,r)=>NFe.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,NFe=new Set(["env",...gL]);var Da=(t,e,r,n)=>{let i=(s,a,c)=>Da(s,a,r,c),o=(...s)=>kFe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},kFe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,Gw(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=MFe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?Wre(a,c,l):Kne(a,c,l,i)},MFe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=s7(e)?a7(e,r):[e,...r],[s,a,c]=$A(...o),l=Gw(Gw(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var Zne=({file:t,commandArguments:e})=>Xne(t,e),Jne=({file:t,commandArguments:e})=>({...Xne(t,e),isSync:!0}),Xne=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=DFe(t);return{file:r,commandArguments:n}},DFe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(LFe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},LFe=/ +/g;var Qne=(t,e,r)=>{t.sync=e($Fe,r),t.s=t.sync},eie=({options:t})=>tie(t),$Fe=({options:t})=>({...tie(t),isSync:!0}),tie=t=>({options:{...UFe(t),...t}}),UFe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},rie={preferLocal:!0};var nie=Da(()=>({})),zAt=Da(()=>({isSync:!0})),iie=Da(Zne),GAt=Da(Jne),qAt=Da(hte),VAt=Da(eie,{},rie,Qne),{sendMessage:HAt,getOneMessage:WAt,getEachMessage:YAt,getCancelSignal:KAt}=ene();var oie=!1,sie=()=>{oie=!0},_o=()=>oie;var F_=null,aie=t=>(F_&&F_.destroy(),F_=new Ii({totalAllowedTime:t}),F_),cie=()=>F_;var Ii=class{constructor({totalAllowedTime:e}){this.withStageTimer=async(e,r,n,{interruptible:i=!0}={})=>{if(this.isTimeExpired())throw new Error(`${e} stage did not complete in the allowed time. Time has already expired.`);if(i&&_o())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let o=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),s=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{s=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await CA({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{ie.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),o(),s&&clearTimeout(s)}};this.startTime=Date.now(),this.totalAllowedTime=e,this.globalTimeoutId=null,this.subscribers=[],this.hasTimedOut=!1,this.setupGlobalTimeout()}getElapsedTime(){return Date.now()-this.startTime}getRemainingTime(){let e=this.getElapsedTime(),r=this.totalAllowedTime-e;return Math.max(0,r)}isTimeExpired(){return this.getRemainingTime()===0||this.hasTimedOut}setupGlobalTimeout(){this.globalTimeoutId&&clearTimeout(this.globalTimeoutId),this.globalTimeoutId=setTimeout(()=>{this.notifyTimeUp()},this.totalAllowedTime)}notifyTimeUp(){this.hasTimedOut=!0;for(let e=this.subscribers.length-1;e>=0;e--)try{this.subscribers[e]()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}}onTimesUp(e){if(this.subscribers.push(e),this.hasTimedOut)try{e()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}return()=>{let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}}off(e){let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}clearSubscribers(){this.subscribers.length=0}getSubscriberCount(){return this.subscribers.length}destroy(){this.globalTimeoutId&&(clearTimeout(this.globalTimeoutId),this.globalTimeoutId=null),this.clearSubscribers()}static{this.timeUnits={seconds:e=>e*1e3,minutes:e=>e*60*1e3,hours:e=>e*60*60*1e3}}};var lie={name:"@netlify/agent-runner-cli",type:"module",version:"1.167.0",description:"CLI tool for running Netlify agents",main:"./dist/index.js",types:"./dist/index.d.ts",exports:"./dist/index.js",bin:{"agent-runner-cli":"./dist/bin.js","agent-runner-cli-local":"./dist/bin-local.js"},files:["dist/**/*.js","dist/**/*.d.ts","dist/skills/**","patches","scripts"],scripts:{prebuild:"rm -rf dist",build:"tsup",dev:"tsup --watch",prepare:"husky install node_modules/@netlify/eslint-config-node/.husky/",prepublishOnly:"npm ci && npm test",prepack:"npm run build",test:"run-s build format test:dev",format:"run-s build format:check-fix:*","format:ci":"run-s build format:check:*","format:check-fix:lint":"run-e format:check:lint format:fix:lint","format:check:lint":'eslint --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:fix:lint":'eslint --fix --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:check-fix:prettier":"run-e format:check:prettier format:fix:prettier","format:check:prettier":'prettier --check --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"format:fix:prettier":'prettier --write --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"LOG=0 vitest --exclude '**/integration/**'","test:ci:vitest":"LOG=0 vitest run --coverage --exclude '**/integration/**'","test:smoke":"node scripts/smoke-dist.js","test:integration":"vitest run test/integration/","test:integration:codex":"vitest run test/integration/codex.test.ts","test:integration:claude":"vitest run test/integration/claude.test.ts","test:integration:gemini":"vitest run test/integration/gemini.test.ts","test:integration:opencode":"vitest run test/integration/opencode.test.ts","test:integration:skill-invocation":"vitest run test/integration/skill-invocation.test.ts","check:types":"tsc --noEmit",postinstall:"node scripts/postinstall.js"},keywords:[],license:"MIT",repository:"netlify/agent-runner-cli",bugs:{url:"https://github.com/netlify/agent-runner-cli/issues"},author:"Netlify Inc.",directories:{test:"test"},devDependencies:{"@commitlint/cli":"^20.0.0","@commitlint/config-conventional":"^20.0.0","@eslint/compat":"^2.0.0","@eslint/js":"^10.0.1","@netlify/axis":"^1.17.5","@netlify/eslint-config-node":"^7.0.1","@types/node":"^24.5.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"^4.1.5","@vitest/eslint-plugin":"^1.6.6",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-n":"^17.0.0",husky:"^9.0.0",jiti:"^2.7.0","patch-package":"^8.0.0",tsup:"^8.5.0",typescript:"^5.0.0","typescript-eslint":"^8.44.0",vitest:"^4.0.16"},dependencies:{"@anthropic-ai/claude-code":"^2.1.219","@anthropic-ai/sdk":"0.91.1","@google/gemini-cli":"0.42.0","@modelcontextprotocol/sdk":"^1.29.0","@netlify/cache-utils":"^6.0.5","@netlify/database-proxy":"^0.2.1","@netlify/otel":"^6.0.6","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.128.0","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.8.5",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var zFe=BFe(import.meta.url),GFe=ys.dirname(zFe),qFe=jFe(import.meta.url),Cf=ce("shell"),j$=new Set,uie={preferLocal:!0},dr=(t,e,r)=>{let[n,i]=VFe(e,r),o={...uie,...i},s=nie(t,n,o);fie(s,o),mie(s);let a=r?.idleTimeout;return a&&a>0&&hie(s,a),s},die=(t,e)=>{let r={...uie,...e},n=iie(t,r);return fie(n,r),mie(n),e?.idleTimeout&&e.idleTimeout>0&&hie(n,e.idleTimeout),n},VFe=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},fie=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0)return;if(Ss.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new p_).pipe(Ss.stdout),t.stderr?.pipe(new p_).pipe(Ss.stderr);return}t.stdout?.pipe(Ss.stdout),t.stderr?.pipe(Ss.stderr)},z$=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(Ss.kill(-t.pid,e),Cf.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return Cf.error("Error killing process:",r),!1}},pie=t=>z$(t,"SIGKILL"),hie=(t,e)=>{let r=null,n=()=>{Cf.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),z$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Cf.log(`Force killing idle process ${t.pid}`),pie(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let o=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",o),t.on("error",o)},mie=t=>{j$.add(t);let e=cie();if(e){let r=e.onTimesUp(()=>{Cf.log(`Global timer expired, killing process ${t.pid}`),z$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Cf.log(`Force killing process ${t.pid} after timeout`),pie(t))},5e3)});t.on("exit",()=>{j$.delete(t),r()}),t.on("error",()=>{j$.delete(t),r()})}};function yo(t,e){if(!Ss.env.NETLIFY_LOCAL_MODE)try{let i=qFe.resolve(lie.name),o=ys.dirname(i);for(;o!==ys.dirname(o);){let s=ys.dirname(o);if(ys.basename(s)==="node_modules"){let a=ys.join(s,".bin",e);if(qw.existsSync(a))return a;break}o=s}}catch(i){console.error("Could not resolve package.json",i)}if(Ss.env.NODE_PATH){let i=ys.join(Ss.env.NODE_PATH,".bin",e);if(qw.existsSync(i))return i}let r=ys.join(t,"node_modules",".bin",e);if(qw.existsSync(r))return r;let n=ys.join(GFe,"..","node_modules",".bin",e);if(qw.existsSync(n))return n}var HFe=ce("utils"),WFe=t=>new Promise(e=>{setTimeout(e,t)});var G$=t=>{try{return new URL(t).hostname||null}catch{return null}},Vw=(t,e=3e3)=>{let r=!1,n=null,i=[],o=null,s=(...a)=>{if(r)return n=a,new Promise(u=>{i.push(u)});r=!0;let c,l=new Promise(u=>{c=u});return o=(async()=>{await Promise.resolve();let u=await t(...a);for(c(u);;){if(await WFe(e),!n)return r=!1,o=null,u;let d=n,f=i;n=null,i=[],u=await t(...d),f.forEach(p=>{p(u)})}})(),l};return s.flush=async()=>{if((r||n)&&o)return await o,s.flush()},s.cancel=()=>{n=null,i.forEach(a=>a(void 0)),i=[]},s},La=(t,e,r=!1)=>{let n=null,i=null,o=null,s=function(...a){i=a,o=this;let c=r&&!n;clearTimeout(n),n=setTimeout(()=>{n=null,r||(t.apply(o,i),i=null,o=null)},e),c&&(t.apply(o,i),i=null,o=null)};return s.cancel=()=>{clearTimeout(n),n=null,i=null,o=null},s.flush=()=>{if(n){clearTimeout(n);let a=i,c=o;n=null,i=null,o=null,t.apply(c,a)}},s},gie=(t,e=!0,r)=>{if(t)try{return JSON.parse(t)}catch(n){e&&(r?.error?r.error("Could not parse JSON",n):HFe.error("Could not parse JSON",n))}},YFe=t=>t.charAt(0).toUpperCase()+t.slice(1),So=t=>t.split("-").map(e=>e.length===2?e.toUpperCase():YFe(e)).join(" ");function Es(t,e){e&&t.log(`Skill invoked: ${e}`)}var Hw=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),_ie=(t,e,r=!1)=>{if(r)return;let n=60,i=55,o=".netlify.app",s="agent-",a=6;if(!e)return`${s}${t.slice(0,a)}`;let c=`--${e}${o}`;if(c.length>i)return"";let l=n-c.length;if(l<=0)return"";if(l>=s.length+a){let u=Math.min(l-s.length,t.length);return`${s}${t.slice(0,u)}`}return t.slice(0,l)};var q$=t=>{let e=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(!e)return{command:t};let r=t.indexOf(e[0]),n=t.slice(r+e[0].length).trim();return{command:t.slice(0,r).trim(),heredocContent:n||void 0}},KFe=1e4,V$=(t,e=KFe)=>{if(!t||typeof t!="string"||t.length<=e)return t;let n=t.startsWith("```")?"\n... [truncated]\n```":"... [truncated]";return t.slice(0,e)+n};import{createHash as ZFe}from"crypto";import{createReadStream as JFe}from"fs";import Ww from"fs/promises";import Tie from"os";import Yw from"path";var yie=ce("repo"),bie="runner-diffs-",Aie=t=>`${bie}${t}-`,wie=async t=>{let e=Tie.tmpdir(),r;try{r=await Ww.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(bie)&&!n.startsWith(Aie(t))).map(n=>Ww.rm(Yw.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Xr=(t,e={})=>dr("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),Kw=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{yie.info("Getting runner diffs");let n=await QFe(r),{hasChanges:i}=n,{status:o}=n;if(!i)return{hasChanges:!1};if(!e){let h=tBe(o);await rBe(h,r)}yie.info("Changes after processing"),await W$(r);let s=await K$(o,r);if(await H$(s,r),i=await eBe(r),!i)return{hasChanges:!1,ignored:s};await Xr(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await Ww.mkdtemp(Yw.join(Tie.tmpdir(),Aie(t.sessionId))),c=async({from:h,to:m,fileName:y,binary:S})=>{let b=Yw.join(a,y);await Xr([...S?["diff",h,m,"--binary"]:["diff",h,m],`--output=${b}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:T}=await Ww.stat(b);return{path:b,size:T}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await vie(r),{hasChanges:!1,ignored:s};let u=await c({from:t.runSha,to:"HEAD",fileName:"session-binary.patch",binary:!0}),d,f;if(t.sha){d=await c({from:t.sha,to:"HEAD",fileName:"cumulative.patch"});let h=await c({from:t.sha,to:"HEAD",fileName:"cumulative-binary.patch",binary:!0});await Eie(d,h)||(f=h)}await vie(r),ie.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:s};return await Eie(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Sie=async t=>{let e=ZFe("sha256");for await(let r of JFe(t))e.update(r);return e.digest("hex")},Eie=async(t,e)=>t.size===e.size&&await Sie(t.path)===await Sie(e.path),vie=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Xr(["reset","--soft","HEAD~1"],{cwd:t})},H$=async(t=[],e=process.cwd())=>{await Xr(["add",".",...t],{cwd:e})},W$=async(t=process.cwd())=>{let e=await Xr(["status","-s"],{cwd:t});return String(e.stdout??"")},xie=/.. (.+)?\.log$/,XFe=[xie],QFe=async(t=process.cwd())=>{let e=await W$(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
135
+ if (condition) { yield value; }`)};import{Buffer as n1e}from"buffer";import{StringDecoder as i1e}from"string_decoder";var Iw=(t,e,r)=>{if(r)return;if(t)return{transform:o1e.bind(void 0,new TextEncoder)};let n=new i1e(e);return{transform:s1e.bind(void 0,n),final:a1e.bind(void 0,n)}},o1e=function*(t,e){n1e.isBuffer(e)?yield hs(e):typeof e=="string"?yield t.encode(e):yield e},s1e=function*(t,e){yield Bt(e)?t.write(e):e},a1e=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as Ore}from"util";var i$=Ore(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let i of e.currentIterable)n.push(i)}finally{delete e.currentIterable}}),Pw=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=l1e}=e[r];for await(let i of n(t))yield*Pw(i,e,r+1)},Nre=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*c1e(r,Number(e),t)},c1e=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Pw(n,r,e+1)},kre=Ore(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),l1e=function*(t){yield t};var o$=(t,e,r,n)=>{try{for(let i of t(...e))r.push(i);n()}catch(i){n(i)}},Mre=(t,e)=>[...e.flatMap(r=>[...Dl(r,t,0)]),...k_(t)],Dl=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=d1e}=e[r];for(let i of n(t))yield*Dl(i,e,r+1)},k_=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*u1e(r,Number(e),t)},u1e=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Dl(n,r,e+1)},d1e=function*(t){yield t};var s$=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:i},optionName:o},{encoding:s})=>{let a={},c=Lre(t,s,o),l=Ml(e),u=Ml(r),d=l?i$.bind(void 0,Pw,a):o$.bind(void 0,Dl),f=l||u?i$.bind(void 0,Nre,a):o$.bind(void 0,k_),p=l||u?kre.bind(void 0,a):void 0;return{stream:new f1e({writableObjectMode:n,writableHighWaterMark:Dre(n),readableObjectMode:i,readableHighWaterMark:Dre(i),transform(m,y,S){d([m,c,0],this,S)},flush(m){f([c],this,m)},destroy:p})}},Ow=(t,e,r,n)=>{let i=e.filter(({type:s})=>s==="generator"),o=n?i.reverse():i;for(let{value:s,optionName:a}of o){let c=Lre(s,r,a);t=Mre(c,t)}return t},Lre=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:i,preserveNewlines:o},s,a)=>{let c={};return[{transform:Cre(n,a)},Iw(r,s,n),Cw(r,o,n,c),{transform:t,final:e},{transform:Ire(i,a)},Rre({binary:r,preserveNewlines:o,readableObjectMode:i,state:c})].filter(Boolean)};var $re=(t,e)=>{for(let r of p1e(t))h1e(t,r,e)},p1e=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),h1e=(t,e,r)=>{let{stdioItems:n}=t[e],i=n.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){let[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Ma[a]} with synchronous methods.`)}let s=i.map(({contents:a})=>a).map(a=>m1e(a,n));r.input=b_(s)},m1e=(t,e)=>{let r=Ow(t,e,"utf8",!0);return g1e(r),b_(r)},g1e=t=>{let e=t.find(r=>typeof r!="string"&&!Bt(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as E1e,appendFileSync as v1e}from"fs";var Nw=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&hf(r,n)&&!yn.has(e)&&_1e(n)&&(t.some(({type:i,value:o})=>i==="native"&&y1e.has(o))||t.every(({type:i})=>Kn.has(i))),_1e=t=>t===1||t===2,y1e=new Set(["pipe","overlapped"]),Ure=async(t,e,r,n)=>{for await(let i of t)S1e(e)||Bre(i,r,n)},Fre=(t,e,r)=>{for(let n of t)Bre(n,e,r)},S1e=t=>t._readableState.pipes.length>0,Bre=(t,e,r)=>{let n=HA(t);fo({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var jre=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};let o={},s=new Set([]);return{output:e.map((c,l)=>T1e({result:c,fileDescriptors:t,fdNumber:l,state:o,outputFiles:s,isMaxBuffer:n,verboseInfo:i},r)),...o}},T1e=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:i,isMaxBuffer:o,verboseInfo:s},{buffer:a,encoding:c,lines:l,stripFinalNewline:u,maxBuffer:d})=>{if(t===null)return;let f=zte(t,o,d),p=hs(f),{stdioItems:h,objectMode:m}=e[r],y=b1e([p],h,c,n),{serializedResult:S,finalResult:b=S}=A1e({chunks:y,objectMode:m,encoding:c,lines:l,stripFinalNewline:u,fdNumber:r});w1e({serializedResult:S,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:h,objectMode:m});let w=a[r]?b:void 0;try{return n.error===void 0&&x1e(S,h,i),w}catch(T){return n.error=T,w}},b1e=(t,e,r,n)=>{try{return Ow(t,e,r,!1)}catch(i){return n.error=i,t}},A1e=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:i,fdNumber:o})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:b_(t)};let s=r7(t,r);return n[o]?{serializedResult:s,finalResult:n$(s,!i[o],e)}:{serializedResult:s}},w1e=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:i,stdioItems:o,objectMode:s})=>{if(!Nw({stdioItems:o,encoding:i,verboseInfo:n,fdNumber:e}))return;let a=n$(t,!1,s);try{Fre(a,e,n)}catch(c){r.error??=c}},x1e=(t,e,r)=>{for(let{path:n,append:i}of e.filter(({type:o})=>xw.has(o))){let o=typeof n=="string"?n:n.toString();i||r.has(o)?v1e(n,t):(r.add(o),E1e(n,t))}};var zre=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,_s(e,r,"all")]:Array.isArray(e)?[_s(t,r,"all"),...e]:Bt(t)&&Bt(e)?fL([t,e]):`${t}${e}`};import{once as a$}from"events";var Gre=async(t,e)=>{let[r,n]=await R1e(t);return e.isForcefullyTerminated??=!1,[r,n]},R1e=async t=>{let[e,r]=await Promise.allSettled([a$(t,"spawn"),a$(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?qre(t):r.value},qre=async t=>{try{return await a$(t,"exit")}catch{return qre(t)}},Vre=async t=>{let[e,r]=await t;if(!C1e(e,r)&&c$(e,r))throw new xi;return[e,r]},C1e=(t,e)=>t===void 0&&e===void 0,c$=(t,e)=>t!==0||e!==null;var Hre=({error:t,status:e,signal:r,output:n},{maxBuffer:i})=>{let o=I1e(t,e,r),s=o?.code==="ETIMEDOUT",a=jte(o,n,i);return{resultError:o,exitCode:e,signal:r,timedOut:s,isMaxBuffer:a}},I1e=(t,e,r)=>t!==void 0?t:c$(e,r)?new xi:void 0;var Wre=(t,e,r)=>{let{file:n,commandArguments:i,command:o,escapedCommand:s,startTime:a,verboseInfo:c,options:l,fileDescriptors:u}=O1e(t,e,r),d=M1e({file:n,commandArguments:i,options:l,command:o,escapedCommand:s,verboseInfo:c,fileDescriptors:u,startTime:a});return Af(d,c,l)},O1e=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=YA(t,e,r),a=N1e(r),{file:c,commandArguments:l,options:u}=hw(t,e,a);k1e(u);let d=bre(u,s);return{file:c,commandArguments:l,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},N1e=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,k1e=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&kw("ipcInput"),t&&kw("ipc: true"),r&&kw("detached: true"),n&&kw("cancelSignal")},kw=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},M1e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,verboseInfo:o,fileDescriptors:s,startTime:a})=>{let c=D1e({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:l,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p}=Hre(c,r),{output:h,error:m=l}=jre({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:p,verboseInfo:o}),y=h.map((b,w)=>_s(b,r,w)),S=_s(zre(h,r),r,"all");return $1e({error:m,exitCode:u,signal:d,timedOut:f,isMaxBuffer:p,stdio:y,all:S,options:r,command:n,escapedCommand:i,startTime:a})},D1e=({file:t,commandArguments:e,options:r,command:n,escapedCommand:i,fileDescriptors:o,startTime:s})=>{try{$re(o,r);let a=L1e(r);return P1e(...mw(t,e,a))}catch(a){return bf({error:a,command:n,escapedCommand:i,fileDescriptors:o,options:r,startTime:s,isSync:!0})}},L1e=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Tw(e)}),$1e=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:i,stdio:o,all:s,options:a,command:c,escapedCommand:l,startTime:u})=>t===void 0?bw({command:c,escapedCommand:l,stdio:o,all:s,ipcOutput:[],options:a,startTime:u}):N_({error:t,command:c,escapedCommand:l,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:o,all:s,ipcOutput:[],options:a,startTime:u,isSync:!0});import{setMaxListeners as AFe}from"events";import{spawn as wFe}from"child_process";import Xre from"process";import{once as l$,on as U1e}from"events";var Yre=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0,filter:o}={})=>(_f({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:cw(t)}),F1e({anyProcess:t,channel:e,isSubprocess:r,filter:o,reference:i})),F1e=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:i})=>{iw(e,i);let o=ka(t,e,r),s=new AbortController;try{return await Promise.race([B1e(o,n,s),j1e(o,r,s),z1e(o,r,s)])}catch(a){throw yf(t),a}finally{s.abort(),ow(e,i)}},B1e=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await l$(t,"message",{signal:r});return n}for await(let[n]of U1e(t,"message",{signal:r}))if(e(n))return n},j1e=async(t,e,{signal:r})=>{await l$(t,"disconnect",{signal:r}),Mee(e)},z1e=async(t,e,{signal:r})=>{let[n]=await l$(t,"strict:error",{signal:r});throw tw(n,e)};import{once as Zre,on as G1e}from"events";var Jre=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:i=!0}={})=>u$({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:i}),u$=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:i,reference:o})=>{_f({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:cw(t)}),iw(e,o);let s=ka(t,e,r),a=new AbortController,c={};return q1e(t,s,a),V1e({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),H1e({anyProcess:t,channel:e,ipcEmitter:s,isSubprocess:r,shouldAwait:i,controller:a,state:c,reference:o})},q1e=async(t,e,r)=>{try{await Zre(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},V1e=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[i]=await Zre(t,"strict:error",{signal:r.signal});n.error=tw(i,e),r.abort()}catch{}},H1e=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:i,controller:o,state:s,reference:a}){try{for await(let[c]of G1e(r,"message",{signal:o.signal}))Kre(s),yield c}catch{Kre(s)}finally{o.abort(),ow(e,a),n||yf(t),i&&await t}},Kre=({error:t})=>{if(t)throw t};var Qre=(t,{ipc:e})=>{Object.assign(t,tne(t,!1,e))},ene=()=>{let t=Xre,e=!0,r=Xre.channel!==void 0;return{...tne(t,e,r),getCancelSignal:ate.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},tne=(t,e,r)=>({sendMessage:fw.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Yre.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Jre.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as W1e}from"child_process";import{PassThrough as Y1e,Readable as K1e,Writable as Z1e,Duplex as J1e}from"stream";var rne=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,verboseInfo:s})=>{e$(n);let a=new W1e;X1e(a,n),Object.assign(a,{readable:Q1e,writable:eUe,duplex:tUe});let c=bf({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:i,startTime:o,isSync:!1}),l=rUe(c,s,i);return{subprocess:a,promise:l}},X1e=(t,e)=>{let r=M_(),n=M_(),i=M_(),o=Array.from({length:e.length-3},M_),s=M_(),a=[r,n,i,...o];Object.assign(t,{stdin:r,stdout:n,stderr:i,all:s,stdio:a})},M_=()=>{let t=new Y1e;return t.end(),t},Q1e=()=>new K1e({read(){}}),eUe=()=>new Z1e({write(){}}),tUe=()=>new J1e({read(){},write(){}}),rUe=async(t,e,r)=>Af(t,e,r);import{createReadStream as nne,createWriteStream as ine}from"fs";import{Buffer as nUe}from"buffer";import{Readable as D_,Writable as iUe,Duplex as oUe}from"stream";var sne=(t,e)=>Rw(sUe,t,e,!1),L_=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Ma[t]}.`)},one={fileNumber:L_,generator:s$,asyncGenerator:s$,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:oUe.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},sUe={input:{...one,fileUrl:({value:t})=>({stream:nne(t)}),filePath:({value:{file:t}})=>({stream:nne(t)}),webStream:({value:t})=>({stream:D_.fromWeb(t)}),iterable:({value:t})=>({stream:D_.from(t)}),asyncIterable:({value:t})=>({stream:D_.from(t)}),string:({value:t})=>({stream:D_.from(t)}),uint8Array:({value:t})=>({stream:D_.from(nUe.from(t))})},output:{...one,fileUrl:({value:t})=>({stream:ine(t)}),filePath:({value:{file:t,append:e}})=>({stream:ine(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:iUe.fromWeb(t)}),iterable:L_,asyncIterable:L_,string:L_,uint8Array:L_}};import{on as aUe,once as ane}from"events";import{PassThrough as cUe,getDefaultHighWaterMark as lUe}from"stream";import{finished as une}from"stream/promises";function Ll(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let i of t)f$(i);let e=t.some(({readableObjectMode:i})=>i),r=uUe(t,e),n=new d$({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let i of t)n.add(i);return n}var uUe=(t,e)=>{if(t.length===0)return lUe(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},d$=class extends cUe{#e=new Set([]);#r=new Set([]);#t=new Set([]);#n;#o=Symbol("unpipe");#i=new WeakMap;add(e){if(f$(e),this.#e.has(e))return;this.#e.add(e),this.#n??=dUe(this,this.#e,this.#o);let r=hUe({passThroughStream:this,stream:e,streams:this.#e,ended:this.#r,aborted:this.#t,onFinished:this.#n,unpipeEvent:this.#o});this.#i.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(f$(e),!this.#e.has(e))return!1;let r=this.#i.get(e);return r===void 0?!1:(this.#i.delete(e),e.unpipe(this),await r,!0)}},dUe=async(t,e,r)=>{Mw(t,cne);let n=new AbortController;try{await Promise.race([fUe(t,n),pUe(t,e,r,n)])}finally{n.abort(),Mw(t,-cne)}},fUe=async(t,{signal:e})=>{try{await une(t,{signal:e,cleanup:!0})}catch(r){throw dne(t,r),r}},pUe=async(t,e,r,{signal:n})=>{for await(let[i]of aUe(t,"unpipe",{signal:n}))e.has(i)&&i.emit(r)},f$=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},hUe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,onFinished:o,unpipeEvent:s})=>{Mw(t,lne);let a=new AbortController;try{await Promise.race([mUe(o,e,a),gUe({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:a}),_Ue({stream:e,streams:r,ended:n,aborted:i,unpipeEvent:s,controller:a})])}finally{a.abort(),Mw(t,-lne)}r.size>0&&r.size===n.size+i.size&&(n.size===0&&i.size>0?p$(t):yUe(t))},mUe=async(t,e,{signal:r})=>{try{await t,r.aborted||p$(e)}catch(n){r.aborted||dne(e,n)}},gUe=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:i,controller:{signal:o}})=>{try{await une(e,{signal:o,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(s){if(o.aborted||!r.has(e))return;fne(s)?i.add(e):pne(t,s)}},_Ue=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:i,controller:{signal:o}})=>{if(await ane(t,i,{signal:o}),!t.readable)return ane(o,"abort",{signal:o});e.delete(t),r.delete(t),n.delete(t)},yUe=t=>{t.writable&&t.end()},dne=(t,e)=>{fne(e)?p$(t):pne(t,e)},fne=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",p$=t=>{(t.readable||t.writable)&&t.destroy()},pne=(t,e)=>{t.destroyed||(t.once("error",SUe),t.destroy(e))},SUe=()=>{},Mw=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},cne=2,lne=1;import{finished as hne}from"stream/promises";var xf=(t,e)=>{t.pipe(e),EUe(t,e),vUe(t,e)},EUe=async(t,e)=>{if(!(wi(t)||wi(e))){try{await hne(t,{cleanup:!0,readable:!0,writable:!1})}catch{}h$(e)}},h$=t=>{t.writable&&t.end()},vUe=async(t,e)=>{if(!(wi(t)||wi(e))){try{await hne(e,{cleanup:!0,readable:!1,writable:!0})}catch{}m$(t)}},m$=t=>{t.readable&&t.destroy()};var mne=(t,e,r)=>{let n=new Map;for(let[i,{stdioItems:o,direction:s}]of Object.entries(e)){for(let{stream:a}of o.filter(({type:c})=>Kn.has(c)))TUe(t,a,s,i);for(let{stream:a}of o.filter(({type:c})=>!Kn.has(c)))AUe({subprocess:t,stream:a,direction:s,fdNumber:i,pipeGroups:n,controller:r})}for(let[i,o]of n.entries()){let s=o.length===1?o[0]:Ll(o);xf(s,i)}},TUe=(t,e,r,n)=>{r==="output"?xf(t.stdio[n],e):xf(e,t.stdio[n]);let i=bUe[n];i!==void 0&&(t[i]=e),t.stdio[n]=e},bUe=["stdin","stdout","stderr"],AUe=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:i,controller:o})=>{if(e===void 0)return;wUe(e,o);let[s,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],c=i.get(s)??[];i.set(s,[...c,a])},wUe=(t,{signal:e})=>{wi(t)&&Nl(t,xUe,e)},xUe=2;import{addAbortListener as IUe}from"events";var $l=[];$l.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&$l.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&$l.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Dw=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",g$=Symbol.for("signal-exit emitter"),_$=globalThis,RUe=Object.defineProperty.bind(Object),y$=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(_$[g$])return _$[g$];RUe(_$,g$,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],i=n.indexOf(r);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let o of this.listeners[e])i=o(r,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",r,n)||i),i}},Lw=class{},CUe=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),S$=class extends Lw{onExit(){return()=>{}}load(){}unload(){}},E$=class extends Lw{#e=v$.platform==="win32"?"SIGINT":"SIGHUP";#r=new y$;#t;#n;#o;#i={};#s=!1;constructor(e){super(),this.#t=e,this.#i={};for(let r of $l)this.#i[r]=()=>{let n=this.#t.listeners(r),{count:i}=this.#r,o=e;if(typeof o.__signal_exit_emitter__=="object"&&typeof o.__signal_exit_emitter__.count=="number"&&(i+=o.__signal_exit_emitter__.count),n.length===i){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#e:r;s||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!Dw(this.#t))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of $l)try{let r=this.#i[e];r&&this.#t.on(e,r)}catch{}this.#t.emit=(e,...r)=>this.#c(e,...r),this.#t.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,$l.forEach(e=>{let r=this.#i[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#t.removeListener(e,r)}catch{}}),this.#t.emit=this.#n,this.#t.reallyExit=this.#o,this.#r.count-=1)}#a(e){return Dw(this.#t)?(this.#t.exitCode=e||0,this.#r.emit("exit",this.#t.exitCode,null),this.#o.call(this.#t,this.#t.exitCode)):0}#c(e,...r){let n=this.#n;if(e==="exit"&&Dw(this.#t)){typeof r[0]=="number"&&(this.#t.exitCode=r[0]);let i=n.call(this.#t,e,...r);return this.#r.emit("exit",this.#t.exitCode,null),i}else return n.call(this.#t,e,...r)}},v$=globalThis.process,{onExit:gne,load:Xvt,unload:Qvt}=CUe(Dw(v$)?new E$(v$):new S$);var _ne=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let i=gne(()=>{t.kill()});IUe(n,()=>{i()})};var Sne=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...i)=>{let o=WA(),{destination:s,destinationStream:a,destinationError:c,from:l,unpipeSignal:u}=PUe(r,n,i),{sourceStream:d,sourceError:f}=NUe(t,l),{options:p,fileDescriptors:h}=ho.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:s,destinationStream:a,destinationError:c,unpipeSignal:u,fileDescriptors:h,startTime:o}},PUe=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:i,to:o,unpipeSignal:s}={}}=OUe(t,e,...r),a=nw(n,o);return{destination:n,destinationStream:a,from:i,unpipeSignal:s}}catch(n){return{destinationError:n}}},OUe=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(yne,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||uL(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[i,o,s]=$A(r,...n);return{destination:e(yne)(i,o,s),pipeOptions:s}}if(ho.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},yne=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),NUe=(t,e)=>{try{return{sourceStream:Sf(t,e)}}catch(r){return{sourceError:r}}};var vne=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:i,sourceOptions:o,startTime:s})=>{let a=kUe({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw T$({error:a,fileDescriptors:i,sourceOptions:o,startTime:s})},kUe=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return m$(t),n;if(e!==void 0)return h$(r),e},T$=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>bf({error:t,command:Ene,escapedCommand:Ene,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Ene="source.pipe(destination)";var Tne=async t=>{let[{status:e,reason:r,value:n=r},{status:i,reason:o,value:s=o}]=await t;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),i==="rejected")throw s;if(e==="rejected")throw n;return s};import{finished as MUe}from"stream/promises";var bne=(t,e,r)=>{let n=$w.has(e)?LUe(t,e):DUe(t,e);return Nl(t,UUe,r.signal),Nl(e,FUe,r.signal),$Ue(e),n},DUe=(t,e)=>{let r=Ll([t]);return xf(r,e),$w.set(e,r),r},LUe=(t,e)=>{let r=$w.get(e);return r.add(t),r},$Ue=async t=>{try{await MUe(t,{cleanup:!0,readable:!1,writable:!0})}catch{}$w.delete(t)},$w=new WeakMap,UUe=2,FUe=1;import{aborted as BUe}from"util";var Ane=(t,e)=>t===void 0?[]:[jUe(t,e)],jUe=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:i,startTime:o})=>{await BUe(t,e),await r.remove(e);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw T$({error:s,fileDescriptors:n,sourceOptions:i,startTime:o})};var Uw=(t,...e)=>{if(Ot(e[0]))return Uw.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Sne(t,...e),i=zUe({...n,destination:r});return i.pipe=Uw.bind(void 0,{...t,source:r,sourcePromise:i,boundOptions:{}}),i},zUe=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:i,destinationStream:o,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:l})=>{let u=GUe(t,i);vne({sourceStream:e,sourceError:n,destinationStream:o,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:l});let d=new AbortController;try{let f=bne(e,o,d);return await Promise.race([Tne(u),...Ane(a,{sourceStream:e,mergedStream:f,sourceOptions:r,fileDescriptors:c,startTime:l})])}finally{d.abort()}},GUe=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as ZUe}from"timers/promises";import{on as qUe}from"events";import{getDefaultHighWaterMark as VUe}from"stream";var Fw=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:i,preserveNewlines:o})=>{let s=new AbortController;return HUe(e,s),xne({stream:t,controller:s,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:o})},HUe=async(t,e)=>{try{await t}catch{}finally{e.abort()}},b$=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:i,allMixed:o})=>{let s=new AbortController;WUe(e,s,t);let a=t.readableObjectMode&&!o;return xne({stream:t,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!i})},WUe=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},xne=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})=>{let a=qUe(t,"data",{signal:e.signal,highWaterMark:wne,highWatermark:wne});return YUe({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s})},A$=VUe(!0),wne=A$,YUe=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s}){let a=KUe({binary:r,shouldEncode:n,encoding:i,shouldSplit:o,preserveNewlines:s});try{for await(let[c]of t)yield*Dl(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*k_(a)}},KUe=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:i})=>[Iw(t,r,!e),Cw(t,i,!n,{})].filter(Boolean);var Rne=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:i,maxBuffer:o,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:l,streamInfo:u})=>{let d=JUe({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:l,streamInfo:u});if(!i){await Promise.all([XUe(t),d]);return}let f=t$(c,r),p=b$({stream:t,onStreamEnd:e,lines:s,encoding:n,stripFinalNewline:f,allMixed:a}),[h]=await Promise.all([QUe({stream:t,iterable:p,fdNumber:r,encoding:n,maxBuffer:o,lines:s}),d]);return h},JUe=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:i,verboseInfo:o,streamInfo:{fileDescriptors:s}})=>{if(!Nw({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:o,fdNumber:r}))return;let a=b$({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:i});await Ure(a,t,r,o)},XUe=async t=>{await ZUe(),t.readableFlowing===null&&t.resume()},QUe=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:i,maxBuffer:o,lines:s})=>{try{return e||s?await Sw(r,{maxBuffer:o}):i==="buffer"?new Uint8Array(await Ew(r,{maxBuffer:o})):await Tf(r,{maxBuffer:o})}catch(a){return Cne(Ute({error:a,stream:t,readableObjectMode:e,lines:s,encoding:i,fdNumber:n}))}},w$=async t=>{try{return await t}catch(e){return Cne(e)}},Cne=({bufferedData:t})=>e7(t)?new Uint8Array(t):t;import{finished as eFe}from"stream/promises";var $_=async(t,e,r,{isSameDirection:n,stopOnExit:i=!1}={})=>{let o=tFe(t,r),s=new AbortController;try{await Promise.race([...i?[r.exitPromise]:[],eFe(t,{cleanup:!0,signal:s.signal})])}catch(a){o.stdinCleanedUp||iFe(a,e,r,n)}finally{s.abort()}},tFe=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&rFe(t,r,n),n},rFe=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...i)=>{nFe(e,r),n.call(t,...i)}},nFe=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},iFe=(t,e,r,n)=>{if(!oFe(t,e,r,n))throw t},oFe=(t,e,r,n=!0)=>r.propagating?Ine(t)||Bw(t):(r.propagating=!0,x$(r,e)===n?Ine(t):Bw(t)),x$=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",Bw=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Ine=t=>t?.code==="EPIPE";var Pne=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>t.stdio.map((c,l)=>R$({stream:c,fdNumber:l,encoding:e,buffer:r[l],maxBuffer:n[l],lines:i[l],allMixed:!1,stripFinalNewline:o,verboseInfo:s,streamInfo:a})),R$=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l})=>{if(!t)return;let u=$_(t,e,l);if(x$(l,e)){await u;return}let[d]=await Promise.all([Rne({stream:t,onStreamEnd:u,fdNumber:e,encoding:r,buffer:n,maxBuffer:i,lines:o,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:l}),u]);return d};var One=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ll([t,e].filter(Boolean)):void 0,Nne=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:o,verboseInfo:s,streamInfo:a})=>R$({...sFe(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:i[1]||i[2],allMixed:aFe(t),stripFinalNewline:o,verboseInfo:s,streamInfo:a}),sFe=({stdout:t,stderr:e,all:r},[,n,i])=>{let o=n||i;return o?n?i?{stream:r,buffer:o}:{stream:t,buffer:o}:{stream:e,buffer:o}:{stream:r,buffer:o}},aFe=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as cFe}from"events";var kne=t=>hf(t,"ipc"),Mne=(t,e)=>{let r=HA(t);fo({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Dne=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:i,verboseInfo:o})=>{if(!n)return i;let s=kne(o),a=ms(e,"ipc"),c=ms(r,"ipc");for await(let l of u$({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Fte(t,i,c),i.push(l)),s&&Mne(l,o);return i},Lne=async(t,e)=>(await Promise.allSettled([t]),e);var $ne=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:i,timeoutDuration:o,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:l,ipc:u,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:m,onInternalError:y,controller:S})=>{let b=Gre(t,f),w={originalStreams:m,fileDescriptors:h,subprocess:t,exitPromise:b,propagating:!1},T=Pne({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:w}),C=Nne({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:i,stripFinalNewline:l,verboseInfo:p,streamInfo:w}),O=[],k=Dne({subprocess:t,buffer:r,maxBuffer:n,ipc:u,ipcOutput:O,verboseInfo:p}),P=lFe(m,t,w),M=uFe(h,w);try{return await Promise.race([Promise.all([{},Vre(b),Promise.all(T),C,k,_te(t,d),...P,...M]),y,dFe(t,S),...fte(t,o,f,S),...kee({subprocess:t,cancelSignal:s,gracefulCancel:a,context:f,controller:S}),...ute({subprocess:t,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:S})])}catch(F){return f.terminationReason??="other",Promise.all([{error:F},b,Promise.all(T.map(_=>w$(_))),w$(C),Lne(k,O),Promise.allSettled(P),Promise.allSettled(M)])}},lFe=(t,e,r)=>t.map((n,i)=>n===e.stdio[i]?void 0:$_(n,i,r)),uFe=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:i,stream:o=i})=>Ci(o,{checkOpen:!1})&&!wi(o)).map(({type:i,value:o,stream:s=o})=>$_(s,n,e,{isSameDirection:Kn.has(i),stopOnExit:i==="native"}))),dFe=async(t,{signal:e})=>{let[r]=await cFe(t,"error",{signal:e});throw r};var Une=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),U_=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let i=n.get(e),o=po();return i.push(o),{resolve:o.resolve.bind(o),promises:i}},Rf=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as fFe}from"stream";import{callbackify as pFe}from"util";import{finished as Fne}from"stream/promises";var C$=async t=>{if(t!==void 0)try{await I$(t)}catch{}},Bne=async t=>{if(t!==void 0)try{await P$(t)}catch{}},I$=async t=>{await Fne(t,{cleanup:!0,readable:!1,writable:!0})},P$=async t=>{await Fne(t,{cleanup:!0,readable:!0,writable:!1})},jw=async(t,e)=>{if(await t,e)throw e},zw=(t,e,r)=>{r&&!Bw(r)?t.destroy(r):e&&t.destroy()};var jne=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:i=!0,preserveNewlines:o=!0}={})=>{let s=i||yn.has(r),{subprocessStdout:a,waitReadableDestroy:c}=O$(t,n,e),{readableEncoding:l,readableObjectMode:u,readableHighWaterMark:d}=N$(a,s),{read:f,onStdoutDataDone:p}=k$({subprocessStdout:a,subprocess:t,binary:s,encoding:r,preserveNewlines:o}),h=new fFe({read:f,destroy:pFe(D$.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:u,encoding:l});return M$({subprocessStdout:a,onStdoutDataDone:p,readable:h,subprocess:t}),h},O$=(t,e,r)=>{let n=Sf(t,e),i=U_(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:i}},N$=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:A$},k$=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:i})=>{let o=po(),s=Fw({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:i});return{read(){hFe(this,s,o)},onStdoutDataDone:o}},hFe=async(t,e,r)=>{try{let{value:n,done:i}=await e.next();i?r.resolve():t.push(n)}catch{}},M$=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:i})=>{try{await P$(t),await n,await C$(i),await e,r.readable&&r.push(null)}catch(o){await C$(i),zne(r,o)}},D$=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await Rf(r,e)&&(zne(t,n),await jw(e,n))},zne=(t,e)=>{zw(t,t.readable,e)};import{Writable as mFe}from"stream";import{callbackify as Gne}from"util";var qne=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}=L$(t,r,e),s=new mFe({...$$(n,t,i),destroy:Gne(F$.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:i,waitWritableDestroy:o})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return U$(n,s),s},L$=(t,e,r)=>{let n=nw(t,e),i=U_(r,n,"writableFinal"),o=U_(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:i,waitWritableDestroy:o}},$$=(t,e,r)=>({write:gFe.bind(void 0,t),final:Gne(_Fe.bind(void 0,t,e,r))}),gFe=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},_Fe=async(t,e,r)=>{await Rf(r,e)&&(t.writable&&t.end(),await e)},U$=async(t,e,r)=>{try{await I$(t),e.writable&&e.end()}catch(n){await Bne(r),Vne(e,n)}},F$=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},i)=>{await Rf(r,e),await Rf(n,e)&&(Vne(t,i),await jw(e,i))},Vne=(t,e)=>{zw(t,t.writable,e)};import{Duplex as yFe}from"stream";import{callbackify as SFe}from"util";var Hne=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:i,binary:o=!0,preserveNewlines:s=!0}={})=>{let a=o||yn.has(r),{subprocessStdout:c,waitReadableDestroy:l}=O$(t,n,e),{subprocessStdin:u,waitWritableFinal:d,waitWritableDestroy:f}=L$(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:m}=N$(c,a),{read:y,onStdoutDataDone:S}=k$({subprocessStdout:c,subprocess:t,binary:a,encoding:r,preserveNewlines:s}),b=new yFe({read:y,...$$(u,t,d),destroy:SFe(EFe.bind(void 0,{subprocessStdout:c,subprocessStdin:u,subprocess:t,waitReadableDestroy:l,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:m,writableHighWaterMark:u.writableHighWaterMark,readableObjectMode:h,writableObjectMode:u.writableObjectMode,encoding:p});return M$({subprocessStdout:c,onStdoutDataDone:S,readable:b,subprocess:t,subprocessStdin:u}),U$(u,b,c),b},EFe=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:i,waitWritableDestroy:o},s)=>{await Promise.all([D$({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},s),F$({subprocessStdin:e,subprocess:r,waitWritableFinal:i,waitWritableDestroy:o},s)])};var B$=(t,e,{from:r,binary:n=!1,preserveNewlines:i=!1}={})=>{let o=n||yn.has(e),s=Sf(t,r),a=Fw({subprocessStdout:s,subprocess:t,binary:o,shouldEncode:!0,encoding:e,preserveNewlines:i});return vFe(a,s,t)},vFe=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var Wne=(t,{encoding:e})=>{let r=Une();t.readable=jne.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=qne.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Hne.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=B$.bind(void 0,t,e),t[Symbol.asyncIterator]=B$.bind(void 0,t,e,{})};var Yne=(t,e)=>{for(let[r,n]of bFe){let i=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:i})}},TFe=(async()=>{})().constructor.prototype,bFe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(TFe,t)]);var Kne=(t,e,r,n)=>{let{file:i,commandArguments:o,command:s,escapedCommand:a,startTime:c,verboseInfo:l,options:u,fileDescriptors:d}=xFe(t,e,r),{subprocess:f,promise:p}=CFe({file:i,commandArguments:o,options:u,startTime:c,verboseInfo:l,command:s,escapedCommand:a,fileDescriptors:d});return f.pipe=Uw.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:n}),Yne(f,p),ho.set(f,{options:u,fileDescriptors:d}),f},xFe=(t,e,r)=>{let{command:n,escapedCommand:i,startTime:o,verboseInfo:s}=YA(t,e,r),{file:a,commandArguments:c,options:l}=hw(t,e,r),u=RFe(l),d=sne(u,s);return{file:a,commandArguments:c,command:n,escapedCommand:i,startTime:o,verboseInfo:s,options:u,fileDescriptors:d}},RFe=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},CFe=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:i,command:o,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=wFe(...mw(t,e,r))}catch(h){return rne({error:h,command:o,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:i})}let l=new AbortController;AFe(Number.POSITIVE_INFINITY,l.signal);let u=[...c.stdio];mne(c,a,l),_ne(c,r,l);let d={},f=po();c.kill=Oee.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:f,context:d,controller:l}),c.all=One(c,r),Wne(c,r),Qre(c,r);let p=IFe({subprocess:c,options:r,startTime:n,verboseInfo:i,fileDescriptors:a,originalStreams:u,command:o,escapedCommand:s,context:d,onInternalError:f,controller:l});return{subprocess:c,promise:p}},IFe=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:i,originalStreams:o,command:s,escapedCommand:a,context:c,onInternalError:l,controller:u})=>{let[d,[f,p],h,m,y]=await $ne({subprocess:t,options:e,context:c,verboseInfo:n,fileDescriptors:i,originalStreams:o,onInternalError:l,controller:u});u.abort(),l.resolve();let S=h.map((T,C)=>_s(T,e,C)),b=_s(m,e,"all"),w=PFe({errorInfo:d,exitCode:f,signal:p,stdio:S,all:b,ipcOutput:y,context:c,options:e,command:s,escapedCommand:a,startTime:r});return Af(w,n,e)},PFe=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,context:s,options:a,command:c,escapedCommand:l,startTime:u})=>"error"in t?N_({error:t.error,command:c,escapedCommand:l,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof mo,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:i,ipcOutput:o,options:a,startTime:u,isSync:!1}):bw({command:c,escapedCommand:l,stdio:n,all:i,ipcOutput:o,options:a,startTime:u});var Gw=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,i])=>[n,OFe(n,t[n],i)]));return{...t,...r}},OFe=(t,e,r)=>NFe.has(t)&&Ot(e)&&Ot(r)?{...e,...r}:r,NFe=new Set(["env",...gL]);var Da=(t,e,r,n)=>{let i=(s,a,c)=>Da(s,a,r,c),o=(...s)=>kFe({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:i},...s);return n!==void 0&&n(o,i,e),o},kFe=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:i},o,...s)=>{if(Ot(o))return i(t,Gw(r,o),n);let{file:a,commandArguments:c,options:l,isSync:u}=MFe({mapArguments:t,firstArgument:o,nextArguments:s,deepOptions:e,boundOptions:r});return u?Wre(a,c,l):Kne(a,c,l,i)},MFe=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:i})=>{let o=s7(e)?a7(e,r):[e,...r],[s,a,c]=$A(...o),l=Gw(Gw(n,i),c),{file:u=s,commandArguments:d=a,options:f=l,isSync:p=!1}=t({file:s,commandArguments:a,options:l});return{file:u,commandArguments:d,options:f,isSync:p}};var Zne=({file:t,commandArguments:e})=>Xne(t,e),Jne=({file:t,commandArguments:e})=>({...Xne(t,e),isSync:!0}),Xne=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=DFe(t);return{file:r,commandArguments:n}},DFe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(LFe)){let i=r.at(-1);i&&i.endsWith("\\")?r[r.length-1]=`${i.slice(0,-1)} ${n}`:r.push(n)}return r},LFe=/ +/g;var Qne=(t,e,r)=>{t.sync=e($Fe,r),t.s=t.sync},eie=({options:t})=>tie(t),$Fe=({options:t})=>({...tie(t),isSync:!0}),tie=t=>({options:{...UFe(t),...t}}),UFe=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},rie={preferLocal:!0};var nie=Da(()=>({})),zAt=Da(()=>({isSync:!0})),iie=Da(Zne),GAt=Da(Jne),qAt=Da(hte),VAt=Da(eie,{},rie,Qne),{sendMessage:HAt,getOneMessage:WAt,getEachMessage:YAt,getCancelSignal:KAt}=ene();var oie=!1,sie=()=>{oie=!0},_o=()=>oie;var F_=null,aie=t=>(F_&&F_.destroy(),F_=new Ii({totalAllowedTime:t}),F_),cie=()=>F_;var Ii=class{constructor({totalAllowedTime:e}){this.withStageTimer=async(e,r,n,{interruptible:i=!0}={})=>{if(this.isTimeExpired())throw new Error(`${e} stage did not complete in the allowed time. Time has already expired.`);if(i&&_o())throw new Error(`Aborting ${e} stage \u2014 shutting down`);let o=this.onTimesUp(()=>{throw new Error(`${e} stage did not complete in the allowed time.`)}),s=null,a=null;n!==void 0&&(a=new Promise((u,d)=>{s=setTimeout(()=>{d(new Error(`${e} stage exceeded its maximum duration of ${n}ms`))},n)}));let c=Date.now(),l="success";try{return await CA({stage:e},async()=>a?await Promise.race([r(),a]):await r())}catch(u){throw l="failure",u}finally{ie.timing("stage.duration",Date.now()-c,{stage:e,outcome:l}),o(),s&&clearTimeout(s)}};this.startTime=Date.now(),this.totalAllowedTime=e,this.globalTimeoutId=null,this.subscribers=[],this.hasTimedOut=!1,this.setupGlobalTimeout()}getElapsedTime(){return Date.now()-this.startTime}getRemainingTime(){let e=this.getElapsedTime(),r=this.totalAllowedTime-e;return Math.max(0,r)}isTimeExpired(){return this.getRemainingTime()===0||this.hasTimedOut}setupGlobalTimeout(){this.globalTimeoutId&&clearTimeout(this.globalTimeoutId),this.globalTimeoutId=setTimeout(()=>{this.notifyTimeUp()},this.totalAllowedTime)}notifyTimeUp(){this.hasTimedOut=!0;for(let e=this.subscribers.length-1;e>=0;e--)try{this.subscribers[e]()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}}onTimesUp(e){if(this.subscribers.push(e),this.hasTimedOut)try{e()}catch(r){console.error("TimeKeeper: Error in time up callback:",r)}return()=>{let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}}off(e){let r=this.subscribers.indexOf(e);r>-1&&this.subscribers.splice(r,1)}clearSubscribers(){this.subscribers.length=0}getSubscriberCount(){return this.subscribers.length}destroy(){this.globalTimeoutId&&(clearTimeout(this.globalTimeoutId),this.globalTimeoutId=null),this.clearSubscribers()}static{this.timeUnits={seconds:e=>e*1e3,minutes:e=>e*60*1e3,hours:e=>e*60*60*1e3}}};var lie={name:"@netlify/agent-runner-cli",type:"module",version:"1.168.0-alpha.0",description:"CLI tool for running Netlify agents",main:"./dist/index.js",types:"./dist/index.d.ts",exports:"./dist/index.js",bin:{"agent-runner-cli":"./dist/bin.js","agent-runner-cli-local":"./dist/bin-local.js"},files:["dist/**/*.js","dist/**/*.d.ts","dist/skills/**","patches","scripts"],scripts:{prebuild:"rm -rf dist",build:"tsup",dev:"tsup --watch",prepare:"husky install node_modules/@netlify/eslint-config-node/.husky/",prepublishOnly:"npm ci && npm test",prepack:"npm run build",test:"run-s build format test:dev",format:"run-s build format:check-fix:*","format:ci":"run-s build format:check:*","format:check-fix:lint":"run-e format:check:lint format:fix:lint","format:check:lint":'eslint --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:fix:lint":'eslint --fix --cache --format=codeframe --max-warnings=0 "{src,scripts,test,.github}/**/*.{js,ts,md,html}"',"format:check-fix:prettier":"run-e format:check:prettier format:fix:prettier","format:check:prettier":'prettier --check --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"format:fix:prettier":'prettier --write --ignore-path .gitignore --loglevel=warn "{src,scripts,test,.github}/**/*.{js,ts,md,yml,json,html}" "*.{js,ts,yml,json,html}" ".*.{js,ts,yml,json,html}" "!**/package-lock.json" "!package-lock.json" "!src/skills/**/*.md"',"test:dev":"run-s build test:dev:*","test:ci":"run-s build test:ci:*","test:dev:vitest":"LOG=0 vitest --exclude '**/integration/**'","test:ci:vitest":"LOG=0 vitest run --coverage --exclude '**/integration/**'","test:smoke":"node scripts/smoke-dist.js","test:integration":"vitest run test/integration/","test:integration:codex":"vitest run test/integration/codex.test.ts","test:integration:claude":"vitest run test/integration/claude.test.ts","test:integration:gemini":"vitest run test/integration/gemini.test.ts","test:integration:opencode":"vitest run test/integration/opencode.test.ts","test:integration:skill-invocation":"vitest run test/integration/skill-invocation.test.ts","check:types":"tsc --noEmit",postinstall:"node scripts/postinstall.js"},keywords:[],license:"MIT",repository:"netlify/agent-runner-cli",bugs:{url:"https://github.com/netlify/agent-runner-cli/issues"},author:"Netlify Inc.",directories:{test:"test"},devDependencies:{"@commitlint/cli":"^20.0.0","@commitlint/config-conventional":"^20.0.0","@eslint/compat":"^2.0.0","@eslint/js":"^10.0.1","@netlify/axis":"^1.17.5","@netlify/eslint-config-node":"^7.0.1","@types/node":"^24.5.0","@typescript-eslint/eslint-plugin":"^8.0.0","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"^4.1.5","@vitest/eslint-plugin":"^1.6.6",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-n":"^17.0.0",husky:"^9.0.0",jiti:"^2.7.0","patch-package":"^8.0.0",tsup:"^8.5.0",typescript:"^5.0.0","typescript-eslint":"^8.44.0",vitest:"^4.0.16"},dependencies:{"@anthropic-ai/claude-code":"^2.1.219","@anthropic-ai/sdk":"0.91.1","@google/gemini-cli":"0.42.0","@modelcontextprotocol/sdk":"^1.29.0","@netlify/cache-utils":"^6.0.5","@netlify/database-proxy":"^0.2.1","@netlify/otel":"^6.0.6","@netlify/ts-cli":"^1.2.0","@openai/codex":"0.128.0","@opentelemetry/api":"^1.9.0","@opentelemetry/exporter-trace-otlp-grpc":"0.218.0",execa:"^9.6.1",fastify:"5.12.1",minimist:"^1.2.8",openai:"6.34.0",zod:"^4.4.3"}};var zFe=BFe(import.meta.url),GFe=ys.dirname(zFe),qFe=jFe(import.meta.url),Cf=ce("shell"),j$=new Set,uie={preferLocal:!0},dr=(t,e,r)=>{let[n,i]=VFe(e,r),o={...uie,...i},s=nie(t,n,o);fie(s,o),mie(s);let a=r?.idleTimeout;return a&&a>0&&hie(s,a),s},die=(t,e)=>{let r={...uie,...e},n=iie(t,r);return fie(n,r),mie(n),e?.idleTimeout&&e.idleTimeout>0&&hie(n,e.idleTimeout),n},VFe=function(t,e){return Array.isArray(t)?[t,e]:typeof t=="object"&&t!==null?[[],t]:[[],void 0]},fie=(t,e)=>{if(e.stdio!==void 0||e.stdout!==void 0||e.stderr!==void 0)return;if(Ss.env.NETLIFY_MASK_LOGS!=="false"){t.stdout?.pipe(new p_).pipe(Ss.stdout),t.stderr?.pipe(new p_).pipe(Ss.stderr);return}t.stdout?.pipe(Ss.stdout),t.stderr?.pipe(Ss.stderr)},z$=(t,e="SIGTERM")=>{try{return t.pid&&!t.killed?(Ss.kill(-t.pid,e),Cf.log(`Killed process ${t.pid} with signal ${e}`),!0):!1}catch(r){return Cf.error("Error killing process:",r),!1}},pie=t=>z$(t,"SIGKILL"),hie=(t,e)=>{let r=null,n=()=>{Cf.log(`Process ${t.pid} killed due to idle timeout (no output for ${e}ms)`),z$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Cf.log(`Force killing idle process ${t.pid}`),pie(t))},5e3)},i=()=>{r&&clearTimeout(r),r=setTimeout(n,e)};i(),t.stdout?.on("data",i),t.stderr?.on("data",i);let o=()=>{r&&(clearTimeout(r),r=null)};t.on("exit",o),t.on("error",o)},mie=t=>{j$.add(t);let e=cie();if(e){let r=e.onTimesUp(()=>{Cf.log(`Global timer expired, killing process ${t.pid}`),z$(t,"SIGTERM"),setTimeout(()=>{t.pid&&!t.killed&&(Cf.log(`Force killing process ${t.pid} after timeout`),pie(t))},5e3)});t.on("exit",()=>{j$.delete(t),r()}),t.on("error",()=>{j$.delete(t),r()})}};function yo(t,e){if(!Ss.env.NETLIFY_LOCAL_MODE)try{let i=qFe.resolve(lie.name),o=ys.dirname(i);for(;o!==ys.dirname(o);){let s=ys.dirname(o);if(ys.basename(s)==="node_modules"){let a=ys.join(s,".bin",e);if(qw.existsSync(a))return a;break}o=s}}catch(i){console.error("Could not resolve package.json",i)}if(Ss.env.NODE_PATH){let i=ys.join(Ss.env.NODE_PATH,".bin",e);if(qw.existsSync(i))return i}let r=ys.join(t,"node_modules",".bin",e);if(qw.existsSync(r))return r;let n=ys.join(GFe,"..","node_modules",".bin",e);if(qw.existsSync(n))return n}var HFe=ce("utils"),WFe=t=>new Promise(e=>{setTimeout(e,t)});var G$=t=>{try{return new URL(t).hostname||null}catch{return null}},Vw=(t,e=3e3)=>{let r=!1,n=null,i=[],o=null,s=(...a)=>{if(r)return n=a,new Promise(u=>{i.push(u)});r=!0;let c,l=new Promise(u=>{c=u});return o=(async()=>{await Promise.resolve();let u=await t(...a);for(c(u);;){if(await WFe(e),!n)return r=!1,o=null,u;let d=n,f=i;n=null,i=[],u=await t(...d),f.forEach(p=>{p(u)})}})(),l};return s.flush=async()=>{if((r||n)&&o)return await o,s.flush()},s.cancel=()=>{n=null,i.forEach(a=>a(void 0)),i=[]},s},La=(t,e,r=!1)=>{let n=null,i=null,o=null,s=function(...a){i=a,o=this;let c=r&&!n;clearTimeout(n),n=setTimeout(()=>{n=null,r||(t.apply(o,i),i=null,o=null)},e),c&&(t.apply(o,i),i=null,o=null)};return s.cancel=()=>{clearTimeout(n),n=null,i=null,o=null},s.flush=()=>{if(n){clearTimeout(n);let a=i,c=o;n=null,i=null,o=null,t.apply(c,a)}},s},gie=(t,e=!0,r)=>{if(t)try{return JSON.parse(t)}catch(n){e&&(r?.error?r.error("Could not parse JSON",n):HFe.error("Could not parse JSON",n))}},YFe=t=>t.charAt(0).toUpperCase()+t.slice(1),So=t=>t.split("-").map(e=>e.length===2?e.toUpperCase():YFe(e)).join(" ");function Es(t,e){e&&t.log(`Skill invoked: ${e}`)}var Hw=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),_ie=(t,e,r=!1)=>{if(r)return;let n=60,i=55,o=".netlify.app",s="agent-",a=6;if(!e)return`${s}${t.slice(0,a)}`;let c=`--${e}${o}`;if(c.length>i)return"";let l=n-c.length;if(l<=0)return"";if(l>=s.length+a){let u=Math.min(l-s.length,t.length);return`${s}${t.slice(0,u)}`}return t.slice(0,l)};var q$=t=>{let e=t.match(/<<-?\s*['"]?(\w+)['"]?/);if(!e)return{command:t};let r=t.indexOf(e[0]),n=t.slice(r+e[0].length).trim();return{command:t.slice(0,r).trim(),heredocContent:n||void 0}},KFe=1e4,V$=(t,e=KFe)=>{if(!t||typeof t!="string"||t.length<=e)return t;let n=t.startsWith("```")?"\n... [truncated]\n```":"... [truncated]";return t.slice(0,e)+n};import{createHash as ZFe}from"crypto";import{createReadStream as JFe}from"fs";import Ww from"fs/promises";import Tie from"os";import Yw from"path";var yie=ce("repo"),bie="runner-diffs-",Aie=t=>`${bie}${t}-`,wie=async t=>{let e=Tie.tmpdir(),r;try{r=await Ww.readdir(e)}catch{return}await Promise.all(r.filter(n=>n.startsWith(bie)&&!n.startsWith(Aie(t))).map(n=>Ww.rm(Yw.join(e,n),{recursive:!0,force:!0}).catch(()=>{})))},Xr=(t,e={})=>dr("git",t,{...e,env:{...e.env,NETLIFY_INTERNAL_GIT:"1"}}),Kw=async({config:t,isRetry:e,cwd:r=process.cwd()})=>{yie.info("Getting runner diffs");let n=await QFe(r),{hasChanges:i}=n,{status:o}=n;if(!i)return{hasChanges:!1};if(!e){let h=tBe(o);await rBe(h,r)}yie.info("Changes after processing"),await W$(r);let s=await K$(o,r);if(await H$(s,r),i=await eBe(r),!i)return{hasChanges:!1,ignored:s};await Xr(["commit","-m","Agent runner [skip ci]"],{cwd:r});let a=await Ww.mkdtemp(Yw.join(Tie.tmpdir(),Aie(t.sessionId))),c=async({from:h,to:m,fileName:y,binary:S})=>{let b=Yw.join(a,y);await Xr([...S?["diff",h,m,"--binary"]:["diff",h,m],`--output=${b}`],{stdio:["ignore","ignore","pipe"],cwd:r});let{size:T}=await Ww.stat(b);return{path:b,size:T}},l=await c({from:t.runSha,to:"HEAD",fileName:"session.patch"});if(i=l.size>0,!i)return await vie(r),{hasChanges:!1,ignored:s};let u=await c({from:t.runSha,to:"HEAD",fileName:"session-binary.patch",binary:!0}),d,f;if(t.sha){d=await c({from:t.sha,to:"HEAD",fileName:"cumulative.patch"});let h=await c({from:t.sha,to:"HEAD",fileName:"cumulative-binary.patch",binary:!0});await Eie(d,h)||(f=h)}await vie(r),ie.distribution("diff.size",u.size);let p={hasChanges:!0,diff:l,resultDiff:d,ignored:s};return await Eie(l,u)||(p.diffBinary=u),f&&(p.resultDiffBinary=f),p},Sie=async t=>{let e=ZFe("sha256");for await(let r of JFe(t))e.update(r);return e.digest("hex")},Eie=async(t,e)=>t.size===e.size&&await Sie(t.path)===await Sie(e.path),vie=async(t=process.cwd())=>{process.env.NETLIFY_LOCAL_MODE&&await Xr(["reset","--soft","HEAD~1"],{cwd:t})},H$=async(t=[],e=process.cwd())=>{await Xr(["add",".",...t],{cwd:e})},W$=async(t=process.cwd())=>{let e=await Xr(["status","-s"],{cwd:t});return String(e.stdout??"")},xie=/.. (.+)?\.log$/,XFe=[xie],QFe=async(t=process.cwd())=>{let e=await W$(t);return{hasChanges:(e.trim().length===0?[]:e.split(`
136
136
  `).filter(i=>XFe.some(s=>s instanceof RegExp?s.test(i):i===s)?!1:i[1]?.trim()!=="")).length!==0,status:e}},eBe=async(t=process.cwd())=>{try{return await Xr(["diff","--staged","--quiet"],{cwd:t}),!1}catch{return!0}},Y$=async(t=process.cwd())=>{let{stdout:e}=await Xr(["rev-parse","HEAD"],{cwd:t});return String(e??"").trim()},Rie=async(t=process.cwd())=>{let{stdout:e}=await Xr(["rev-list","--max-parents=0","HEAD"],{cwd:t});return String(e??"").trim()},K$=async(t,e=process.cwd())=>{t||=await W$(e);let r=[".netlify","node_modules","dist",".next","out",".nuxt",".output",".cache",".turbo",".parcel-cache","coverage",".nyc_output","storybook-static","public/build","CLAUDE.local.md"],n=[];return t.split(`
137
137
  `).forEach(i=>{r.forEach(s=>{let a=i===`?? ${s}`,c=i.startsWith(`?? ${s}/`)||i.startsWith(`?? ${s}${Yw.sep}`);(a||c)&&n.push(`:!${s}`)});let o=i.match(xie)?.[1];o&&n.push(`:!${o}.log`)}),n},Cie=async(t=process.cwd())=>{await Xr(["reset","--hard","HEAD"],{cwd:t})},Iie=async(t=process.cwd())=>{let e=await Xr(["clean","-fd","-e",".netlify"],{stdio:["ignore","pipe","pipe"],cwd:t});return String(e.stdout??"").split(`
138
138
  `).filter(r=>r.startsWith("Removing ")).map(r=>r.slice(9))},tBe=t=>{let e=t.split(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@netlify/agent-runner-cli",
3
3
  "type": "module",
4
- "version": "1.167.0",
4
+ "version": "1.168.0-alpha.0",
5
5
  "description": "CLI tool for running Netlify agents",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -93,7 +93,7 @@
93
93
  "@opentelemetry/api": "^1.9.0",
94
94
  "@opentelemetry/exporter-trace-otlp-grpc": "0.218.0",
95
95
  "execa": "^9.6.1",
96
- "fastify": "5.8.5",
96
+ "fastify": "5.12.1",
97
97
  "minimist": "^1.2.8",
98
98
  "openai": "6.34.0",
99
99
  "zod": "^4.4.3"