@onfrontier/cli 0.8.5 → 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -47,7 +47,7 @@ GFS4: `),console.error(Q)};if(!W1[i1]){if(Dz=global[i1]||[],mS(W1,Dz),W1.close=f
|
|
|
47
47
|
`:"")+($?`
|
|
48
48
|
${$}
|
|
49
49
|
`:`
|
|
50
|
-
`);let K=(L)=>{console.log($),n7.exit(typeof L==="number"?L:2)},V=()=>{console.log(typeof X.version==="string"?X.version:q.version),n7.exit(0)};if(Y._.length===0&&X.argv.length===1){if(Y.version===!0&&X.autoVersion)V();else if(Y.help===!0&&X.autoHelp)K(0)}let W=Y._;if(delete Y._,!X.allowUnknownFlags){let L=W.filter((B)=>typeof B==="string"&&B.startsWith("-"));if(L.length>0)$90(L),n7.exit(2)}let G=LW(Y,{exclude:["--",/^\w$/]}),z={...G};K90(G,X);for(let L of Object.values(X.flags))delete G[L.alias];let U=Z90(X.flags,G,W);if(U.length>0)q90(U),n7.exit(2);return{input:W,flags:G,unnormalizedFlags:z,pkg:q,help:$,showHelp:K,showVersion:V}},mj=W90;var e10=z1(CV(),1);import{mkdtempSync as rk0,readFileSync as sk0,writeFileSync as t3}from"node:fs";import{tmpdir as ak0}from"node:os";import{join as zZ}from"node:path";import{spawn as tk0}from"node:child_process";var W6={api:{url:process.env.ONFRONTIER_BASE_URL||"https://api.onfrontier.ai"},app:{url:process.env.ONFRONTIER_APP_URL||"https://app.onfrontier.ai"},router:{url:process.env.ONFRONTIER_ROUTER_URL||"https://go.trybons.ai"},snapshots:{url:process.env.ONFRONTIER_SNAPSHOT_URL||"https://api.trybons.ai"},cli:{projectName:"onfrontier-cli"},statsig:{clientKey:process.env.STATSIG_CLIENT_KEY||"client-yHi9oHzSCwrVz3W62PaedcrxeGnL7o2PjNJDByGkIsn"}};function l4(Q=0,X=2000){process.exitCode=Q,setTimeout(()=>{process.exit(Q)},X).unref()}import{isDeepStrictEqual as LG0}from"node:util";import H_ from"node:process";import p5 from"node:fs";import K_ from"node:path";import oX from"node:crypto";import FG0 from"node:assert";var y5=(Q)=>{let X=typeof Q;return Q!==null&&(X==="object"||X==="function")};var OV=new Set(["__proto__","prototype","constructor"]),pX0=new Set("0123456789");function oq(Q){let X=[],J="",Z="start",q=!1;for(let Y of Q)switch(Y){case"\\":{if(Z==="index")throw new Error("Invalid character in an index");if(Z==="indexEnd")throw new Error("Invalid character after an index");if(q)J+=Y;Z="property",q=!q;break}case".":{if(Z==="index")throw new Error("Invalid character in an index");if(Z==="indexEnd"){Z="property";break}if(q){q=!1,J+=Y;break}if(OV.has(J))return[];X.push(J),J="",Z="property";break}case"[":{if(Z==="index")throw new Error("Invalid character in an index");if(Z==="indexEnd"){Z="index";break}if(q){q=!1,J+=Y;break}if(Z==="property"){if(OV.has(J))return[];X.push(J),J=""}Z="index";break}case"]":{if(Z==="index"){X.push(Number.parseInt(J,10)),J="",Z="indexEnd";break}if(Z==="indexEnd")throw new Error("Invalid character after an index")}default:{if(Z==="index"&&!pX0.has(Y))throw new Error("Invalid character in an index");if(Z==="indexEnd")throw new Error("Invalid character after an index");if(Z==="start")Z="property";if(q)q=!1,J+="\\";J+=Y}}if(q)J+="\\";switch(Z){case"property":{if(OV.has(J))return[];X.push(J);break}case"index":throw new Error("Index was not closed");case"start":{X.push("");break}}return X}function jV(Q,X){if(typeof X!=="number"&&Array.isArray(Q)){let J=Number.parseInt(X,10);return Number.isInteger(J)&&Q[J]===Q[X]}return!1}function IR(Q,X){if(jV(Q,X))throw new Error("Cannot use string index")}function PR(Q,X,J){if(!y5(Q)||typeof X!=="string")return J===void 0?Q:J;let Z=oq(X);if(Z.length===0)return J;for(let q=0;q<Z.length;q++){let Y=Z[q];if(jV(Q,Y))Q=q===Z.length-1?void 0:null;else Q=Q[Y];if(Q===void 0||Q===null){if(q!==Z.length-1)return J;break}}return Q===void 0?J:Q}function NV(Q,X,J){if(!y5(Q)||typeof X!=="string")return Q;let Z=Q,q=oq(X);for(let Y=0;Y<q.length;Y++){let $=q[Y];if(IR(Q,$),Y===q.length-1)Q[$]=J;else if(!y5(Q[$]))Q[$]=typeof q[Y+1]==="number"?[]:{};Q=Q[$]}return Z}function CR(Q,X){if(!y5(Q)||typeof X!=="string")return!1;let J=oq(X);for(let Z=0;Z<J.length;Z++){let q=J[Z];if(IR(Q,q),Z===J.length-1)return delete Q[q],!0;if(Q=Q[q],!y5(Q))return!1}}function OR(Q,X){if(!y5(Q)||typeof X!=="string")return!1;let J=oq(X);if(J.length===0)return!1;for(let Z of J){if(!y5(Q)||!(Z in Q)||jV(Q,Z))return!1;Q=Q[Z]}return!0}import K1 from"node:path";import jR from"node:os";import RV from"node:process";var p4=jR.homedir(),DV=jR.tmpdir(),{env:i7}=RV,nX0=(Q)=>{let X=K1.join(p4,"Library");return{data:K1.join(X,"Application Support",Q),config:K1.join(X,"Preferences",Q),cache:K1.join(X,"Caches",Q),log:K1.join(X,"Logs",Q),temp:K1.join(DV,Q)}},iX0=(Q)=>{let X=i7.APPDATA||K1.join(p4,"AppData","Roaming"),J=i7.LOCALAPPDATA||K1.join(p4,"AppData","Local");return{data:K1.join(J,Q,"Data"),config:K1.join(X,Q,"Config"),cache:K1.join(J,Q,"Cache"),log:K1.join(J,Q,"Log"),temp:K1.join(DV,Q)}},oX0=(Q)=>{let X=K1.basename(p4);return{data:K1.join(i7.XDG_DATA_HOME||K1.join(p4,".local","share"),Q),config:K1.join(i7.XDG_CONFIG_HOME||K1.join(p4,".config"),Q),cache:K1.join(i7.XDG_CACHE_HOME||K1.join(p4,".cache"),Q),log:K1.join(i7.XDG_STATE_HOME||K1.join(p4,".local","state"),Q),temp:K1.join(DV,X,Q)}};function wV(Q,{suffix:X="nodejs"}={}){if(typeof Q!=="string")throw new TypeError(`Expected a string, got ${typeof Q}`);if(X)Q+=`-${X}`;if(RV.platform==="darwin")return nX0(Q);if(RV.platform==="win32")return iX0(Q);return oX0(Q)}import JJ0 from"node:path";import b0 from"node:fs";import{promisify as a1}from"node:util";var rX0=(Q,X)=>{let{onError:J}=X;return function Z(...q){return Q.apply(void 0,q).catch(J)}},b8=rX0;var sX0=(Q,X)=>{let{onError:J}=X;return function Z(...q){try{return Q.apply(void 0,q)}catch(Y){return J(Y)}}},U8=sX0;var NR=250;var aX0=(Q,X)=>{let{isRetriable:J}=X;return function Z(q){let{timeout:Y}=q,$=q.interval??NR,H=Date.now()+Y;return function K(...V){return Q.apply(void 0,V).catch((W)=>{if(!J(W))throw W;if(Date.now()>=H)throw W;let G=Math.round($*Math.random());if(G>0)return new Promise((U)=>setTimeout(U,G)).then(()=>K.apply(void 0,V));else return K.apply(void 0,V)})}}},f8=aX0;var tX0=(Q,X)=>{let{isRetriable:J}=X;return function Z(q){let{timeout:Y}=q,$=Date.now()+Y;return function H(...K){while(!0)try{return Q.apply(void 0,K)}catch(V){if(!J(V))throw V;if(Date.now()>=$)throw V;continue}}}},g8=tX0;import DR from"node:process";var OX={isChangeErrorOk:(Q)=>{if(!OX.isNodeError(Q))return!1;let{code:X}=Q;if(X==="ENOSYS")return!0;if(!RR&&(X==="EINVAL"||X==="EPERM"))return!0;return!1},isNodeError:(Q)=>{return Q instanceof Error},isRetriableError:(Q)=>{if(!OX.isNodeError(Q))return!1;let{code:X}=Q;if(X==="EMFILE"||X==="ENFILE"||X==="EAGAIN"||X==="EBUSY"||X==="EACCESS"||X==="EACCES"||X==="EACCS"||X==="EPERM")return!0;return!1},onChangeError:(Q)=>{if(!OX.isNodeError(Q))throw Q;if(OX.isChangeErrorOk(Q))return;throw Q}},TV=OX;var jX={onError:TV.onChangeError},C6={onError:()=>{return}},RR=DR.getuid?!DR.getuid():!1,l1={isRetriable:TV.isRetriableError};var eX0={attempt:{chmod:b8(a1(b0.chmod),jX),chown:b8(a1(b0.chown),jX),close:b8(a1(b0.close),C6),fsync:b8(a1(b0.fsync),C6),mkdir:b8(a1(b0.mkdir),C6),realpath:b8(a1(b0.realpath),C6),stat:b8(a1(b0.stat),C6),unlink:b8(a1(b0.unlink),C6),chmodSync:U8(b0.chmodSync,jX),chownSync:U8(b0.chownSync,jX),closeSync:U8(b0.closeSync,C6),existsSync:U8(b0.existsSync,C6),fsyncSync:U8(b0.fsync,C6),mkdirSync:U8(b0.mkdirSync,C6),realpathSync:U8(b0.realpathSync,C6),statSync:U8(b0.statSync,C6),unlinkSync:U8(b0.unlinkSync,C6)},retry:{close:f8(a1(b0.close),l1),fsync:f8(a1(b0.fsync),l1),open:f8(a1(b0.open),l1),readFile:f8(a1(b0.readFile),l1),rename:f8(a1(b0.rename),l1),stat:f8(a1(b0.stat),l1),write:f8(a1(b0.write),l1),writeFile:f8(a1(b0.writeFile),l1),closeSync:g8(b0.closeSync,l1),fsyncSync:g8(b0.fsyncSync,l1),openSync:g8(b0.openSync,l1),readFileSync:g8(b0.readFileSync,l1),renameSync:g8(b0.renameSync,l1),statSync:g8(b0.statSync,l1),writeSync:g8(b0.writeSync,l1),writeFileSync:g8(b0.writeFileSync,l1)}},h1=eX0;import h5 from"node:process";var wR="utf8",AV=438,TR=511;var AR={},ER=h5.geteuid?h5.geteuid():-1,_R=h5.getegid?h5.getegid():-1;var SR=1000,vR=!!h5.getuid,Xt0=h5.getuid?!h5.getuid():!1,EV=128;var xR=(Q)=>{return Q instanceof Error&&"code"in Q};var _V=(Q)=>{return typeof Q==="string"},rq=(Q)=>{return Q===void 0};import XJ0 from"node:path";import o7 from"node:process";import kR from"node:process";var yR=kR.platform==="linux",sq=kR.platform==="win32";var SV=["SIGHUP","SIGINT","SIGTERM"];if(!sq)SV.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(yR)SV.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hR=SV;class bR{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(Q)=>{if(this.exited)return;this.exited=!0;for(let X of this.callbacks)X();if(Q)if(sq&&(Q!=="SIGINT"&&Q!=="SIGTERM"&&Q!=="SIGKILL"))o7.kill(o7.pid,"SIGTERM");else o7.kill(o7.pid,Q)},this.hook=()=>{o7.once("exit",()=>this.exit());for(let Q of hR)try{o7.once(Q,()=>this.exit(Q))}catch{}},this.register=(Q)=>{return this.callbacks.add(Q),()=>{this.callbacks.delete(Q)}},this.hook()}}var fR=new bR;var QJ0=fR.register,gR=QJ0;var _6={store:{},create:(Q)=>{let X=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),J=Date.now().toString().slice(-10),Z="tmp-",q=`.tmp-${J}${X}`;return`${Q}${q}`},get:(Q,X,J=!0)=>{let Z=_6.truncate(X(Q));if(Z in _6.store)return _6.get(Q,X,J);return _6.store[Z]=J,[Z,()=>delete _6.store[Z]]},purge:(Q)=>{if(!_6.store[Q])return;delete _6.store[Q],h1.attempt.unlink(Q)},purgeSync:(Q)=>{if(!_6.store[Q])return;delete _6.store[Q],h1.attempt.unlinkSync(Q)},purgeSyncAll:()=>{for(let Q in _6.store)_6.purgeSync(Q)},truncate:(Q)=>{let X=XJ0.basename(Q);if(X.length<=EV)return Q;let J=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(X);if(!J)return Q;let Z=X.length-EV;return`${Q.slice(0,-X.length)}${J[1]}${J[2].slice(0,-Z)}${J[3]}`}};gR(_6.purgeSyncAll);var NX=_6;function vV(Q,X,J=AR){if(_V(J))return vV(Q,X,{encoding:J});let q={timeout:J.timeout??SR},Y=null,$=null,H=null;try{let K=h1.attempt.realpathSync(Q),V=!!K;Q=K||Q,[$,Y]=NX.get(Q,J.tmpCreate||NX.create,J.tmpPurge!==!1);let W=vR&&rq(J.chown),G=rq(J.mode);if(V&&(W||G)){let z=h1.attempt.statSync(Q);if(z){if(J={...J},W)J.chown={uid:z.uid,gid:z.gid};if(G)J.mode=z.mode}}if(!V){let z=JJ0.dirname(Q);h1.attempt.mkdirSync(z,{mode:TR,recursive:!0})}if(H=h1.retry.openSync(q)($,"w",J.mode||AV),J.tmpCreated)J.tmpCreated($);if(_V(X))h1.retry.writeSync(q)(H,X,0,J.encoding||wR);else if(!rq(X))h1.retry.writeSync(q)(H,X,0,X.length,0);if(J.fsync!==!1)if(J.fsyncWait!==!1)h1.retry.fsyncSync(q)(H);else h1.attempt.fsync(H);if(h1.retry.closeSync(q)(H),H=null,J.chown&&(J.chown.uid!==ER||J.chown.gid!==_R))h1.attempt.chownSync($,J.chown.uid,J.chown.gid);if(J.mode&&J.mode!==AV)h1.attempt.chmodSync($,J.mode);try{h1.retry.renameSync(q)($,Q)}catch(z){if(!xR(z))throw z;if(z.code!=="ENAMETOOLONG")throw z;h1.retry.renameSync(q)($,NX.truncate(Q))}Y(),$=null}finally{if(H)h1.attempt.closeSync(H);if($)NX.purge($)}}var V_=z1(yE(),1),G_=z1(Z_(),1);var QG0=(Q,X,J,Z)=>{if(J==="length"||J==="prototype")return;if(J==="arguments"||J==="caller")return;let q=Object.getOwnPropertyDescriptor(Q,J),Y=Object.getOwnPropertyDescriptor(X,J);if(!XG0(q,Y)&&Z)return;Object.defineProperty(Q,J,Y)},XG0=function(Q,X){return Q===void 0||Q.configurable||Q.writable===X.writable&&Q.enumerable===X.enumerable&&Q.configurable===X.configurable&&(Q.writable||Q.value===X.value)},JG0=(Q,X)=>{let J=Object.getPrototypeOf(X);if(J===Object.getPrototypeOf(Q))return;Object.setPrototypeOf(Q,J)},ZG0=(Q,X)=>`/* Wrapped ${Q}*/
|
|
50
|
+
`);let K=(L)=>{console.log($),n7.exit(typeof L==="number"?L:2)},V=()=>{console.log(typeof X.version==="string"?X.version:q.version),n7.exit(0)};if(Y._.length===0&&X.argv.length===1){if(Y.version===!0&&X.autoVersion)V();else if(Y.help===!0&&X.autoHelp)K(0)}let W=Y._;if(delete Y._,!X.allowUnknownFlags){let L=W.filter((B)=>typeof B==="string"&&B.startsWith("-"));if(L.length>0)$90(L),n7.exit(2)}let G=LW(Y,{exclude:["--",/^\w$/]}),z={...G};K90(G,X);for(let L of Object.values(X.flags))delete G[L.alias];let U=Z90(X.flags,G,W);if(U.length>0)q90(U),n7.exit(2);return{input:W,flags:G,unnormalizedFlags:z,pkg:q,help:$,showHelp:K,showVersion:V}},mj=W90;var e10=z1(CV(),1);import{mkdtempSync as rk0,readFileSync as sk0,writeFileSync as t3}from"node:fs";import{tmpdir as ak0}from"node:os";import{join as zZ}from"node:path";import{spawn as tk0}from"node:child_process";var W6={api:{url:process.env.ONFRONTIER_BASE_URL||"https://api.onfrontier.ai"},app:{url:process.env.ONFRONTIER_APP_URL||"https://app.onfrontier.ai"},router:{url:process.env.ONFRONTIER_ROUTER_URL||"https://go.trybons.ai"},snapshots:{url:process.env.ONFRONTIER_SNAPSHOT_URL||"https://api.onfrontier.ai"},cli:{projectName:"onfrontier-cli"},statsig:{clientKey:process.env.STATSIG_CLIENT_KEY||"client-yHi9oHzSCwrVz3W62PaedcrxeGnL7o2PjNJDByGkIsn"}};function l4(Q=0,X=2000){process.exitCode=Q,setTimeout(()=>{process.exit(Q)},X).unref()}import{isDeepStrictEqual as LG0}from"node:util";import H_ from"node:process";import p5 from"node:fs";import K_ from"node:path";import oX from"node:crypto";import FG0 from"node:assert";var y5=(Q)=>{let X=typeof Q;return Q!==null&&(X==="object"||X==="function")};var OV=new Set(["__proto__","prototype","constructor"]),pX0=new Set("0123456789");function oq(Q){let X=[],J="",Z="start",q=!1;for(let Y of Q)switch(Y){case"\\":{if(Z==="index")throw new Error("Invalid character in an index");if(Z==="indexEnd")throw new Error("Invalid character after an index");if(q)J+=Y;Z="property",q=!q;break}case".":{if(Z==="index")throw new Error("Invalid character in an index");if(Z==="indexEnd"){Z="property";break}if(q){q=!1,J+=Y;break}if(OV.has(J))return[];X.push(J),J="",Z="property";break}case"[":{if(Z==="index")throw new Error("Invalid character in an index");if(Z==="indexEnd"){Z="index";break}if(q){q=!1,J+=Y;break}if(Z==="property"){if(OV.has(J))return[];X.push(J),J=""}Z="index";break}case"]":{if(Z==="index"){X.push(Number.parseInt(J,10)),J="",Z="indexEnd";break}if(Z==="indexEnd")throw new Error("Invalid character after an index")}default:{if(Z==="index"&&!pX0.has(Y))throw new Error("Invalid character in an index");if(Z==="indexEnd")throw new Error("Invalid character after an index");if(Z==="start")Z="property";if(q)q=!1,J+="\\";J+=Y}}if(q)J+="\\";switch(Z){case"property":{if(OV.has(J))return[];X.push(J);break}case"index":throw new Error("Index was not closed");case"start":{X.push("");break}}return X}function jV(Q,X){if(typeof X!=="number"&&Array.isArray(Q)){let J=Number.parseInt(X,10);return Number.isInteger(J)&&Q[J]===Q[X]}return!1}function IR(Q,X){if(jV(Q,X))throw new Error("Cannot use string index")}function PR(Q,X,J){if(!y5(Q)||typeof X!=="string")return J===void 0?Q:J;let Z=oq(X);if(Z.length===0)return J;for(let q=0;q<Z.length;q++){let Y=Z[q];if(jV(Q,Y))Q=q===Z.length-1?void 0:null;else Q=Q[Y];if(Q===void 0||Q===null){if(q!==Z.length-1)return J;break}}return Q===void 0?J:Q}function NV(Q,X,J){if(!y5(Q)||typeof X!=="string")return Q;let Z=Q,q=oq(X);for(let Y=0;Y<q.length;Y++){let $=q[Y];if(IR(Q,$),Y===q.length-1)Q[$]=J;else if(!y5(Q[$]))Q[$]=typeof q[Y+1]==="number"?[]:{};Q=Q[$]}return Z}function CR(Q,X){if(!y5(Q)||typeof X!=="string")return!1;let J=oq(X);for(let Z=0;Z<J.length;Z++){let q=J[Z];if(IR(Q,q),Z===J.length-1)return delete Q[q],!0;if(Q=Q[q],!y5(Q))return!1}}function OR(Q,X){if(!y5(Q)||typeof X!=="string")return!1;let J=oq(X);if(J.length===0)return!1;for(let Z of J){if(!y5(Q)||!(Z in Q)||jV(Q,Z))return!1;Q=Q[Z]}return!0}import K1 from"node:path";import jR from"node:os";import RV from"node:process";var p4=jR.homedir(),DV=jR.tmpdir(),{env:i7}=RV,nX0=(Q)=>{let X=K1.join(p4,"Library");return{data:K1.join(X,"Application Support",Q),config:K1.join(X,"Preferences",Q),cache:K1.join(X,"Caches",Q),log:K1.join(X,"Logs",Q),temp:K1.join(DV,Q)}},iX0=(Q)=>{let X=i7.APPDATA||K1.join(p4,"AppData","Roaming"),J=i7.LOCALAPPDATA||K1.join(p4,"AppData","Local");return{data:K1.join(J,Q,"Data"),config:K1.join(X,Q,"Config"),cache:K1.join(J,Q,"Cache"),log:K1.join(J,Q,"Log"),temp:K1.join(DV,Q)}},oX0=(Q)=>{let X=K1.basename(p4);return{data:K1.join(i7.XDG_DATA_HOME||K1.join(p4,".local","share"),Q),config:K1.join(i7.XDG_CONFIG_HOME||K1.join(p4,".config"),Q),cache:K1.join(i7.XDG_CACHE_HOME||K1.join(p4,".cache"),Q),log:K1.join(i7.XDG_STATE_HOME||K1.join(p4,".local","state"),Q),temp:K1.join(DV,X,Q)}};function wV(Q,{suffix:X="nodejs"}={}){if(typeof Q!=="string")throw new TypeError(`Expected a string, got ${typeof Q}`);if(X)Q+=`-${X}`;if(RV.platform==="darwin")return nX0(Q);if(RV.platform==="win32")return iX0(Q);return oX0(Q)}import JJ0 from"node:path";import b0 from"node:fs";import{promisify as a1}from"node:util";var rX0=(Q,X)=>{let{onError:J}=X;return function Z(...q){return Q.apply(void 0,q).catch(J)}},b8=rX0;var sX0=(Q,X)=>{let{onError:J}=X;return function Z(...q){try{return Q.apply(void 0,q)}catch(Y){return J(Y)}}},U8=sX0;var NR=250;var aX0=(Q,X)=>{let{isRetriable:J}=X;return function Z(q){let{timeout:Y}=q,$=q.interval??NR,H=Date.now()+Y;return function K(...V){return Q.apply(void 0,V).catch((W)=>{if(!J(W))throw W;if(Date.now()>=H)throw W;let G=Math.round($*Math.random());if(G>0)return new Promise((U)=>setTimeout(U,G)).then(()=>K.apply(void 0,V));else return K.apply(void 0,V)})}}},f8=aX0;var tX0=(Q,X)=>{let{isRetriable:J}=X;return function Z(q){let{timeout:Y}=q,$=Date.now()+Y;return function H(...K){while(!0)try{return Q.apply(void 0,K)}catch(V){if(!J(V))throw V;if(Date.now()>=$)throw V;continue}}}},g8=tX0;import DR from"node:process";var OX={isChangeErrorOk:(Q)=>{if(!OX.isNodeError(Q))return!1;let{code:X}=Q;if(X==="ENOSYS")return!0;if(!RR&&(X==="EINVAL"||X==="EPERM"))return!0;return!1},isNodeError:(Q)=>{return Q instanceof Error},isRetriableError:(Q)=>{if(!OX.isNodeError(Q))return!1;let{code:X}=Q;if(X==="EMFILE"||X==="ENFILE"||X==="EAGAIN"||X==="EBUSY"||X==="EACCESS"||X==="EACCES"||X==="EACCS"||X==="EPERM")return!0;return!1},onChangeError:(Q)=>{if(!OX.isNodeError(Q))throw Q;if(OX.isChangeErrorOk(Q))return;throw Q}},TV=OX;var jX={onError:TV.onChangeError},C6={onError:()=>{return}},RR=DR.getuid?!DR.getuid():!1,l1={isRetriable:TV.isRetriableError};var eX0={attempt:{chmod:b8(a1(b0.chmod),jX),chown:b8(a1(b0.chown),jX),close:b8(a1(b0.close),C6),fsync:b8(a1(b0.fsync),C6),mkdir:b8(a1(b0.mkdir),C6),realpath:b8(a1(b0.realpath),C6),stat:b8(a1(b0.stat),C6),unlink:b8(a1(b0.unlink),C6),chmodSync:U8(b0.chmodSync,jX),chownSync:U8(b0.chownSync,jX),closeSync:U8(b0.closeSync,C6),existsSync:U8(b0.existsSync,C6),fsyncSync:U8(b0.fsync,C6),mkdirSync:U8(b0.mkdirSync,C6),realpathSync:U8(b0.realpathSync,C6),statSync:U8(b0.statSync,C6),unlinkSync:U8(b0.unlinkSync,C6)},retry:{close:f8(a1(b0.close),l1),fsync:f8(a1(b0.fsync),l1),open:f8(a1(b0.open),l1),readFile:f8(a1(b0.readFile),l1),rename:f8(a1(b0.rename),l1),stat:f8(a1(b0.stat),l1),write:f8(a1(b0.write),l1),writeFile:f8(a1(b0.writeFile),l1),closeSync:g8(b0.closeSync,l1),fsyncSync:g8(b0.fsyncSync,l1),openSync:g8(b0.openSync,l1),readFileSync:g8(b0.readFileSync,l1),renameSync:g8(b0.renameSync,l1),statSync:g8(b0.statSync,l1),writeSync:g8(b0.writeSync,l1),writeFileSync:g8(b0.writeFileSync,l1)}},h1=eX0;import h5 from"node:process";var wR="utf8",AV=438,TR=511;var AR={},ER=h5.geteuid?h5.geteuid():-1,_R=h5.getegid?h5.getegid():-1;var SR=1000,vR=!!h5.getuid,Xt0=h5.getuid?!h5.getuid():!1,EV=128;var xR=(Q)=>{return Q instanceof Error&&"code"in Q};var _V=(Q)=>{return typeof Q==="string"},rq=(Q)=>{return Q===void 0};import XJ0 from"node:path";import o7 from"node:process";import kR from"node:process";var yR=kR.platform==="linux",sq=kR.platform==="win32";var SV=["SIGHUP","SIGINT","SIGTERM"];if(!sq)SV.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(yR)SV.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var hR=SV;class bR{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(Q)=>{if(this.exited)return;this.exited=!0;for(let X of this.callbacks)X();if(Q)if(sq&&(Q!=="SIGINT"&&Q!=="SIGTERM"&&Q!=="SIGKILL"))o7.kill(o7.pid,"SIGTERM");else o7.kill(o7.pid,Q)},this.hook=()=>{o7.once("exit",()=>this.exit());for(let Q of hR)try{o7.once(Q,()=>this.exit(Q))}catch{}},this.register=(Q)=>{return this.callbacks.add(Q),()=>{this.callbacks.delete(Q)}},this.hook()}}var fR=new bR;var QJ0=fR.register,gR=QJ0;var _6={store:{},create:(Q)=>{let X=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),J=Date.now().toString().slice(-10),Z="tmp-",q=`.tmp-${J}${X}`;return`${Q}${q}`},get:(Q,X,J=!0)=>{let Z=_6.truncate(X(Q));if(Z in _6.store)return _6.get(Q,X,J);return _6.store[Z]=J,[Z,()=>delete _6.store[Z]]},purge:(Q)=>{if(!_6.store[Q])return;delete _6.store[Q],h1.attempt.unlink(Q)},purgeSync:(Q)=>{if(!_6.store[Q])return;delete _6.store[Q],h1.attempt.unlinkSync(Q)},purgeSyncAll:()=>{for(let Q in _6.store)_6.purgeSync(Q)},truncate:(Q)=>{let X=XJ0.basename(Q);if(X.length<=EV)return Q;let J=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(X);if(!J)return Q;let Z=X.length-EV;return`${Q.slice(0,-X.length)}${J[1]}${J[2].slice(0,-Z)}${J[3]}`}};gR(_6.purgeSyncAll);var NX=_6;function vV(Q,X,J=AR){if(_V(J))return vV(Q,X,{encoding:J});let q={timeout:J.timeout??SR},Y=null,$=null,H=null;try{let K=h1.attempt.realpathSync(Q),V=!!K;Q=K||Q,[$,Y]=NX.get(Q,J.tmpCreate||NX.create,J.tmpPurge!==!1);let W=vR&&rq(J.chown),G=rq(J.mode);if(V&&(W||G)){let z=h1.attempt.statSync(Q);if(z){if(J={...J},W)J.chown={uid:z.uid,gid:z.gid};if(G)J.mode=z.mode}}if(!V){let z=JJ0.dirname(Q);h1.attempt.mkdirSync(z,{mode:TR,recursive:!0})}if(H=h1.retry.openSync(q)($,"w",J.mode||AV),J.tmpCreated)J.tmpCreated($);if(_V(X))h1.retry.writeSync(q)(H,X,0,J.encoding||wR);else if(!rq(X))h1.retry.writeSync(q)(H,X,0,X.length,0);if(J.fsync!==!1)if(J.fsyncWait!==!1)h1.retry.fsyncSync(q)(H);else h1.attempt.fsync(H);if(h1.retry.closeSync(q)(H),H=null,J.chown&&(J.chown.uid!==ER||J.chown.gid!==_R))h1.attempt.chownSync($,J.chown.uid,J.chown.gid);if(J.mode&&J.mode!==AV)h1.attempt.chmodSync($,J.mode);try{h1.retry.renameSync(q)($,Q)}catch(z){if(!xR(z))throw z;if(z.code!=="ENAMETOOLONG")throw z;h1.retry.renameSync(q)($,NX.truncate(Q))}Y(),$=null}finally{if(H)h1.attempt.closeSync(H);if($)NX.purge($)}}var V_=z1(yE(),1),G_=z1(Z_(),1);var QG0=(Q,X,J,Z)=>{if(J==="length"||J==="prototype")return;if(J==="arguments"||J==="caller")return;let q=Object.getOwnPropertyDescriptor(Q,J),Y=Object.getOwnPropertyDescriptor(X,J);if(!XG0(q,Y)&&Z)return;Object.defineProperty(Q,J,Y)},XG0=function(Q,X){return Q===void 0||Q.configurable||Q.writable===X.writable&&Q.enumerable===X.enumerable&&Q.configurable===X.configurable&&(Q.writable||Q.value===X.value)},JG0=(Q,X)=>{let J=Object.getPrototypeOf(X);if(J===Object.getPrototypeOf(Q))return;Object.setPrototypeOf(Q,J)},ZG0=(Q,X)=>`/* Wrapped ${Q}*/
|
|
51
51
|
${X}`,qG0=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),YG0=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),$G0=(Q,X,J)=>{let Z=J===""?"":`with ${J.trim()}() `,q=ZG0.bind(null,Z,X.toString());Object.defineProperty(q,"name",YG0);let{writable:Y,enumerable:$,configurable:H}=qG0;Object.defineProperty(Q,"toString",{value:q,writable:Y,enumerable:$,configurable:H})};function oG(Q,X,{ignoreNonConfigurable:J=!1}={}){let{name:Z}=Q;for(let q of Reflect.ownKeys(X))QG0(Q,X,q,J);return JG0(Q,X),$G0(Q,X,Z),Q}var HG0=(Q,X={})=>{if(typeof Q!=="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof Q}\``);let{wait:J=0,maxWait:Z=Number.POSITIVE_INFINITY,before:q=!1,after:Y=!0}=X;if(J<0||Z<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!q&&!Y)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let $,H,K,V=function(...W){let G=this,z=()=>{if($=void 0,H)clearTimeout(H),H=void 0;if(Y)K=Q.apply(G,W)},U=()=>{if(H=void 0,$)clearTimeout($),$=void 0;if(Y)K=Q.apply(G,W)},L=q&&!$;if(clearTimeout($),$=setTimeout(z,J),Z>0&&Z!==Number.POSITIVE_INFINITY&&!H)H=setTimeout(U,Z);if(L)K=Q.apply(G,W);return K};return oG(V,Q),V.cancel=()=>{if($)clearTimeout($),$=void 0;if(H)clearTimeout(H),H=void 0},V},rG=HG0;var n5=z1(CV(),1);var KG0=Object.prototype.toString;function Y_(Q,X,J){if(!Q)return!1;if(Q.constructor===X)return!0;return KG0.call(Q)===J}function $_(Q){return Y_(Q,Uint8Array,"[object Uint8Array]")}function WG0(Q){return Y_(Q,ArrayBuffer,"[object ArrayBuffer]")}function VG0(Q){return $_(Q)||WG0(Q)}function GG0(Q){if(!$_(Q))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof Q}\``)}function zG0(Q){if(!VG0(Q))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof Q}\``)}function sG(Q,X){if(Q.length===0)return new Uint8Array(0);X??=Q.reduce((q,Y)=>q+Y.length,0);let J=new Uint8Array(X),Z=0;for(let q of Q)GG0(q),J.set(q,Z),Z+=q.length;return J}var q_={utf8:new globalThis.TextDecoder("utf8")};function aG(Q,X="utf8"){return zG0(Q),q_[X]??=new globalThis.TextDecoder(X),q_[X].decode(Q)}function UG0(Q){if(typeof Q!=="string")throw new TypeError(`Expected \`string\`, got \`${typeof Q}\``)}var BG0=new globalThis.TextEncoder;function yY(Q){return UG0(Q),BG0.encode(Q)}var t01=Array.from({length:256},(Q,X)=>X.toString(16).padStart(2,"0"));var MG0=G_.default.default,W_="aes-256-cbc",V9=()=>Object.create(null),IG0=(Q)=>Q!==void 0&&Q!==null,PG0=(Q,X)=>{let J=new Set(["undefined","symbol","function"]),Z=typeof X;if(J.has(Z))throw new TypeError(`Setting a value of type \`${Z}\` for key \`${Q}\` is not allowed as it's not supported by JSON`)},hY="__internal__",tG=`${hY}.migrations.version`;class G9{path;events;#X;#Z;#J;#Q={};constructor(Q={}){let X={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...Q};if(!X.cwd){if(!X.projectName)throw new Error("Please specify the `projectName` option.");X.cwd=wV(X.projectName,{suffix:X.projectSuffix}).config}if(this.#J=X,X.schema??X.ajvOptions??X.rootSchema){if(X.schema&&typeof X.schema!=="object")throw new TypeError("The `schema` option must be an object.");let Y=new V_.Ajv2020({allErrors:!0,useDefaults:!0,...X.ajvOptions});MG0(Y);let $={...X.rootSchema,type:"object",properties:X.schema};this.#X=Y.compile($);for(let[H,K]of Object.entries(X.schema??{}))if(K?.default)this.#Q[H]=K.default}if(X.defaults)this.#Q={...this.#Q,...X.defaults};if(X.serialize)this._serialize=X.serialize;if(X.deserialize)this._deserialize=X.deserialize;this.events=new EventTarget,this.#Z=X.encryptionKey;let J=X.fileExtension?`.${X.fileExtension}`:"";this.path=K_.resolve(X.cwd,`${X.configName??"config"}${J}`);let Z=this.store,q=Object.assign(V9(),X.defaults,Z);if(X.migrations){if(!X.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(X.migrations,X.projectVersion,X.beforeEachMigration)}this._validate(q);try{FG0.deepEqual(Z,q)}catch{this.store=q}if(X.watch)this._watch()}get(Q,X){if(this.#J.accessPropertiesByDotNotation)return this._get(Q,X);let{store:J}=this;return Q in J?J[Q]:X}set(Q,X){if(typeof Q!=="string"&&typeof Q!=="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof Q}`);if(typeof Q!=="object"&&X===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(Q))throw new TypeError(`Please don't use the ${hY} key, as it's used to manage this module internal operations.`);let{store:J}=this,Z=(q,Y)=>{if(PG0(q,Y),this.#J.accessPropertiesByDotNotation)NV(J,q,Y);else J[q]=Y};if(typeof Q==="object"){let q=Q;for(let[Y,$]of Object.entries(q))Z(Y,$)}else Z(Q,X);this.store=J}has(Q){if(this.#J.accessPropertiesByDotNotation)return OR(this.store,Q);return Q in this.store}reset(...Q){for(let X of Q)if(IG0(this.#Q[X]))this.set(X,this.#Q[X])}delete(Q){let{store:X}=this;if(this.#J.accessPropertiesByDotNotation)CR(X,Q);else delete X[Q];this.store=X}clear(){this.store=V9();for(let Q of Object.keys(this.#Q))this.reset(Q)}onDidChange(Q,X){if(typeof Q!=="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof Q}`);if(typeof X!=="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof X}`);return this._handleChange(()=>this.get(Q),X)}onDidAnyChange(Q){if(typeof Q!=="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof Q}`);return this._handleChange(()=>this.store,Q)}get size(){return Object.keys(this.store).length}get store(){try{let Q=p5.readFileSync(this.path,this.#Z?null:"utf8"),X=this._encryptData(Q),J=this._deserialize(X);return this._validate(J),Object.assign(V9(),J)}catch(Q){if(Q?.code==="ENOENT")return this._ensureDirectory(),V9();if(this.#J.clearInvalidConfig&&Q.name==="SyntaxError")return V9();throw Q}}set store(Q){this._ensureDirectory(),this._validate(Q),this._write(Q),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[Q,X]of Object.entries(this.store))yield[Q,X]}_encryptData(Q){if(!this.#Z)return typeof Q==="string"?Q:aG(Q);try{let X=Q.slice(0,16),J=oX.pbkdf2Sync(this.#Z,X.toString(),1e4,32,"sha512"),Z=oX.createDecipheriv(W_,J,X),q=Q.slice(17),Y=typeof q==="string"?yY(q):q;return aG(sG([Z.update(Y),Z.final()]))}catch{}return Q.toString()}_handleChange(Q,X){let J=Q(),Z=()=>{let q=J,Y=Q();if(LG0(Y,q))return;J=Y,X.call(this,Y,q)};return this.events.addEventListener("change",Z),()=>{this.events.removeEventListener("change",Z)}}_deserialize=(Q)=>JSON.parse(Q);_serialize=(Q)=>JSON.stringify(Q,void 0,"\t");_validate(Q){if(!this.#X)return;if(this.#X(Q)||!this.#X.errors)return;let J=this.#X.errors.map(({instancePath:Z,message:q=""})=>`\`${Z.slice(1)}\` ${q}`);throw new Error("Config schema violation: "+J.join("; "))}_ensureDirectory(){p5.mkdirSync(K_.dirname(this.path),{recursive:!0})}_write(Q){let X=this._serialize(Q);if(this.#Z){let J=oX.randomBytes(16),Z=oX.pbkdf2Sync(this.#Z,J.toString(),1e4,32,"sha512"),q=oX.createCipheriv(W_,Z,J);X=sG([J,yY(":"),q.update(yY(X)),q.final()])}if(H_.env.SNAP)p5.writeFileSync(this.path,X,{mode:this.#J.configFileMode});else try{vV(this.path,X,{mode:this.#J.configFileMode})}catch(J){if(J?.code==="EXDEV"){p5.writeFileSync(this.path,X,{mode:this.#J.configFileMode});return}throw J}}_watch(){if(this._ensureDirectory(),!p5.existsSync(this.path))this._write(V9());if(H_.platform==="win32")p5.watch(this.path,{persistent:!1},rG(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else p5.watchFile(this.path,{persistent:!1},rG(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(Q,X,J){let Z=this._get(tG,"0.0.0"),q=Object.keys(Q).filter(($)=>this._shouldPerformMigration($,Z,X)),Y={...this.store};for(let $ of q)try{if(J)J(this,{fromVersion:Z,toVersion:$,finalVersion:X,versions:q});let H=Q[$];H?.(this),this._set(tG,$),Z=$,Y={...this.store}}catch(H){throw this.store=Y,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${H}`)}if(this._isVersionInRangeFormat(Z)||!n5.default.eq(Z,X))this._set(tG,X)}_containsReservedKey(Q){if(typeof Q==="object"){if(Object.keys(Q)[0]===hY)return!0}if(typeof Q!=="string")return!1;if(this.#J.accessPropertiesByDotNotation){if(Q.startsWith(`${hY}.`))return!0;return!1}return!1}_isVersionInRangeFormat(Q){return n5.default.clean(Q)===null}_shouldPerformMigration(Q,X,J){if(this._isVersionInRangeFormat(Q)){if(X!=="0.0.0"&&n5.default.satisfies(X,Q))return!1;return n5.default.satisfies(J,Q)}if(n5.default.lte(Q,X))return!1;if(n5.default.gt(Q,J))return!1;return!0}_get(Q,X){return PR(this.store,Q,X)}_set(Q,X){let{store:J}=this;NV(J,Q,X),this.store=J}}var i5=new G9({projectName:W6.cli.projectName,configName:"snapshots"});function eG(Q){return i5.get(`${Q}.step`,0)}function z_(Q){let X=eG(Q)+1;return i5.set(`${Q}.step`,X),X}function Qz(Q){return i5.get(`${Q}.baseCommit`,null)}function U_(Q,X){i5.set(`${Q}.baseCommit`,X)}function B_(Q){return i5.get(`${Q}.pendingTranscript`,null)}function L_(Q,X){i5.set(`${Q}.pendingTranscript`,X)}function Xz(Q){i5.delete(`${Q}.pendingTranscript`)}var qn=z1(qS(),1),Yn=z1($c(),1);import{existsSync as Ek0,mkdtempSync as _k0,readdirSync as Sk0,readFileSync as Zn,rmSync as vk0,statSync as xk0}from"node:fs";import{devNull as kk0,tmpdir as yk0}from"node:os";import{join as VZ}from"node:path";var d3=z1(Mc(),1);var c2=new WeakMap;function ZQ(...Q){let X=new String(Q);return c2.set(X,Q),X}function q8(Q){return Q instanceof String&&c2.has(Q)}function qQ(Q){return c2.get(Q)??[]}var u3=z1(m2(),1);import{spawn as $v0}from"child_process";var Sp=z1(p2(),1);import{normalize as Rx0}from"node:path";function*Cc(Q,X){let J=X==="global";for(let Z of Q)Z.isGlobal===J&&(yield Z)}var p_0=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),n_0=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),i_0=new Set(["edit","remove-section","rename-section","set","unset"]),o_0=new Set(["get","get-color","get-colorbool","list"]);function r_0(Q,X){for(let{name:Z}of Cc(Q,"task")){if(p_0.has(Z))return YQ(!0,X);if(n_0.has(Z))return YQ(!1,X)}let J=X.at(0)?.toLowerCase();return J===void 0?null:i_0.has(J)?YQ(!0,X.slice(1)):o_0.has(J)?YQ(!1,X.slice(1)):X.length===1?YQ(!1,X):YQ(!0,X)}function YQ(Q=!1,X=[]){let J=X.at(0)?.toLowerCase();return J===void 0?null:{isWrite:Q,isRead:!Q,key:J,value:X.at(1)}}function s_0(Q,X){return X.isWrite&&X.value!==void 0?{key:X.key,value:X.value,scope:Q}:{key:X.key,scope:Q}}function a_0(Q){let X=Q?.indexOf("=")||-1;return!Q||X<0?null:{key:Q.slice(0,X).trim().toLowerCase(),value:Q.slice(X+1)}}function t_0(Q){for(let{name:X}of Cc(Q,"task"))switch(X){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function e_0({name:Q}){if(Q==="-c"||Q==="--config")return"inline";if(Q==="--config-env")return"env"}function*QS0(Q){for(let X of Q){let J=e_0(X),Z=J&&a_0(X.value);Z&&(yield{...Z,scope:J})}}function XS0(Q,X,J){let Z={read:[],write:[...QS0(X)]};return Q==="config"&&JS0(Z,t_0(X),r_0(X,J)),Z}function JS0(Q,X,J){if(J===null)return;let Z=s_0(X,J);J.isWrite?Q.write.push(Z):Q.read.push(Z)}var Oc={short:new Map([["c",!0]])},ZS0={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...Oc.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},qS0={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},YS0={short:new Map,long:new Set};function $S0(Q){let X=qS0[Q??""]??YS0;return{short:new Map([...Oc.short.entries(),...X.short.entries()]),long:X.long}}function jc(Q,X=ZS0){if(Q.startsWith("--")){let J=Q.indexOf("=");if(J>2)return[{name:Q.slice(0,J),value:Q.slice(J+1),needsNext:!1}];let Z=Q.slice(2);return[{name:Q,needsNext:X.long.has(Z)}]}if(Q.length===2){let J=Q.charAt(1),Z=X.short.get(J);return[{name:Q,needsNext:Z===!0}]}return HS0(Q,X.short)}function HS0(Q,X){let J=Q.slice(1).split(""),Z=[];for(let q=0;q<J.length;q++){let Y=J[q],$=X.get(Y);if($===void 0)return[{name:Q,needsNext:!1}];if($){let H=J.slice(q+1).join("");if(H&&![...H].every((K)=>X.has(K)))return Z.push({name:`-${Y}`,value:H,needsNext:!1}),Z}Z.push({name:`-${Y}`,needsNext:$})}return Z}function KS0(Q,X=[]){let J=0;for(;J<Q.length;){let Z=String(Q[J]);if(!Z.startsWith("-")||Z.length<2)break;let q=jc(Z),Y=J+1;for(let $ of q){let H={name:$.name,value:$.value,absorbedNext:!1,isGlobal:!0};$.needsNext&&H.value===void 0&&Y<Q.length&&(H.value=String(Q[Y]),H.absorbedNext=!0,Y++),X.push(H)}J=Y}return{flags:X,taskIndex:J}}function WS0(Q,X,J=[]){let Z=$S0(X),q=[],Y=[],$=0;for(;$<Q.length;){let H=Q[$];if(q8(H)){Y.push(...qQ(H)),$++;continue}let K=String(H);if(K==="--"){for(let G=$+1;G<Q.length;G++){let z=Q[G];q8(z)?Y.push(...qQ(z)):Y.push(String(z))}break}if(!K.startsWith("-")||K.length<2){q.push(K),$++;continue}let V=jc(K,Z),W=$+1;for(let G of V){let z={name:G.name,value:G.value,absorbedNext:!1,isGlobal:!1};G.needsNext&&z.value===void 0&&W<Q.length&&!q8(Q[W])&&(z.value=String(Q[W]),z.absorbedNext=!0,W++),J.push(z)}$=W}return{flags:J,positionals:q,pathspecs:Y}}function*VS0({write:Q}){for(let X of Q)for(let J of GS0){let Z=J(X.key);Z&&(yield Z)}}function $8(Q,X,J=String(Q)){let Z=typeof Q=="string"?new RegExp(`\\s*${Q.toLowerCase()}`):Q;return function(q){if(Z.test(q))return{category:X,message:`Configuring ${J} is not permitted without enabling ${X}`}}}function Y8(Q,X){let J=new RegExp(`\\s*${Q.toLowerCase().replace(/\./g,"(..+)?.")}`);return $8(J,X,Q)}var GS0=[$8("alias","allowUnsafeAlias"),$8("core.askPass","allowUnsafeAskPass"),$8("core.editor","allowUnsafeEditor"),$8("core.fsmonitor","allowUnsafeFsMonitor"),$8("core.gitProxy","allowUnsafeGitProxy"),$8("core.hooksPath","allowUnsafeHooksPath"),$8("core.pager","allowUnsafePager"),$8("core.sshCommand","allowUnsafeSshCommand"),Y8("credential.helper","allowUnsafeCredentialHelper"),Y8("diff.command","allowUnsafeDiffExternal"),$8("diff.external","allowUnsafeDiffExternal"),Y8("diff.textconv","allowUnsafeDiffTextConv"),Y8("filter.clean","allowUnsafeFilter"),Y8("filter.smudge","allowUnsafeFilter"),Y8("gpg.program","allowUnsafeGpgProgram"),$8("init.templateDir","allowUnsafeTemplateDir"),Y8("merge.driver","allowUnsafeMergeDriver"),Y8("mergetool.path","allowUnsafeMergeDriver"),Y8("mergetool.cmd","allowUnsafeMergeDriver"),Y8("protocol.allow","allowUnsafeProtocolOverride"),Y8("remote.receivepack","allowUnsafePack"),Y8("remote.uploadpack","allowUnsafePack"),$8("sequence.editor","allowUnsafeEditor")];function*zS0(Q,X){for(let J of X)for(let Z of US0){let q=Z(Q,J.name);q&&(yield q)}}function XZ(Q,X,J,Z=String(X)){let q=typeof X=="string"?new RegExp(`\\s*${X.toLowerCase()}`):X,Y=`Use of ${Q?`${Q} with option `:""}${Z} is not permitted without enabling ${J}`;return function($,H){if((!Q||$===Q)&&q.test(H))return{category:J,message:Y}}}var US0=[XZ(null,/--(upload|receive)-pack/,"allowUnsafePack","--upload-pack or --receive-pack"),XZ("clone",/^-\w*u/,"allowUnsafePack"),XZ("clone","--u","allowUnsafePack"),XZ("push","--exec","allowUnsafePack"),XZ(null,"--template","allowUnsafeTemplateDir")];function Nc(Q,X,J){return[...zS0(Q,X),...VS0(J)]}function BS0(...Q){let{flags:X,taskIndex:J}=KS0(Q),Z=J<Q.length?String(Q[J]).toLowerCase():null,q=Z!==null?Q.slice(J+1):[],{positionals:Y,pathspecs:$}=WS0(q,Z,X),H=XS0(Z,X,Y);return{task:Z,flags:X.map(FS0),paths:$,config:H,vulnerabilities:LS0(Nc(Z,X,H))}}function LS0(Q){return Object.defineProperty(Q,"vulnerabilities",{value:Q})}function FS0({value:Q,name:X}){return Q!==void 0?{name:X,value:Q}:{name:X}}var Rc={editor:"allowUnsafeEditor",git_askpass:"allowUnsafeAskPass",git_config_global:"allowUnsafeConfigPaths",git_config_system:"allowUnsafeConfigPaths",git_config_count:"allowUnsafeConfigEnvCount",git_config:"allowUnsafeConfigPaths",git_editor:"allowUnsafeEditor",git_exec_path:"allowUnsafeConfigPaths",git_external_diff:"allowUnsafeDiffExternal",git_pager:"allowUnsafePager",git_proxy_command:"allowUnsafeGitProxy",git_template_dir:"allowUnsafeTemplateDir",git_sequence_editor:"allowUnsafeEditor",git_ssh:"allowUnsafeSshCommand",git_ssh_command:"allowUnsafeSshCommand",pager:"allowUnsafePager",prefix:"allowUnsafeConfigPaths",ssh_askpass:"allowUnsafeAskPass"};function*MS0(Q){let X=parseInt(Q.git_config_count??"0",10);for(let J=0;J<X;J++){let Z=Q[`git_config_key_${J}`],q=Q[`git_config_value_${J}`];Z!==void 0&&(yield{key:Z.toLowerCase().trim(),value:q,scope:"env"})}}function*IS0(Q){for(let X of Object.keys(Q))if(Dc(X)){let J=Rc[X];yield{category:J,message:`Use of "${X.toUpperCase()}" is not permitted without enabling ${J}`}}}function Dc(Q){return Object.hasOwn(Rc,Q)}function PS0(Q){let X={};for(let[J,Z]of Object.entries(Q)){let q=J.toLowerCase().trim();(Dc(q)||q.startsWith("git"))&&(X[q]=String(Z))}return X}function CS0(Q){let X=PS0(Q),J={read:[],write:[...MS0(X)]},Z=[...IS0(X),...Nc(null,[],J)];return{config:J,vulnerabilities:Z}}function wc(Q,X){return[...BS0(...Q).vulnerabilities,...CS0(X).vulnerabilities]}var $Q=z1(p2(),1);import{EventEmitter as Ck0}from"node:events";var{defineProperty:zL,getOwnPropertyDescriptor:OS0,getOwnPropertyNames:UL}=Object,jS0=Object.prototype.hasOwnProperty,i=(Q,X)=>function J(){return Q&&(X=(0,Q[UL(Q)[0]])(Q=0)),X},NS0=(Q,X)=>function J(){return X||(0,Q[UL(Q)[0]])((X={exports:{}}).exports,X),X.exports},D1=(Q,X)=>{for(var J in X)zL(Q,J,{get:X[J],enumerable:!0})},RS0=(Q,X,J,Z)=>{if(X&&typeof X==="object"||typeof X==="function"){for(let q of UL(X))if(!jS0.call(Q,q)&&q!==J)zL(Q,q,{get:()=>X[q],enumerable:!(Z=OS0(X,q))||Z.enumerable})}return Q},I1=(Q)=>RS0(zL({},"__esModule",{value:!0}),Q),A4,L5=i({"src/lib/errors/git-error.ts"(){A4=class extends Error{constructor(Q,X){super(X);this.task=Q,Object.setPrototypeOf(this,new.target.prototype)}}}}),YZ,WQ=i({"src/lib/errors/git-response-error.ts"(){L5(),YZ=class extends A4{constructor(Q,X){super(void 0,X||String(Q));this.git=Q}}}}),ql,Yl=i({"src/lib/errors/task-configuration-error.ts"(){L5(),ql=class extends A4{constructor(Q){super(void 0,Q)}}}});function $l(Q){if(typeof Q!=="function")return j7;return Q}function Hl(Q){return typeof Q==="function"&&Q!==j7}function Kl(Q,X){let J=Q.indexOf(X);if(J<=0)return[Q,""];return[Q.substr(0,J),Q.substr(J+1)]}function Wl(Q,X=0){return Vl(Q)&&Q.length>X?Q[X]:void 0}function O7(Q,X=0){if(Vl(Q)&&Q.length>X)return Q[Q.length-1-X]}function Vl(Q){return n3(Q)}function $Z(Q="",X=!0,J=`
|
|
52
52
|
`){return Q.split(J).reduce((Z,q)=>{let Y=X?q.trim():q;if(Y)Z.push(Y);return Z},[])}function BL(Q,X){return $Z(Q,!0).map((J)=>X(J))}function LL(Q){return d3.exists(Q,d3.FOLDER)}function H8(Q,X){if(Array.isArray(Q)){if(!Q.includes(X))Q.push(X)}else Q.add(X);return X}function Gl(Q,X){if(Array.isArray(Q)&&!Q.includes(X))Q.push(X);return Q}function c3(Q,X){if(Array.isArray(Q)){let J=Q.indexOf(X);if(J>=0)Q.splice(J,1)}else Q.delete(X);return X}function Q4(Q){return Array.isArray(Q)?Q:[Q]}function zl(Q){return Q.replace(/[\s-]+(.)/g,(X,J)=>{return J.toUpperCase()})}function VQ(Q){return Q4(Q).map((X)=>{return X instanceof String?X:String(X)})}function a0(Q,X=0){if(Q==null)return X;let J=parseInt(Q,10);return Number.isNaN(J)?X:J}function ZZ(Q,X){let J=[];for(let Z=0,q=Q.length;Z<q;Z++)J.push(X,Q[Z]);return J}function qZ(Q){return(Array.isArray(Q)?Buffer.concat(Q):Q).toString("utf-8")}function Ul(Q,X){let J={};return X.forEach((Z)=>{if(Q[Z]!==void 0)J[Z]=Q[Z]}),J}function t2(Q=0){return new Promise((X)=>setTimeout(X,Q))}function e2(Q){if(Q===!1)return;return Q}var HQ,j7,HZ,l3=i({"src/lib/utils/util.ts"(){FL(),HQ="\x00",j7=()=>{},HZ=Object.prototype.toString.call.bind(Object.prototype.toString)}});function q6(Q,X,J){if(X(Q))return Q;return arguments.length>2?J:void 0}function QL(Q,X){let J=q8(Q)?"string":typeof Q;return/number|string|boolean/.test(J)&&(!X||!X.includes(J))}function p3(Q){return!!Q&&HZ(Q)==="[object Object]"}function Bl(Q){return typeof Q==="function"}var KZ,Ll,B1,f3,n3,FL=i({"src/lib/utils/argument-filters.ts"(){l3(),KZ=(Q)=>{return Array.isArray(Q)},Ll=(Q)=>{return typeof Q==="number"},B1=(Q)=>{return typeof Q==="string"||q8(Q)},f3=(Q)=>{return B1(Q)||Array.isArray(Q)&&Q.every(B1)},n3=(Q)=>{if(Q==null||"number|boolean|function".includes(typeof Q))return!1;return typeof Q.length==="number"}}}),XL,DS0=i({"src/lib/utils/exit-codes.ts"(){XL=((Q)=>{return Q[Q.SUCCESS=0]="SUCCESS",Q[Q.ERROR=1]="ERROR",Q[Q.NOT_FOUND=-2]="NOT_FOUND",Q[Q.UNCLEAN=128]="UNCLEAN",Q})(XL||{})}}),g3,wS0=i({"src/lib/utils/git-output-streams.ts"(){g3=class Q{constructor(X,J){this.stdOut=X,this.stdErr=J}asStrings(){return new Q(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function TS0(){throw new Error("LineParser:useMatches not implemented")}var C0,B5,AS0=i({"src/lib/utils/line-parser.ts"(){C0=class{constructor(Q,X){if(this.matches=[],this.useMatches=TS0,this.parse=(J,Z)=>{if(this.resetMatches(),!this._regExp.every((q,Y)=>this.addMatch(q,Y,J(Y))))return!1;return this.useMatches(Z,this.prepareMatches())!==!1},this._regExp=Array.isArray(Q)?Q:[Q],X)this.useMatches=X}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(Q,X,J){let Z=J&&Q.exec(J);if(Z)this.pushMatch(X,Z);return!!Z}pushMatch(Q,X){this.matches.push(...X.slice(1))}},B5=class extends C0{addMatch(Q,X,J){return/^remote:\s/.test(String(J))&&super.addMatch(Q,X,J)}pushMatch(Q,X){if(Q>0||X.length>1)super.pushMatch(Q,X)}}}});function Fl(...Q){let X=process.cwd(),J=Object.assign({baseDir:X,...Ml},...Q.filter((Z)=>typeof Z==="object"&&Z));return J.baseDir=J.baseDir||X,J.trimmed=J.trimmed===!0,J}var Ml,ES0=i({"src/lib/utils/simple-git-options.ts"(){Ml={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function ML(Q,X=[]){if(!p3(Q))return X;return Object.keys(Q).reduce((J,Z)=>{let q=Q[Z];if(q8(q))J.push(q);else if(QL(q,["boolean"]))J.push(Z+"="+q);else if(Array.isArray(q)){for(let Y of q)if(!QL(Y,["string","number"]))J.push(Z+"="+Y)}else J.push(Z);return J},X)}function M6(Q,X=0,J=!1){let Z=[];for(let q=0,Y=X<0?Q.length:X;q<Y;q++)if("string|number".includes(typeof Q[q]))Z.push(String(Q[q]));if(ML(IL(Q),Z),!J)Z.push(..._S0(Q));return Z}function _S0(Q){let X=typeof O7(Q)==="function";return VQ(q6(O7(Q,X?1:0),KZ,[]))}function IL(Q){let X=Bl(O7(Q));return q6(O7(Q,X?1:0),p3)}function $1(Q,X=!0){let J=$l(O7(Q));return X||Hl(J)?J:void 0}var SS0=i({"src/lib/utils/task-options.ts"(){FL(),l3()}});function JL(Q,X){return Q(X.stdOut,X.stdErr)}function E6(Q,X,J,Z=!0){return Q4(J).forEach((q)=>{for(let Y=$Z(q,Z),$=0,H=Y.length;$<H;$++){let K=(V=0)=>{if($+V>=H)return;return Y[$+V]};X.some(({parse:V})=>V(K,Q))}}),Q}var vS0=i({"src/lib/utils/task-parser.ts"(){l3()}}),Il={};D1(Il,{ExitCodes:()=>XL,GitOutputStreams:()=>g3,LineParser:()=>C0,NOOP:()=>j7,NULL:()=>HQ,RemoteLineParser:()=>B5,append:()=>H8,appendTaskOptions:()=>ML,asArray:()=>Q4,asCamelCase:()=>zl,asFunction:()=>$l,asNumber:()=>a0,asStringArray:()=>VQ,bufferToString:()=>qZ,callTaskParser:()=>JL,createInstanceConfig:()=>Fl,delay:()=>t2,filterArray:()=>KZ,filterFunction:()=>Bl,filterHasLength:()=>n3,filterNumber:()=>Ll,filterPlainObject:()=>p3,filterPrimitives:()=>QL,filterString:()=>B1,filterStringOrStringArray:()=>f3,filterType:()=>q6,first:()=>Wl,folderExists:()=>LL,forEachLineWithContent:()=>BL,getTrailingOptions:()=>M6,including:()=>Gl,isUserFunction:()=>Hl,last:()=>O7,objectToString:()=>HZ,orVoid:()=>e2,parseStringResponse:()=>E6,pick:()=>Ul,prefixedArray:()=>ZZ,remove:()=>c3,splitOn:()=>Kl,toLinesWithContent:()=>$Z,trailingFunctionArgument:()=>$1,trailingOptionsArgument:()=>IL});var F0=i({"src/lib/utils/index.ts"(){FL(),DS0(),wS0(),AS0(),ES0(),SS0(),vS0(),l3()}}),Pl={};D1(Pl,{CheckRepoActions:()=>ZL,checkIsBareRepoTask:()=>Ol,checkIsRepoRootTask:()=>Cl,checkIsRepoTask:()=>xS0});function xS0(Q){switch(Q){case"bare":return Ol();case"root":return Cl()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:i3,parser:PL}}function Cl(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:i3,parser(X){return/^\.(git)?$/.test(X.trim())}}}function Ol(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:i3,parser:PL}}function kS0(Q){return/(Not a git repository|Kein Git-Repository)/i.test(String(Q))}var ZL,i3,PL,jl=i({"src/lib/tasks/check-is-repo.ts"(){F0(),ZL=((Q)=>{return Q.BARE="bare",Q.IN_TREE="tree",Q.IS_REPO_ROOT="root",Q})(ZL||{}),i3=({exitCode:Q},X,J,Z)=>{if(Q===128&&kS0(X))return J(Buffer.from("false"));Z(X)},PL=(Q)=>{return Q.trim()==="true"}}});function yS0(Q,X){let J=new Nl(Q),Z=Q?Dl:Rl;return $Z(X).forEach((q)=>{let Y=q.replace(Z,"");J.paths.push(Y),(wl.test(Y)?J.folders:J.files).push(Y)}),J}var Nl,Rl,Dl,wl,hS0=i({"src/lib/responses/CleanSummary.ts"(){F0(),Nl=class{constructor(Q){this.dryRun=Q,this.paths=[],this.files=[],this.folders=[]}},Rl=/^[a-z]+\s*/i,Dl=/^[a-z]+\s+[a-z]+\s*/i,wl=/\/$/}}),qL={};D1(qL,{EMPTY_COMMANDS:()=>o3,adhocExecTask:()=>Tl,configurationErrorTask:()=>A6,isBufferTask:()=>El,isEmptyTask:()=>_l,straightThroughBufferTask:()=>Al,straightThroughStringTask:()=>I6});function Tl(Q){return{commands:o3,format:"empty",parser:Q}}function A6(Q){return{commands:o3,format:"empty",parser(){throw typeof Q==="string"?new ql(Q):Q}}}function I6(Q,X=!1){return{commands:Q,format:"utf-8",parser(J){return X?String(J).trim():J}}}function Al(Q){return{commands:Q,format:"buffer",parser(X){return X}}}function El(Q){return Q.format==="buffer"}function _l(Q){return Q.format==="empty"||!Q.commands.length}var o3,P1=i({"src/lib/tasks/task.ts"(){Yl(),o3=[]}}),Sl={};D1(Sl,{CONFIG_ERROR_INTERACTIVE_MODE:()=>CL,CONFIG_ERROR_MODE_REQUIRED:()=>OL,CONFIG_ERROR_UNKNOWN_OPTION:()=>jL,CleanOptions:()=>k3,cleanTask:()=>vl,cleanWithOptionsTask:()=>bS0,isCleanOptionsArray:()=>fS0});function bS0(Q,X){let{cleanMode:J,options:Z,valid:q}=gS0(Q);if(!J)return A6(OL);if(!q.options)return A6(jL+JSON.stringify(Q));if(Z.push(...X),Z.some(dS0))return A6(CL);return vl(J,Z)}function vl(Q,X){return{commands:["clean",`-${Q}`,...X],format:"utf-8",parser(Z){return yS0(Q==="n",Z)}}}function fS0(Q){return Array.isArray(Q)&&Q.every((X)=>NL.has(X))}function gS0(Q){let X,J=[],Z={cleanMode:!1,options:!0};return Q.replace(/[^a-z]i/g,"").split("").forEach((q)=>{if(uS0(q))X=q,Z.cleanMode=!0;else Z.options=Z.options&&mS0(J[J.length]=`-${q}`)}),{cleanMode:X,options:J,valid:Z}}function uS0(Q){return Q==="f"||Q==="n"}function mS0(Q){return/^-[a-z]$/i.test(Q)&&NL.has(Q.charAt(1))}function dS0(Q){if(/^-[^\-]/.test(Q))return Q.indexOf("i")>0;return Q==="--interactive"}var CL,OL,jL,k3,NL,xl=i({"src/lib/tasks/clean.ts"(){hS0(),F0(),P1(),CL="Git clean interactive mode is not supported",OL='Git clean mode parameter ("n" or "f") is required',jL="Git clean unknown option found in: ",k3=((Q)=>{return Q.DRY_RUN="n",Q.FORCE="f",Q.IGNORED_INCLUDED="x",Q.IGNORED_ONLY="X",Q.EXCLUDING="e",Q.QUIET="q",Q.RECURSIVE="d",Q})(k3||{}),NL=new Set(["i",...VQ(Object.values(k3))])}});function cS0(Q){let X=new yl;for(let J of kl(Q))X.addValue(J.file,String(J.key),J.value);return X}function lS0(Q,X){let J=null,Z=[],q=new Map;for(let Y of kl(Q,X)){if(Y.key!==X)continue;if(Z.push(J=Y.value),!q.has(Y.file))q.set(Y.file,[]);q.get(Y.file).push(J)}return{key:X,paths:Array.from(q.keys()),scopes:q,value:J,values:Z}}function pS0(Q){return Q.replace(/^(file):/,"")}function*kl(Q,X=null){let J=Q.split("\x00");for(let Z=0,q=J.length-1;Z<q;){let Y=pS0(J[Z++]),$=J[Z++],H=X;if($.includes(`
|
|
53
53
|
`)){let K=Kl($,`
|