@capgo/cli 8.59.0 → 8.61.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.
@@ -86,7 +86,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
86
86
  `)}),$.__defineSetter__("stack",function(U){return[U].concat($.stack).join(`
87
87
 
88
88
  `)}),$}});var BE=S((_VD,VE)=>{var Q6=e("constants"),Kp=process.cwd,Z7=null,wp=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!Z7)Z7=Kp.call(process);return Z7};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(V7=process.chdir,process.chdir=function(D){Z7=null,V7.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,V7)}var V7;VE.exports=Hp;function Hp(D){if(Q6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)U(D);if(D.chown=Q(D.chown),D.fchown=Q(D.fchown),D.lchown=Q(D.lchown),D.chmod=X(D.chmod),D.fchmod=X(D.fchmod),D.lchmod=X(D.lchmod),D.chownSync=Y(D.chownSync),D.fchownSync=Y(D.fchownSync),D.lchownSync=Y(D.lchownSync),D.chmodSync=F(D.chmodSync),D.fchmodSync=F(D.fchmodSync),D.lchmodSync=F(D.lchmodSync),D.stat=J(D.stat),D.fstat=J(D.fstat),D.lstat=J(D.lstat),D.statSync=q(D.statSync),D.fstatSync=q(D.fstatSync),D.lstatSync=q(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(W,I,G){if(G)process.nextTick(G)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(W,I,G,V){if(V)process.nextTick(V)},D.lchownSync=function(){};if(wp==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(W){function I(G,V,Z){var K=Date.now(),B=0;W(G,V,function L(O){if(O&&(O.code==="EACCES"||O.code==="EPERM"||O.code==="EBUSY")&&Date.now()-K<60000){if(setTimeout(function(){D.stat(V,function(w,N){if(w&&w.code==="ENOENT")W(G,V,L);else Z(O)})},B),B<100)B+=10;return}if(Z)Z(O)})}if(Object.setPrototypeOf)Object.setPrototypeOf(I,W);return I}(D.rename);D.read=typeof D.read!=="function"?D.read:function(W){function I(G,V,Z,K,B,L){var O;if(L&&typeof L==="function"){var w=0;O=function(N,R,j){if(N&&N.code==="EAGAIN"&&w<10)return w++,W.call(D,G,V,Z,K,B,O);L.apply(this,arguments)}}return W.call(D,G,V,Z,K,B,O)}if(Object.setPrototypeOf)Object.setPrototypeOf(I,W);return I}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(W){return function(I,G,V,Z,K){var B=0;while(!0)try{return W.call(D,I,G,V,Z,K)}catch(L){if(L.code==="EAGAIN"&&B<10){B++;continue}throw L}}}(D.readSync);function $(W){W.lchmod=function(I,G,V){W.open(I,Q6.O_WRONLY|Q6.O_SYMLINK,G,function(Z,K){if(Z){if(V)V(Z);return}W.fchmod(K,G,function(B){W.close(K,function(L){if(V)V(B||L)})})})},W.lchmodSync=function(I,G){var V=W.openSync(I,Q6.O_WRONLY|Q6.O_SYMLINK,G),Z=!0,K;try{K=W.fchmodSync(V,G),Z=!1}finally{if(Z)try{W.closeSync(V)}catch(B){}else W.closeSync(V)}return K}}function U(W){if(Q6.hasOwnProperty("O_SYMLINK")&&W.futimes)W.lutimes=function(I,G,V,Z){W.open(I,Q6.O_SYMLINK,function(K,B){if(K){if(Z)Z(K);return}W.futimes(B,G,V,function(L){W.close(B,function(O){if(Z)Z(L||O)})})})},W.lutimesSync=function(I,G,V){var Z=W.openSync(I,Q6.O_SYMLINK),K,B=!0;try{K=W.futimesSync(Z,G,V),B=!1}finally{if(B)try{W.closeSync(Z)}catch(L){}else W.closeSync(Z)}return K};else if(W.futimes)W.lutimes=function(I,G,V,Z){if(Z)process.nextTick(Z)},W.lutimesSync=function(){}}function X(W){if(!W)return W;return function(I,G,V){return W.call(D,I,G,function(Z){if(z(Z))Z=null;if(V)V.apply(this,arguments)})}}function F(W){if(!W)return W;return function(I,G){try{return W.call(D,I,G)}catch(V){if(!z(V))throw V}}}function Q(W){if(!W)return W;return function(I,G,V,Z){return W.call(D,I,G,V,function(K){if(z(K))K=null;if(Z)Z.apply(this,arguments)})}}function Y(W){if(!W)return W;return function(I,G,V){try{return W.call(D,I,G,V)}catch(Z){if(!z(Z))throw Z}}}function J(W){if(!W)return W;return function(I,G,V){if(typeof G==="function")V=G,G=null;function Z(K,B){if(B){if(B.uid<0)B.uid+=4294967296;if(B.gid<0)B.gid+=4294967296}if(V)V.apply(this,arguments)}return G?W.call(D,I,G,Z):W.call(D,I,Z)}}function q(W){if(!W)return W;return function(I,G){var V=G?W.call(D,I,G):W.call(D,I);if(V){if(V.uid<0)V.uid+=4294967296;if(V.gid<0)V.gid+=4294967296}return V}}function z(W){if(!W)return!0;if(W.code==="ENOSYS")return!0;var I=!process.getuid||process.getuid()!==0;if(I){if(W.code==="EINVAL"||W.code==="EPERM")return!0}return!1}}});var HE=S((kVD,wE)=>{var KE=e("stream").Stream;wE.exports=Lp;function Lp(D){return{ReadStream:$,WriteStream:U};function $(X,F){if(!(this instanceof $))return new $(X,F);KE.call(this);var Q=this;this.path=X,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,F=F||{};var Y=Object.keys(F);for(var J=0,q=Y.length;J<q;J++){var z=Y[J];this[z]=F[z]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){Q._read()});return}D.open(this.path,this.flags,this.mode,function(W,I){if(W){Q.emit("error",W),Q.readable=!1;return}Q.fd=I,Q.emit("open",I),Q._read()})}function U(X,F){if(!(this instanceof U))return new U(X,F);KE.call(this),this.path=X,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,F=F||{};var Q=Object.keys(F);for(var Y=0,J=Q.length;Y<J;Y++){var q=Q[Y];this[q]=F[q]}if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}if(this.busy=!1,this._queue=[],this.fd===null)this._open=D.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush()}}});var OE=S((gVD,LE)=>{LE.exports=Np;var Op=Object.getPrototypeOf||function(D){return D.__proto__};function Np(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:Op(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(U){Object.defineProperty($,U,Object.getOwnPropertyDescriptor(D,U))}),$}});var Y6=S((fVD,fY)=>{var hD=e("fs"),Mp=BE(),Ep=HE(),Ap=OE(),B7=e("util"),Q0,w7;if(typeof Symbol==="function"&&typeof Symbol.for==="function")Q0=Symbol.for("graceful-fs.queue"),w7=Symbol.for("graceful-fs.previous");else Q0="___graceful-fs.queue",w7="___graceful-fs.previous";function Rp(){}function ME(D,$){Object.defineProperty(D,Q0,{get:function(){return $}})}var J1=Rp;if(B7.debuglog)J1=B7.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))J1=function(){var D=B7.format.apply(B7,arguments);D="GFS4: "+D.split(/\n/).join(`
89
- GFS4: `),console.error(D)};if(!hD[Q0]){if(_Y=global[Q0]||[],ME(hD,_Y),hD.close=function(D){function $(U,X){return D.call(hD,U,function(F){if(!F)NE();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty($,w7,{value:D}),$}(hD.close),hD.closeSync=function(D){function $(U){D.apply(hD,arguments),NE()}return Object.defineProperty($,w7,{value:D}),$}(hD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){J1(hD[Q0]),e("assert").equal(hD[Q0].length,0)})}var _Y;if(!global[Q0])ME(global,hD[Q0]);fY.exports=kY(Ap(hD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!hD.__patched)fY.exports=kY(hD),hD.__patched=!0;function kY(D){Mp(D),D.gracefulify=kY,D.createReadStream=R,D.createWriteStream=j;var $=D.readFile;D.readFile=U;function U(u,E,P){if(typeof E==="function")P=E,E=null;return h(u,E,P);function h(d,v,x,A){return $(d,v,function(H){if(H&&(H.code==="EMFILE"||H.code==="ENFILE"))x4([h,[d,v,x],H,A||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var X=D.writeFile;D.writeFile=F;function F(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return X(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=Y;function Y(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return Q(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=q;function q(u,E,P,h){if(typeof P==="function")h=P,P=0;return d(u,E,P,h);function d(v,x,A,H,M){return J(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var z=D.readdir;D.readdir=I;var W=/^v[0-5]\./;function I(u,E,P){if(typeof E==="function")P=E,E=null;var h=W.test(process.version)?function(x,A,H,M){return z(x,d(x,A,H,M))}:function(x,A,H,M){return z(x,A,d(x,A,H,M))};return h(u,E,P);function d(v,x,A,H){return function(M,b){if(M&&(M.code==="EMFILE"||M.code==="ENFILE"))x4([h,[v,x,A],M,H||Date.now(),Date.now()]);else{if(b&&b.sort)b.sort();if(typeof A==="function")A.call(this,M,b)}}}}if(process.version.substr(0,4)==="v0.8"){var G=Ep(D);L=G.ReadStream,w=G.WriteStream}var V=D.ReadStream;if(V)L.prototype=Object.create(V.prototype),L.prototype.open=O;var Z=D.WriteStream;if(Z)w.prototype=Object.create(Z.prototype),w.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return L},set:function(u){L=u},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return w},set:function(u){w=u},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(u){K=u},enumerable:!0,configurable:!0});var B=w;Object.defineProperty(D,"FileWriteStream",{get:function(){return B},set:function(u){B=u},enumerable:!0,configurable:!0});function L(u,E){if(this instanceof L)return V.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function O(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E){if(u.autoClose)u.destroy();u.emit("error",E)}else u.fd=P,u.emit("open",P),u.read()})}function w(u,E){if(this instanceof w)return Z.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function N(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E)u.destroy(),u.emit("error",E);else u.fd=P,u.emit("open",P)})}function R(u,E){return new D.ReadStream(u,E)}function j(u,E){return new D.WriteStream(u,E)}var C=D.open;D.open=T;function T(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return C(v,x,A,function(b,m){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}return D}function x4(D){J1("ENQUEUE",D[0].name,D[1]),hD[Q0].push(D),gY()}var K7;function NE(){var D=Date.now();for(var $=0;$<hD[Q0].length;++$)if(hD[Q0][$].length>2)hD[Q0][$][3]=D,hD[Q0][$][4]=D;gY()}function gY(){if(clearTimeout(K7),K7=void 0,hD[Q0].length===0)return;var D=hD[Q0].shift(),$=D[0],U=D[1],X=D[2],F=D[3],Q=D[4];if(F===void 0)J1("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-F>=60000){J1("TIMEOUT",$.name,U);var Y=U.pop();if(typeof Y==="function")Y.call(null,X)}else{var J=Date.now()-Q,q=Math.max(Q-F,1),z=Math.min(q*1.2,100);if(J>=z)J1("RETRY",$.name,U),$.apply(null,U.concat([F]));else hD[Q0].push(D)}if(K7===void 0)K7=setTimeout(gY,0)}});var AE=S((yVD,EE)=>{function r0(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}EE.exports=r0;r0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};r0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};r0.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var X=this,F=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},U);if(this._options.unref)F.unref();return!0};r0.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};r0.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};r0.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};r0.prototype.start=r0.prototype.try;r0.prototype.errors=function(){return this._errors};r0.prototype.attempts=function(){return this._attempts};r0.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var X=0;X<this._errors.length;X++){var F=this._errors[X],Q=F.message,Y=(D[Q]||0)+1;if(D[Q]=Y,Y>=U)$=F,U=Y}return $}});var jE=S((Sp)=>{var jp=AE();Sp.operation=function(D){var $=Sp.timeouts(D);return new jp($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};Sp.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var F=0;F<$.retries;F++)X.push(this.createTimeout(F,$));if(D&&D.forever&&!X.length)X.push(this.createTimeout(F,$));return X.sort(function(Q,Y){return Q-Y}),X};Sp.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,X=Math.round(U*$.minTimeout*Math.pow($.factor,D));return X=Math.min(X,$.maxTimeout),X};Sp.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var X in D)if(typeof D[X]==="function")U.push(X)}for(var F=0;F<U.length;F++){var Q=U[F],Y=D[Q];D[Q]=function(q){var z=Sp.operation($),W=Array.prototype.slice.call(arguments,1),I=W.pop();W.push(function(G){if(z.retry(G))return;if(G)arguments[0]=z.mainError();I.apply(this,arguments)}),z.attempt(function(){q.apply(D,W)})}.bind(D,Y),D[Q].options=$}}});var SE=S((hVD,H7)=>{H7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")H7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")H7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var lY=S((dVD,k4)=>{var fD=global.process,q1=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!q1(fD))k4.exports=function(){return function(){}};else{if(yY=e("assert"),z1=SE(),mY=/^win/i.test(fD.platform),_4=e("events"),typeof _4!=="function")_4=_4.EventEmitter;if(fD.__signal_exit_emitter__)eD=fD.__signal_exit_emitter__;else eD=fD.__signal_exit_emitter__=new _4,eD.count=0,eD.emitted={};if(!eD.infinite)eD.setMaxListeners(1/0),eD.infinite=!0;k4.exports=function(D,$){if(!q1(global.process))return function(){};if(yY.equal(typeof D,"function","a callback must be provided for exit handler"),W1===!1)L7();var U="exit";if($&&$.alwaysLast)U="afterexit";var X=function(){if(eD.removeListener(U,D),eD.listeners("exit").length===0&&eD.listeners("afterexit").length===0)$3()};return eD.on(U,D),X},$3=function(){if(!W1||!q1(global.process))return;W1=!1,z1.forEach(function($){try{fD.removeListener($,U3[$])}catch(U){}}),fD.emit=F3,fD.reallyExit=O7,eD.count-=1},k4.exports.unload=$3,J6=function($,U,X){if(eD.emitted[$])return;eD.emitted[$]=!0,eD.emit($,U,X)},U3={},z1.forEach(function(D){U3[D]=function(){if(!q1(global.process))return;var U=fD.listeners(D);if(U.length===eD.count){if($3(),J6("exit",null,D),J6("afterexit",null,D),mY&&D==="SIGHUP")D="SIGINT";fD.kill(fD.pid,D)}}}),k4.exports.signals=function(){return z1},W1=!1,L7=function(){if(W1||!q1(global.process))return;W1=!0,eD.count+=1,z1=z1.filter(function($){try{return fD.on($,U3[$]),!0}catch(U){return!1}}),fD.emit=dY,fD.reallyExit=hY},k4.exports.load=L7,O7=fD.reallyExit,hY=function($){if(!q1(global.process))return;fD.exitCode=$||0,J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),O7.call(fD,fD.exitCode)},F3=fD.emit,dY=function($,U){if($==="exit"&&q1(global.process)){if(U!==void 0)fD.exitCode=U;var X=F3.apply(this,arguments);return J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),X}else return F3.apply(this,arguments)}}var yY,z1,mY,_4,eD,$3,J6,U3,W1,L7,O7,hY,F3,dY});var PE=S((up,cY)=>{var TE=Symbol();function vp(D,$,U){let X=$[TE];if(X)return $.stat(D,(Q,Y)=>{if(Q)return U(Q);U(null,Y.mtime,X)});let F=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,F,F,(Q)=>{if(Q)return U(Q);$.stat(D,(Y,J)=>{if(Y)return U(Y);let q=J.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,TE,{value:q}),U(null,J.mtime,q)})})}function bp(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}up.probe=vp;up.getMtime=bp});var xE=S((dp,Q3)=>{var kp=e("path"),pY=Y6(),gp=jE(),fp=lY(),CE=PE(),g$={};function X3(D,$){return $.lockfilePath||`${D}.lock`}function rY(D,$,U){if(!$.realpath)return U(null,kp.resolve(D));$.fs.realpath(D,U)}function iY(D,$,U){let X=X3(D,$);$.fs.mkdir(X,(F)=>{if(!F)return CE.probe(X,$.fs,(Q,Y,J)=>{if(Q)return $.fs.rmdir(X,()=>{}),U(Q);U(null,Y,J)});if(F.code!=="EEXIST")return U(F);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(X,(Q,Y)=>{if(Q){if(Q.code==="ENOENT")return iY(D,{...$,stale:0},U);return U(Q)}if(!vE(Y,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));bE(D,$,(J)=>{if(J)return U(J);iY(D,{...$,stale:0},U)})})})}function vE(D,$){return D.mtime.getTime()<Date.now()-$.stale}function bE(D,$,U){$.fs.rmdir(X3(D,$),(X)=>{if(X&&X.code!=="ENOENT")return U(X);U()})}function N7(D,$){let U=g$[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(X,F)=>{let Q=U.lastUpdate+$.stale<Date.now();if(X){if(X.code==="ENOENT"||Q)return nY(D,U,Object.assign(X,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}if(U.mtime.getTime()!==F.mtime.getTime())return nY(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let J=CE.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,J,J,(q)=>{let z=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(q){if(q.code==="ENOENT"||z)return nY(D,U,Object.assign(q,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}U.mtime=J,U.lastUpdate=Date.now(),U.updateDelay=null,N7(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function nY(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(g$[D]===$)delete g$[D];$.options.onCompromised(U)}function yp(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:pY,onCompromised:(X)=>{throw X},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),rY(D,$,(X,F)=>{if(X)return U(X);let Q=gp.operation($.retries);Q.attempt(()=>{iY(F,$,(Y,J,q)=>{if(Q.retry(Y))return;if(Y)return U(Q.mainError());let z=g$[F]={lockfilePath:X3(F,$),mtime:J,mtimePrecision:q,options:$,lastUpdate:Date.now()};N7(F,$),U(null,(W)=>{if(z.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));uE(F,{...$,realpath:!1},W)})})})})}function uE(D,$,U){$={fs:pY,realpath:!0,...$},rY(D,$,(X,F)=>{if(X)return U(X);let Q=g$[F];if(!Q)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete g$[F],bE(F,$,U)})}function mp(D,$,U){$={stale:1e4,realpath:!0,fs:pY,...$},$.stale=Math.max($.stale||0,2000),rY(D,$,(X,F)=>{if(X)return U(X);$.fs.stat(X3(F,$),(Q,Y)=>{if(Q)return Q.code==="ENOENT"?U(null,!1):U(Q);return U(null,!vE(Y,$))})})}function hp(){return g$}fp(()=>{for(let D in g$){let $=g$[D].options;try{$.fs.rmdirSync(X3(D,$))}catch(U){}}});dp.lock=yp;dp.unlock=uE;dp.check=mp;dp.getLocks=hp});var kE=S((lVD,_E)=>{var pp=Y6();function rp(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((X)=>{U[X]=(...F)=>{let Q=F.pop(),Y;try{Y=D[`${X}Sync`](...F)}catch(J){return Q(J)}Q(null,Y)}}),U}function ap(D){return(...$)=>new Promise((U,X)=>{$.push((F,Q)=>{if(F)X(F);else U(Q)}),D(...$)})}function op(D){return(...$)=>{let U,X;if($.push((F,Q)=>{U=F,X=Q}),D(...$),U)throw U;return X}}function tp(D){if(D={...D},D.fs=rp(D.fs||pp),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}_E.exports={toPromise:ap,toSync:op,toSyncOptions:tp}});var fE=S((cVD,q6)=>{var g4=xE(),{toPromise:M7,toSync:E7,toSyncOptions:aY}=kE();async function gE(D,$){let U=await M7(g4.lock)(D,$);return M7(U)}function sp(D,$){let U=E7(g4.lock)(D,aY($));return E7(U)}function ep(D,$){return M7(g4.unlock)(D,$)}function Dr(D,$){return E7(g4.unlock)(D,aY($))}function $r(D,$){return M7(g4.check)(D,$)}function Ur(D,$){return E7(g4.check)(D,aY($))}q6.exports=gE;q6.exports.lock=gE;q6.exports.unlock=ep;q6.exports.lockSync=sp;q6.exports.unlockSync=Dr;q6.exports.check=$r;q6.exports.checkSync=Ur});var nE=S((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.canStoreURLs=lE.FileUrlStorage=void 0;var yE=e("fs"),Fr=Qr(ZE()),mE=Xr(fE());function dE(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(dE=function(X){return X?U:$})(D)}function Xr(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=dE($);if(U&&U.has(D))return U.get(D);var X={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var Y=F?Object.getOwnPropertyDescriptor(D,Q):null;Y&&(Y.get||Y.set)?Object.defineProperty(X,Q,Y):X[Q]=D[Q]}return X.default=D,U&&U.set(D,X),X}function Qr(D){return D&&D.__esModule?D:{default:D}}function Y3(D){return Y3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},Y3(D)}function Yr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function hE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,qr(X.key),X)}}function Jr(D,$,U){if($)hE(D.prototype,$);if(U)hE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function qr(D){var $=zr(D,"string");return Y3($)=="symbol"?$:$+""}function zr(D,$){if(Y3(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(Y3(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var nVD=lE.canStoreURLs=!0,iVD=lE.FileUrlStorage=function(){function D($){Yr(this,D),this.path=$}return Jr(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(X,F){U._getItems("tus::",function(Q,Y){if(Q)F(Q);else X(Y)})})}},{key:"findUploadsByFingerprint",value:function(U){var X=this;return new Promise(function(F,Q){X._getItems("tus::".concat(U),function(Y,J){if(Y)Q(Y);else F(J)})})}},{key:"removeUpload",value:function(U){var X=this;return new Promise(function(F,Q){X._removeItem(U,function(Y){if(Y)Q(Y);else F()})})}},{key:"addUpload",value:function(U,X){var F=this,Q=Math.round(Math.random()*1000000000000),Y="tus::".concat(U,"::").concat(Q);return new Promise(function(J,q){F._setItem(Y,X,function(z){if(z)q(z);else J(Y)})})}},{key:"_setItem",value:function(U,X,F){var Q=this;mE.lock(this.path,this._lockfileOptions()).then(function(Y){F=Q._releaseAndCb(Y,F),Q._getData(function(J,q){if(J){F(J);return}q[U]=X,Q._writeData(q,function(z){return F(z)})})}).catch(F)}},{key:"_getItems",value:function(U,X){this._getData(function(F,Q){if(F){X(F);return}var Y=Object.keys(Q).filter(function(J){return J.startsWith(U)}).map(function(J){var q=Q[J];return q.urlStorageKey=J,q});X(null,Y)})}},{key:"_removeItem",value:function(U,X){var F=this;mE.lock(this.path,this._lockfileOptions()).then(function(Q){X=F._releaseAndCb(Q,X),F._getData(function(Y,J){if(Y){X(Y);return}delete J[U],F._writeData(J,function(q){return X(q)})})}).catch(X)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,X){return function(F){if(F){U().then(function(){return X(F)}).catch(function(Q){return X((0,Fr.default)([F,Q]))});return}U().then(X).catch(X)}}},{key:"_writeData",value:function(U,X){var F={encoding:"utf8",mode:432,flag:"w"};(0,yE.writeFile)(this.path,JSON.stringify(U),F,function(Q){return X(Q)})}},{key:"_getData",value:function(U){(0,yE.readFile)(this.path,"utf8",function(X,F){if(X){if(X.code==="ENOENT")U(null,{});else U(X);return}try{F=!F.trim().length?{}:JSON.parse(F)}catch(Q){U(Q);return}U(null,F)})}}])}()});var UA=S((z6)=>{Object.defineProperty(z6,"__esModule",{value:!0});Object.defineProperty(z6,"DefaultHttpStack",{enumerable:!0,get:function(){return aE.default}});Object.defineProperty(z6,"DetailedError",{enumerable:!0,get:function(){return Ir.default}});Object.defineProperty(z6,"FileUrlStorage",{enumerable:!0,get:function(){return oE.FileUrlStorage}});Object.defineProperty(z6,"StreamSource",{enumerable:!0,get:function(){return Kr.default}});z6.Upload=void 0;Object.defineProperty(z6,"canStoreURLs",{enumerable:!0,get:function(){return oE.canStoreURLs}});z6.defaultOptions=void 0;Object.defineProperty(z6,"enableDebugLog",{enumerable:!0,get:function(){return Gr.enableDebugLog}});z6.isSupported=void 0;var Ir=I1(rQ()),Gr=aQ(),Zr=I1(fO()),oY=I1(wN()),Vr=I1(gN()),Br=I1(dN()),aE=I1(XM()),Kr=I1(YY()),oE=nE();function I1(D){return D&&D.__esModule?D:{default:D}}function y4(D){return y4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y4(D)}function wr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function iE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,sE(X.key),X)}}function Hr(D,$,U){if($)iE(D.prototype,$);if(U)iE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Lr(D,$,U){return $=A7($),Or(D,tE()?Reflect.construct($,U||[],A7(D).constructor):$.apply(D,U))}function Or(D,$){if($&&(y4($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Nr(D)}function Nr(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function tE(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(tE=function(){return!!D})()}function A7(D){return A7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},A7(D)}function Mr(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)tY(D,$)}function tY(D,$){return tY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,F){return X.__proto__=F,X},tY(D,$)}function pE(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(D);$&&(X=X.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,X)}return U}function f4(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?pE(Object(U),!0).forEach(function(X){Er(D,X,U[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):pE(Object(U)).forEach(function(X){Object.defineProperty(D,X,Object.getOwnPropertyDescriptor(U,X))})}return D}function Er(D,$,U){if($=sE($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function sE(D){var $=Ar(D,"string");return y4($)=="symbol"?$:$+""}function Ar(D,$){if(y4(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(y4(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var rE=z6.defaultOptions=f4(f4({},oY.default.defaultOptions),{},{httpStack:new aE.default,fileReader:new Vr.default,urlStorage:new Zr.default,fingerprint:Br.default}),rVD=z6.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wr(this,$),X=f4(f4({},rE),X),Lr(this,$,[U,X])}return Mr($,D),Hr($,null,[{key:"terminate",value:function(X){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F=f4(f4({},rE),F),oY.default.terminate(X,F)}}])}(oY.default),aVD=z6.isSupported=!0});var X$;var m4=g(()=>{X$={name:"@capgo/cli",type:"module",version:"8.59.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var ND;var G1=g(()=>{ND=class ND extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as jr}from"node:os";import{version as Sr}from"node:process";function FBD(D){XA=D}function Pr(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function FA(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function Cr(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function eY(D,$){if($===void 0||$===null){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(!Pr($)){if(sY.has(D.toLowerCase()))throw new ND(Cr(D));throw new ND(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function W6(D){let $={capgo_api:Tr,"x-cli-version":X$.version,"x-cli-command":XA,"x-cli-node":Sr,"x-cli-os":jr()};if(D)for(let[U,X]of Object.entries(D))$[U]=eY(U,X);return $}var Tr="2025-10-01",XA="",sY;var DJ=g(()=>{m4();G1();sY=new Set(["authorization","capgkey","x-capgo-log-token"])});import{execFileSync as _r}from"child_process";import kr from"path";function ur(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function xr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function yr(D,$){let U=[],X=YA($.command);for(let F of D)for(let Q of F.process??[]){if(!Q.pattern.test(X))continue;U.push(mr(F,Q,{...$,command:X}))}return U}function mr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function QA(D,$){try{return _r("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function YA(D){return kr.basename(D.trim()).replace(/^-+/,"")}function JA(D={}){let $=D.agents??vr,U=D.strategies??hr(D.experimentalProcessTree),X={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},F=U.flatMap((Y)=>Y.detect(X)),Q=dr($,F,X.env);if(Q===void 0)return{detected:!1};return{detected:!0,agent:Q}}function hr(D=!1){let $=[new br];if(D)$.push(new fr);return $}function dr(D,$,U){let X=new Set($.map((F)=>F.agent.id));for(let F of D){if(!X.has(F.id))continue;return{id:F.id,name:F.name,...lr(F,U)}}return}function lr(D,$){for(let U of D.sessionEnv??[]){let X=$[U];if(X!==void 0&&X.length>0)return{sessionId:X}}return{}}var vr,br=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let X of U.env??[]){let F=D.env[X.name];if(F===void 0||!ur(F,X.value))continue;$.push(xr(U,X,F))}return $}},gr=class{read(D){let $=QA(D,"comm"),U=Number.parseInt(QA(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:YA($)}}},fr=class{constructor(D=new gr){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let X=0;X<D.maxProcessDepth;X+=1){let F=this.reader.read(U);if(F===void 0)break;if($.push(...yr(D.agents,F)),F.ppid===void 0||F.ppid<=1||F.ppid===U)break;U=F.ppid}return $}};var qA=g(()=>{vr=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as cr,release as nr}from"node:os";import{arch as ir,env as pr,version as rr}from"node:process";function BBD(D){$J=D}function KBD(){return $J}function zA(D=pr){let $=JA({env:D}),U={cli_version:X$.version,node_version:rr,os_platform:cr(),os_arch:ir,os_release:nr(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:J3.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:$J,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(J3.name)U.ci_provider=J3.name;return U}var J3,$J="cli";var WA=g(()=>{qA();m4();J3=j0(hQ(),1)});import{AsyncLocalStorage as ar}from"node:async_hooks";function LBD(D,$){return GA.run(D,()=>Promise.resolve($()))}function or(){return GA.getStore()}function OBD(){ZA=!0}function VA(){return ZA}function NBD(D){BA=D}function IA(D){try{BA?.(D)}catch{}}function EBD(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let X="/functions/v1/",F=U.indexOf(X);if(F>=0){let z=U.slice(F+X.length),W=0,I=z.length;while(W<I&&z[W]==="/")W+=1;while(I>W&&z[I-1]==="/")I-=1;let G=z.slice(W,I);return G?`${$} functions:${G}`:`${$} functions`}let Q="/rest/v1/",Y=U.indexOf(Q),J=Y>=0?U.slice(Y+Q.length):U.replace(/^\//,"");if(J.startsWith("rpc/"))return`rpc:${J.slice(4).split("/")[0]}`;let q=J.split("/")[0]||U;return`${$} ${q}`}function tr(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([X])=>X.toLowerCase()==="capgkey")?.[1];return $.capgkey}function KA(){return async($,U)=>{let X=(U?.method??"GET").toUpperCase(),F=typeof $==="string"?$:$ instanceof URL?$.href:$.url,Q=or(),Y=tr(U),J=Date.now();try{let q=await globalThis.fetch($,U);return IA({url:F,method:X,status:q.status,ok:q.ok,durationMs:Date.now()-J,source:Q,apikey:Y}),q}catch(q){throw IA({url:F,method:X,status:0,ok:!1,durationMs:Date.now()-J,source:Q,apikey:Y,error:q}),q}}}var GA,ZA=!1,BA,MBD=5000;var wA=g(()=>{GA=new ar});function sr(D,$){if(!N2(D)||!N2($))return!1;return c6($$(D),$$($))}function er(D,$,U){let X=U?.trim()?`
89
+ GFS4: `),console.error(D)};if(!hD[Q0]){if(_Y=global[Q0]||[],ME(hD,_Y),hD.close=function(D){function $(U,X){return D.call(hD,U,function(F){if(!F)NE();if(typeof X==="function")X.apply(this,arguments)})}return Object.defineProperty($,w7,{value:D}),$}(hD.close),hD.closeSync=function(D){function $(U){D.apply(hD,arguments),NE()}return Object.defineProperty($,w7,{value:D}),$}(hD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){J1(hD[Q0]),e("assert").equal(hD[Q0].length,0)})}var _Y;if(!global[Q0])ME(global,hD[Q0]);fY.exports=kY(Ap(hD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!hD.__patched)fY.exports=kY(hD),hD.__patched=!0;function kY(D){Mp(D),D.gracefulify=kY,D.createReadStream=R,D.createWriteStream=j;var $=D.readFile;D.readFile=U;function U(u,E,P){if(typeof E==="function")P=E,E=null;return h(u,E,P);function h(d,v,x,A){return $(d,v,function(H){if(H&&(H.code==="EMFILE"||H.code==="ENFILE"))x4([h,[d,v,x],H,A||Date.now(),Date.now()]);else if(typeof x==="function")x.apply(this,arguments)})}}var X=D.writeFile;D.writeFile=F;function F(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return X(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=Y;function Y(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return Q(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var J=D.copyFile;if(J)D.copyFile=q;function q(u,E,P,h){if(typeof P==="function")h=P,P=0;return d(u,E,P,h);function d(v,x,A,H,M){return J(v,x,A,function(b){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}var z=D.readdir;D.readdir=I;var W=/^v[0-5]\./;function I(u,E,P){if(typeof E==="function")P=E,E=null;var h=W.test(process.version)?function(x,A,H,M){return z(x,d(x,A,H,M))}:function(x,A,H,M){return z(x,A,d(x,A,H,M))};return h(u,E,P);function d(v,x,A,H){return function(M,b){if(M&&(M.code==="EMFILE"||M.code==="ENFILE"))x4([h,[v,x,A],M,H||Date.now(),Date.now()]);else{if(b&&b.sort)b.sort();if(typeof A==="function")A.call(this,M,b)}}}}if(process.version.substr(0,4)==="v0.8"){var G=Ep(D);L=G.ReadStream,w=G.WriteStream}var V=D.ReadStream;if(V)L.prototype=Object.create(V.prototype),L.prototype.open=O;var Z=D.WriteStream;if(Z)w.prototype=Object.create(Z.prototype),w.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return L},set:function(u){L=u},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return w},set:function(u){w=u},enumerable:!0,configurable:!0});var K=L;Object.defineProperty(D,"FileReadStream",{get:function(){return K},set:function(u){K=u},enumerable:!0,configurable:!0});var B=w;Object.defineProperty(D,"FileWriteStream",{get:function(){return B},set:function(u){B=u},enumerable:!0,configurable:!0});function L(u,E){if(this instanceof L)return V.apply(this,arguments),this;else return L.apply(Object.create(L.prototype),arguments)}function O(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E){if(u.autoClose)u.destroy();u.emit("error",E)}else u.fd=P,u.emit("open",P),u.read()})}function w(u,E){if(this instanceof w)return Z.apply(this,arguments),this;else return w.apply(Object.create(w.prototype),arguments)}function N(){var u=this;T(u.path,u.flags,u.mode,function(E,P){if(E)u.destroy(),u.emit("error",E);else u.fd=P,u.emit("open",P)})}function R(u,E){return new D.ReadStream(u,E)}function j(u,E){return new D.WriteStream(u,E)}var C=D.open;D.open=T;function T(u,E,P,h){if(typeof P==="function")h=P,P=null;return d(u,E,P,h);function d(v,x,A,H,M){return C(v,x,A,function(b,m){if(b&&(b.code==="EMFILE"||b.code==="ENFILE"))x4([d,[v,x,A,H],b,M||Date.now(),Date.now()]);else if(typeof H==="function")H.apply(this,arguments)})}}return D}function x4(D){J1("ENQUEUE",D[0].name,D[1]),hD[Q0].push(D),gY()}var K7;function NE(){var D=Date.now();for(var $=0;$<hD[Q0].length;++$)if(hD[Q0][$].length>2)hD[Q0][$][3]=D,hD[Q0][$][4]=D;gY()}function gY(){if(clearTimeout(K7),K7=void 0,hD[Q0].length===0)return;var D=hD[Q0].shift(),$=D[0],U=D[1],X=D[2],F=D[3],Q=D[4];if(F===void 0)J1("RETRY",$.name,U),$.apply(null,U);else if(Date.now()-F>=60000){J1("TIMEOUT",$.name,U);var Y=U.pop();if(typeof Y==="function")Y.call(null,X)}else{var J=Date.now()-Q,q=Math.max(Q-F,1),z=Math.min(q*1.2,100);if(J>=z)J1("RETRY",$.name,U),$.apply(null,U.concat([F]));else hD[Q0].push(D)}if(K7===void 0)K7=setTimeout(gY,0)}});var AE=S((yVD,EE)=>{function r0(D,$){if(typeof $==="boolean")$={forever:$};if(this._originalTimeouts=JSON.parse(JSON.stringify(D)),this._timeouts=D,this._options=$||{},this._maxRetryTime=$&&$.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._options.forever)this._cachedTimeouts=this._timeouts.slice(0)}EE.exports=r0;r0.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};r0.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};r0.prototype.retry=function(D){if(this._timeout)clearTimeout(this._timeout);if(!D)return!1;var $=new Date().getTime();if(D&&$-this._operationStart>=this._maxRetryTime)return this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(D);var U=this._timeouts.shift();if(U===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),U=this._timeouts.shift();else return!1;var X=this,F=setTimeout(function(){if(X._attempts++,X._operationTimeoutCb){if(X._timeout=setTimeout(function(){X._operationTimeoutCb(X._attempts)},X._operationTimeout),X._options.unref)X._timeout.unref()}X._fn(X._attempts)},U);if(this._options.unref)F.unref();return!0};r0.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var U=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){U._operationTimeoutCb()},U._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};r0.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};r0.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};r0.prototype.start=r0.prototype.try;r0.prototype.errors=function(){return this._errors};r0.prototype.attempts=function(){return this._attempts};r0.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,U=0;for(var X=0;X<this._errors.length;X++){var F=this._errors[X],Q=F.message,Y=(D[Q]||0)+1;if(D[Q]=Y,Y>=U)$=F,U=Y}return $}});var jE=S((Sp)=>{var jp=AE();Sp.operation=function(D){var $=Sp.timeouts(D);return new jp($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};Sp.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var U in D)$[U]=D[U];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var X=[];for(var F=0;F<$.retries;F++)X.push(this.createTimeout(F,$));if(D&&D.forever&&!X.length)X.push(this.createTimeout(F,$));return X.sort(function(Q,Y){return Q-Y}),X};Sp.createTimeout=function(D,$){var U=$.randomize?Math.random()+1:1,X=Math.round(U*$.minTimeout*Math.pow($.factor,D));return X=Math.min(X,$.maxTimeout),X};Sp.wrap=function(D,$,U){if($ instanceof Array)U=$,$=null;if(!U){U=[];for(var X in D)if(typeof D[X]==="function")U.push(X)}for(var F=0;F<U.length;F++){var Q=U[F],Y=D[Q];D[Q]=function(q){var z=Sp.operation($),W=Array.prototype.slice.call(arguments,1),I=W.pop();W.push(function(G){if(z.retry(G))return;if(G)arguments[0]=z.mainError();I.apply(this,arguments)}),z.attempt(function(){q.apply(D,W)})}.bind(D,Y),D[Q].options=$}}});var SE=S((hVD,H7)=>{H7.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")H7.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")H7.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var lY=S((dVD,k4)=>{var fD=global.process,q1=function(D){return D&&typeof D==="object"&&typeof D.removeListener==="function"&&typeof D.emit==="function"&&typeof D.reallyExit==="function"&&typeof D.listeners==="function"&&typeof D.kill==="function"&&typeof D.pid==="number"&&typeof D.on==="function"};if(!q1(fD))k4.exports=function(){return function(){}};else{if(yY=e("assert"),z1=SE(),mY=/^win/i.test(fD.platform),_4=e("events"),typeof _4!=="function")_4=_4.EventEmitter;if(fD.__signal_exit_emitter__)eD=fD.__signal_exit_emitter__;else eD=fD.__signal_exit_emitter__=new _4,eD.count=0,eD.emitted={};if(!eD.infinite)eD.setMaxListeners(1/0),eD.infinite=!0;k4.exports=function(D,$){if(!q1(global.process))return function(){};if(yY.equal(typeof D,"function","a callback must be provided for exit handler"),W1===!1)L7();var U="exit";if($&&$.alwaysLast)U="afterexit";var X=function(){if(eD.removeListener(U,D),eD.listeners("exit").length===0&&eD.listeners("afterexit").length===0)$3()};return eD.on(U,D),X},$3=function(){if(!W1||!q1(global.process))return;W1=!1,z1.forEach(function($){try{fD.removeListener($,U3[$])}catch(U){}}),fD.emit=F3,fD.reallyExit=O7,eD.count-=1},k4.exports.unload=$3,J6=function($,U,X){if(eD.emitted[$])return;eD.emitted[$]=!0,eD.emit($,U,X)},U3={},z1.forEach(function(D){U3[D]=function(){if(!q1(global.process))return;var U=fD.listeners(D);if(U.length===eD.count){if($3(),J6("exit",null,D),J6("afterexit",null,D),mY&&D==="SIGHUP")D="SIGINT";fD.kill(fD.pid,D)}}}),k4.exports.signals=function(){return z1},W1=!1,L7=function(){if(W1||!q1(global.process))return;W1=!0,eD.count+=1,z1=z1.filter(function($){try{return fD.on($,U3[$]),!0}catch(U){return!1}}),fD.emit=dY,fD.reallyExit=hY},k4.exports.load=L7,O7=fD.reallyExit,hY=function($){if(!q1(global.process))return;fD.exitCode=$||0,J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),O7.call(fD,fD.exitCode)},F3=fD.emit,dY=function($,U){if($==="exit"&&q1(global.process)){if(U!==void 0)fD.exitCode=U;var X=F3.apply(this,arguments);return J6("exit",fD.exitCode,null),J6("afterexit",fD.exitCode,null),X}else return F3.apply(this,arguments)}}var yY,z1,mY,_4,eD,$3,J6,U3,W1,L7,O7,hY,F3,dY});var PE=S((up,cY)=>{var TE=Symbol();function vp(D,$,U){let X=$[TE];if(X)return $.stat(D,(Q,Y)=>{if(Q)return U(Q);U(null,Y.mtime,X)});let F=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,F,F,(Q)=>{if(Q)return U(Q);$.stat(D,(Y,J)=>{if(Y)return U(Y);let q=J.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,TE,{value:q}),U(null,J.mtime,q)})})}function bp(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}up.probe=vp;up.getMtime=bp});var xE=S((dp,Q3)=>{var kp=e("path"),pY=Y6(),gp=jE(),fp=lY(),CE=PE(),g$={};function X3(D,$){return $.lockfilePath||`${D}.lock`}function rY(D,$,U){if(!$.realpath)return U(null,kp.resolve(D));$.fs.realpath(D,U)}function iY(D,$,U){let X=X3(D,$);$.fs.mkdir(X,(F)=>{if(!F)return CE.probe(X,$.fs,(Q,Y,J)=>{if(Q)return $.fs.rmdir(X,()=>{}),U(Q);U(null,Y,J)});if(F.code!=="EEXIST")return U(F);if($.stale<=0)return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(X,(Q,Y)=>{if(Q){if(Q.code==="ENOENT")return iY(D,{...$,stale:0},U);return U(Q)}if(!vE(Y,$))return U(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));bE(D,$,(J)=>{if(J)return U(J);iY(D,{...$,stale:0},U)})})})}function vE(D,$){return D.mtime.getTime()<Date.now()-$.stale}function bE(D,$,U){$.fs.rmdir(X3(D,$),(X)=>{if(X&&X.code!=="ENOENT")return U(X);U()})}function N7(D,$){let U=g$[D];if(U.updateTimeout)return;if(U.updateDelay=U.updateDelay||$.update,U.updateTimeout=setTimeout(()=>{U.updateTimeout=null,$.fs.stat(U.lockfilePath,(X,F)=>{let Q=U.lastUpdate+$.stale<Date.now();if(X){if(X.code==="ENOENT"||Q)return nY(D,U,Object.assign(X,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}if(U.mtime.getTime()!==F.mtime.getTime())return nY(D,U,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let J=CE.getMtime(U.mtimePrecision);$.fs.utimes(U.lockfilePath,J,J,(q)=>{let z=U.lastUpdate+$.stale<Date.now();if(U.released)return;if(q){if(q.code==="ENOENT"||z)return nY(D,U,Object.assign(q,{code:"ECOMPROMISED"}));return U.updateDelay=1000,N7(D,$)}U.mtime=J,U.lastUpdate=Date.now(),U.updateDelay=null,N7(D,$)})})},U.updateDelay),U.updateTimeout.unref)U.updateTimeout.unref()}function nY(D,$,U){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(g$[D]===$)delete g$[D];$.options.onCompromised(U)}function yp(D,$,U){$={stale:1e4,update:null,realpath:!0,retries:0,fs:pY,onCompromised:(X)=>{throw X},...$},$.retries=$.retries||0,$.retries=typeof $.retries==="number"?{retries:$.retries}:$.retries,$.stale=Math.max($.stale||0,2000),$.update=$.update==null?$.stale/2:$.update||0,$.update=Math.max(Math.min($.update,$.stale/2),1000),rY(D,$,(X,F)=>{if(X)return U(X);let Q=gp.operation($.retries);Q.attempt(()=>{iY(F,$,(Y,J,q)=>{if(Q.retry(Y))return;if(Y)return U(Q.mainError());let z=g$[F]={lockfilePath:X3(F,$),mtime:J,mtimePrecision:q,options:$,lastUpdate:Date.now()};N7(F,$),U(null,(W)=>{if(z.released)return W&&W(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));uE(F,{...$,realpath:!1},W)})})})})}function uE(D,$,U){$={fs:pY,realpath:!0,...$},rY(D,$,(X,F)=>{if(X)return U(X);let Q=g$[F];if(!Q)return U(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete g$[F],bE(F,$,U)})}function mp(D,$,U){$={stale:1e4,realpath:!0,fs:pY,...$},$.stale=Math.max($.stale||0,2000),rY(D,$,(X,F)=>{if(X)return U(X);$.fs.stat(X3(F,$),(Q,Y)=>{if(Q)return Q.code==="ENOENT"?U(null,!1):U(Q);return U(null,!vE(Y,$))})})}function hp(){return g$}fp(()=>{for(let D in g$){let $=g$[D].options;try{$.fs.rmdirSync(X3(D,$))}catch(U){}}});dp.lock=yp;dp.unlock=uE;dp.check=mp;dp.getLocks=hp});var kE=S((lVD,_E)=>{var pp=Y6();function rp(D){let $=["mkdir","realpath","stat","rmdir","utimes"],U={...D};return $.forEach((X)=>{U[X]=(...F)=>{let Q=F.pop(),Y;try{Y=D[`${X}Sync`](...F)}catch(J){return Q(J)}Q(null,Y)}}),U}function ap(D){return(...$)=>new Promise((U,X)=>{$.push((F,Q)=>{if(F)X(F);else U(Q)}),D(...$)})}function op(D){return(...$)=>{let U,X;if($.push((F,Q)=>{U=F,X=Q}),D(...$),U)throw U;return X}}function tp(D){if(D={...D},D.fs=rp(D.fs||pp),typeof D.retries==="number"&&D.retries>0||D.retries&&typeof D.retries.retries==="number"&&D.retries.retries>0)throw Object.assign(Error("Cannot use retries with the sync api"),{code:"ESYNC"});return D}_E.exports={toPromise:ap,toSync:op,toSyncOptions:tp}});var fE=S((cVD,q6)=>{var g4=xE(),{toPromise:M7,toSync:E7,toSyncOptions:aY}=kE();async function gE(D,$){let U=await M7(g4.lock)(D,$);return M7(U)}function sp(D,$){let U=E7(g4.lock)(D,aY($));return E7(U)}function ep(D,$){return M7(g4.unlock)(D,$)}function Dr(D,$){return E7(g4.unlock)(D,aY($))}function $r(D,$){return M7(g4.check)(D,$)}function Ur(D,$){return E7(g4.check)(D,aY($))}q6.exports=gE;q6.exports.lock=gE;q6.exports.unlock=ep;q6.exports.lockSync=sp;q6.exports.unlockSync=Dr;q6.exports.check=$r;q6.exports.checkSync=Ur});var nE=S((lE)=>{Object.defineProperty(lE,"__esModule",{value:!0});lE.canStoreURLs=lE.FileUrlStorage=void 0;var yE=e("fs"),Fr=Qr(ZE()),mE=Xr(fE());function dE(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,U=new WeakMap;return(dE=function(X){return X?U:$})(D)}function Xr(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var U=dE($);if(U&&U.has(D))return U.get(D);var X={__proto__:null},F=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var Y=F?Object.getOwnPropertyDescriptor(D,Q):null;Y&&(Y.get||Y.set)?Object.defineProperty(X,Q,Y):X[Q]=D[Q]}return X.default=D,U&&U.set(D,X),X}function Qr(D){return D&&D.__esModule?D:{default:D}}function Y3(D){return Y3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},Y3(D)}function Yr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function hE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,qr(X.key),X)}}function Jr(D,$,U){if($)hE(D.prototype,$);if(U)hE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function qr(D){var $=zr(D,"string");return Y3($)=="symbol"?$:$+""}function zr(D,$){if(Y3(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(Y3(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var nVD=lE.canStoreURLs=!0,iVD=lE.FileUrlStorage=function(){function D($){Yr(this,D),this.path=$}return Jr(D,[{key:"findAllUploads",value:function(){var U=this;return new Promise(function(X,F){U._getItems("tus::",function(Q,Y){if(Q)F(Q);else X(Y)})})}},{key:"findUploadsByFingerprint",value:function(U){var X=this;return new Promise(function(F,Q){X._getItems("tus::".concat(U),function(Y,J){if(Y)Q(Y);else F(J)})})}},{key:"removeUpload",value:function(U){var X=this;return new Promise(function(F,Q){X._removeItem(U,function(Y){if(Y)Q(Y);else F()})})}},{key:"addUpload",value:function(U,X){var F=this,Q=Math.round(Math.random()*1000000000000),Y="tus::".concat(U,"::").concat(Q);return new Promise(function(J,q){F._setItem(Y,X,function(z){if(z)q(z);else J(Y)})})}},{key:"_setItem",value:function(U,X,F){var Q=this;mE.lock(this.path,this._lockfileOptions()).then(function(Y){F=Q._releaseAndCb(Y,F),Q._getData(function(J,q){if(J){F(J);return}q[U]=X,Q._writeData(q,function(z){return F(z)})})}).catch(F)}},{key:"_getItems",value:function(U,X){this._getData(function(F,Q){if(F){X(F);return}var Y=Object.keys(Q).filter(function(J){return J.startsWith(U)}).map(function(J){var q=Q[J];return q.urlStorageKey=J,q});X(null,Y)})}},{key:"_removeItem",value:function(U,X){var F=this;mE.lock(this.path,this._lockfileOptions()).then(function(Q){X=F._releaseAndCb(Q,X),F._getData(function(Y,J){if(Y){X(Y);return}delete J[U],F._writeData(J,function(q){return X(q)})})}).catch(X)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(U,X){return function(F){if(F){U().then(function(){return X(F)}).catch(function(Q){return X((0,Fr.default)([F,Q]))});return}U().then(X).catch(X)}}},{key:"_writeData",value:function(U,X){var F={encoding:"utf8",mode:432,flag:"w"};(0,yE.writeFile)(this.path,JSON.stringify(U),F,function(Q){return X(Q)})}},{key:"_getData",value:function(U){(0,yE.readFile)(this.path,"utf8",function(X,F){if(X){if(X.code==="ENOENT")U(null,{});else U(X);return}try{F=!F.trim().length?{}:JSON.parse(F)}catch(Q){U(Q);return}U(null,F)})}}])}()});var UA=S((z6)=>{Object.defineProperty(z6,"__esModule",{value:!0});Object.defineProperty(z6,"DefaultHttpStack",{enumerable:!0,get:function(){return aE.default}});Object.defineProperty(z6,"DetailedError",{enumerable:!0,get:function(){return Ir.default}});Object.defineProperty(z6,"FileUrlStorage",{enumerable:!0,get:function(){return oE.FileUrlStorage}});Object.defineProperty(z6,"StreamSource",{enumerable:!0,get:function(){return Kr.default}});z6.Upload=void 0;Object.defineProperty(z6,"canStoreURLs",{enumerable:!0,get:function(){return oE.canStoreURLs}});z6.defaultOptions=void 0;Object.defineProperty(z6,"enableDebugLog",{enumerable:!0,get:function(){return Gr.enableDebugLog}});z6.isSupported=void 0;var Ir=I1(rQ()),Gr=aQ(),Zr=I1(fO()),oY=I1(wN()),Vr=I1(gN()),Br=I1(dN()),aE=I1(XM()),Kr=I1(YY()),oE=nE();function I1(D){return D&&D.__esModule?D:{default:D}}function y4(D){return y4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},y4(D)}function wr(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function iE(D,$){for(var U=0;U<$.length;U++){var X=$[U];if(X.enumerable=X.enumerable||!1,X.configurable=!0,"value"in X)X.writable=!0;Object.defineProperty(D,sE(X.key),X)}}function Hr(D,$,U){if($)iE(D.prototype,$);if(U)iE(D,U);return Object.defineProperty(D,"prototype",{writable:!1}),D}function Lr(D,$,U){return $=A7($),Or(D,tE()?Reflect.construct($,U||[],A7(D).constructor):$.apply(D,U))}function Or(D,$){if($&&(y4($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return Nr(D)}function Nr(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function tE(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(tE=function(){return!!D})()}function A7(D){return A7=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(U){return U.__proto__||Object.getPrototypeOf(U)},A7(D)}function Mr(D,$){if(typeof $!=="function"&&$!==null)throw TypeError("Super expression must either be null or a function");if(D.prototype=Object.create($&&$.prototype,{constructor:{value:D,writable:!0,configurable:!0}}),Object.defineProperty(D,"prototype",{writable:!1}),$)tY(D,$)}function tY(D,$){return tY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(X,F){return X.__proto__=F,X},tY(D,$)}function pE(D,$){var U=Object.keys(D);if(Object.getOwnPropertySymbols){var X=Object.getOwnPropertySymbols(D);$&&(X=X.filter(function(F){return Object.getOwnPropertyDescriptor(D,F).enumerable})),U.push.apply(U,X)}return U}function f4(D){for(var $=1;$<arguments.length;$++){var U=arguments[$]!=null?arguments[$]:{};$%2?pE(Object(U),!0).forEach(function(X){Er(D,X,U[X])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(U)):pE(Object(U)).forEach(function(X){Object.defineProperty(D,X,Object.getOwnPropertyDescriptor(U,X))})}return D}function Er(D,$,U){if($=sE($),$ in D)Object.defineProperty(D,$,{value:U,enumerable:!0,configurable:!0,writable:!0});else D[$]=U;return D}function sE(D){var $=Ar(D,"string");return y4($)=="symbol"?$:$+""}function Ar(D,$){if(y4(D)!="object"||!D)return D;var U=D[Symbol.toPrimitive];if(U!==void 0){var X=U.call(D,$||"default");if(y4(X)!="object")return X;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var rE=z6.defaultOptions=f4(f4({},oY.default.defaultOptions),{},{httpStack:new aE.default,fileReader:new Vr.default,urlStorage:new Zr.default,fingerprint:Br.default}),rVD=z6.Upload=function(D){function $(){var U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return wr(this,$),X=f4(f4({},rE),X),Lr(this,$,[U,X])}return Mr($,D),Hr($,null,[{key:"terminate",value:function(X){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return F=f4(f4({},rE),F),oY.default.terminate(X,F)}}])}(oY.default),aVD=z6.isSupported=!0});var X$;var m4=g(()=>{X$={name:"@capgo/cli",type:"module",version:"8.61.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"https://github.com/Cap-go/capgo.app",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:notify-app-ready-background":"bun test ./test/test-notify-app-ready-background.mjs ./test/test-background-check-shutdown.mjs","test:bundle":"bun test/test-bundle.mjs","test:bundle-validation":"bun test test/bundle/","test:prescan":"bun test test/prescan/","test:functional":"bun test/test-functional.mjs","test:semver":"bun test/test-semver-validation.mjs","test:version-edge-cases":"bun test/test-version-validation.mjs","test:regex":"bun test/test-regex-validation.mjs","test:upload":"bun test/test-upload-validation.mjs","test:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:native-dependencies":"bun test/test-native-dependencies.mjs && bun test/test-get-remote-dependencies.mjs","test:package-json-guard":"bun test/test-package-json-guard.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-export":"bun test/test-credentials-export.mjs","test:asc-key-protocol":"bun test/test-asc-key-protocol.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:cli-help":"bun test/test-cli-help.mjs","test:build-cache-payload":"bun test/test-build-cache-payload.mjs","test:build-cancellation":"bun test/test-build-cancellation.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:cli-headers":"bun test/test-cli-headers.mjs","test:min-cli-version":"bun test/test-min-cli-version.mjs","test:authenticated-command-invocation":"bun test/test-authenticated-command-invocation.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:mcp-instructions":"bun test/test-mcp-instructions.mjs","test:mcp-stdout-guard":"bun test/test-mcp-stdout-guard.mjs","test:mcp-platform-select":"bun test/test-mcp-platform-select.mjs","test:mcp-explain-scopes":"bun test/test-mcp-explain-scopes.mjs","test:mcp-oauth-reopen":"bun test/test-mcp-oauth-reopen.mjs","test:mcp-broker-oauth":"bun test/test-mcp-broker-oauth.mjs","test:mcp-broker-session":"bun test/test-mcp-broker-session.mjs","test:mcp-credentials-manage":"bun test/test-mcp-credentials-manage.mjs","test:mcp-resume-prompt":"bun test/test-mcp-resume-prompt.mjs","test:mcp-build-job":"bun test/test-mcp-build-job.mjs","test:mcp-build-tools":"bun test/test-mcp-build-tools.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:app-add-exists":"bun test/test-app-add-exists.mjs","test:app-add-getting-started":"bun test/test-app-add-getting-started.mjs","test:app-list-output-text":"bun test/test-app-list-output-text.mjs","test:app-todo":"bun test/test-app-todo.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:cli-recovery":"bun test/test-cli-recovery.mjs","test:create-supabase-client":"bun test/test-create-supabase-client.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:channel-add-exists":"bun test/test-channel-add-exists.mjs","test:wait-log":"bun test/test-wait-log.mjs","test:init-guardrails":"bun test/test-init-guardrails.mjs","test:init-upload-recovery":"bun test/test-init-upload-error-gate.mjs && bun test/test-init-upload-monorepo-recovery.mjs","test:init-replay":"bun test/test-init-replay.mjs","test:init-telemetry":"bun test/test-init-telemetry.mjs","test:capacitor-config-target":"bun test/test-capacitor-config-target.mjs","test:builder-app-id-config":"bun test/test-builder-app-id-config.mjs","test:capacitor-config-typescript7":"bun test/test-capacitor-config-typescript7.mjs","test:capacitor-config-native-import":"bun test/test-capacitor-config-native-import.mjs","test:cli-user-error-config":"bun test/test-cli-user-error-config.mjs","test:cordova-upload-mode":"bun test/test-cordova-upload-mode.mjs","test:init-monorepo-targeting":"bun run test:capacitor-config-target && bun run test:builder-app-id-config && bun run test:capacitor-config-typescript7 && bun run test:capacitor-config-native-import && bun run test:cli-user-error-config && bun test/test-init-monorepo-targeting.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:auth-session":"bun test/test-auth-session.mjs","test:mcp":"node test/test-mcp.mjs","test:mcp-no-key-handshake":"node test/test-mcp-no-key-handshake.mjs","test:version-detection":"node test/test-get-installed-version.mjs","test:version-detection:setup":"./test/fixtures/setup-test-projects.sh","test:platform-paths":"bun test/test-platform-paths.mjs","test:project-type-detection":"bun test/test-project-type-detection.mjs","test:payload-split":"bun test/test-payload-split.mjs","test:macos-signing":"bun test/test-macos-signing.mjs","test:helper-dce":"bash scripts/check-helper-dce.sh","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:apple-api-verify-key":"bun test/test-apple-api-verify-key.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:apple-api-cert-create":"bun test/test-apple-api-cert-create.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs","test:android-tail-engine":"bun test/test-android-tail-engine.mjs","test:android-tail-render":"bun test/test-android-tail-render.mjs","test:android-tail-routing":"bun test/test-android-tail-routing.mjs","test:dev-gate-stripped":"bun test/test-dev-gate-stripped.mjs","test:frame-fit-ios-shared":"bun test/test-frame-fit-ios-shared.mjs","test:ios-confirm-app-id":"bun test/test-ios-confirm-app-id.mjs","test:ios-create-new":"bun test/test-ios-create-new.mjs","test:ios-credential-action":"bun test/test-ios-credential-action.mjs","test:ios-e2e":"bun test/test-ios-e2e.mjs","test:ios-flow-contract":"bun test/test-ios-flow-contract.mjs","test:ios-import-discovery":"bun test/test-ios-import-discovery.mjs","test:ios-import-export":"bun test/test-ios-import-export.mjs","test:ios-import-pickers":"bun test/test-ios-import-pickers.mjs","test:ios-import-recovery":"bun test/test-ios-import-recovery.mjs","test:ios-recovery":"bun test/test-ios-recovery.mjs","test:ios-resume":"bun test/test-ios-resume.mjs","test:ios-tail-handoff":"bun test/test-ios-tail-handoff.mjs","test:ios-tui-render":"bun test/test-ios-tui-render.mjs","test:p8-error":"bun test/test-p8-error.mjs","test:ios-tui-routing":"bun test/test-ios-tui-routing.mjs","test:ios-updater-sync-validation":"bun test/test-ios-updater-sync-validation.mjs","test:ios-verify-app":"bun test/test-ios-verify-app.mjs","test:ios-marketing-version":"bun test/test-ios-marketing-version.mjs","test:android-version":"bun test/test-android-version.mjs","test:platform-flow-contract":"bun test/test-platform-flow-contract.mjs","test:tail-engine-shared":"bun test/test-tail-engine-shared.mjs",test:"bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:builder-project-discovery":"bun test/test-builder-project-discovery.mjs","test:builder-login-gate":"bun test/test-builder-login-gate.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:cicd-failure-help":"bun test/test-cicd-failure-help.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-upload-prompt":"bun test/test-support-upload-prompt.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs","test:mcp-live-update-onboarding":"bun test/test-mcp-live-update-onboarding.mjs","test:app-set-options":"bun test/test-app-set-options.mjs && bun test/test-app-list-options.mjs","test:android-reporting-api":"bun test/test-android-reporting-api.mjs","test:android-gcp":"bun test/test-android-gcp.mjs","test:android-app-verification":"bun test/test-android-app-verification.mjs","test:android-rename":"bun test/test-android-rename.mjs","test:appflow-auth":"bun test/test-appflow-auth.mjs","test:appflow-api-map":"bun test/test-appflow-api-map.mjs","test:appflow-validate":"bun test/test-appflow-validate.mjs","test:appflow-flow":"bun test/test-appflow-flow.mjs","test:appflow-gapfill":"bun test/test-appflow-gapfill.mjs","test:appflow-engine":"bun test/test-appflow-engine.mjs","test:appflow-tail":"bun test/test-appflow-tail.mjs","test:appflow-fetch":"bun test/test-appflow-fetch.mjs","test:appflow-sa-decode":"bun test/test-appflow-sa-decode.mjs","test:app-permission-helper":"bun test/test-app-permission-helper.mjs","test:2fa-compliance-network":"bun test/test-2fa-compliance-network.mjs","test:organization-set-api-host":"bun test/test-organization-set-api-host.mjs","test:trial-warning":"bun test/test-trial-warning.mjs","test:plan-validation":"bun test/test-plan-validation.mjs","test:auto-bump-version":"bun test/test-auto-bump-version.mjs","test:auto-bump-ai-diff":"bun test/test-auto-bump-ai-diff.mjs","test:ios-provisioning-map":"bun test/test-ios-provisioning-map.mjs","test:ios-provisioning-command":"bun test/test-ios-provisioning-command.mjs","test:channel-list":"bun test/test-channel-list.mjs"},dependencies:{"@inkjs/ui":"^2.0.0","@manypkg/tools":"^2.1.2","@rrweb/types":"^2.1.1","@standard-schema/spec":"^1.1.0","@xmldom/xmldom":"^0.9.10","@xterm/addon-serialize":"^0.14.0","@xterm/headless":"^6.0.0","agent-cli-detector":"^0.1.6","happy-dom":"^20.11.0",ink:"^7.1.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.8","rrweb-snapshot":"^2.1.1","string-width":"^8.2.2",typescript:"6.0.3",zod:"^4.4.3"},optionalDependencies:{"@capgo/cli-helper-darwin-arm64":"^1.1.1","@capgo/cli-helper-darwin-x64":"^1.1.1","node-pty":"^1.1.0"},devDependencies:{"@antfu/eslint-config":"^9.2.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.4.2","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.7.0","@modelcontextprotocol/client":"^2.0.0-beta.5","@modelcontextprotocol/server":"^2.0.0-beta.5","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.110.8","@tanstack/intent":"^0.3.6","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^26.1.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.17","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260707.2","@vercel/ncc":"^0.44.1","@vue/compiler-dom":"3.5.40","@xterm/headless":"^6.0.0","adm-zip":"^0.6.0","ci-info":"^4.4.0",commander:"^15.0.0",eslint:"^10.7.0","git-format-staged":"4.0.2",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.75.0",partysocket:"^1.3.0",prettyjson:"^1.2.5",tmp:"^0.2.7","tus-js-client":"^4.3.1",ws:"^8.21.1"}}});var ND;var G1=g(()=>{ND=class ND extends Error{context;constructor(D,$){super(D);this.name="CliUserError",this.context=$}}});import{platform as jr}from"node:os";import{version as Sr}from"node:process";function FBD(D){XA=D}function Pr(D){for(let $=0;$<D.length;$++)if(D.charCodeAt($)>255)return!1;return!0}function FA(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token is missing. Re-run the build command or pass a valid log token.";return"Capgo API key is missing. Run `npx -y @capgo/cli@latest login` or pass `--apikey`."}function Cr(D){if(D.toLowerCase()==="x-capgo-log-token")return"Build log token contains invalid characters (only ASCII is allowed). Re-run the build command to get a fresh token.";if(D.toLowerCase()==="authorization")return"Authorization header contains invalid characters (only ASCII is allowed). Check your Capgo API key or Supabase anon key configuration.";return"Capgo API key contains invalid characters (only ASCII is allowed). Copy the key from the Capgo dashboard."}function eY(D,$){if($===void 0||$===null){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(typeof $!=="string"){if(sY.has(D.toLowerCase()))throw new ND(FA(D));throw new ND(`HTTP header "${D}" is missing or invalid.`)}if(!Pr($)){if(sY.has(D.toLowerCase()))throw new ND(Cr(D));throw new ND(`HTTP header "${D}" contains invalid characters (only ASCII is allowed).`)}return $}function W6(D){let $={capgo_api:Tr,"x-cli-version":X$.version,"x-cli-command":XA,"x-cli-node":Sr,"x-cli-os":jr()};if(D)for(let[U,X]of Object.entries(D))$[U]=eY(U,X);return $}var Tr="2025-10-01",XA="",sY;var DJ=g(()=>{m4();G1();sY=new Set(["authorization","capgkey","x-capgo-log-token"])});import{execFileSync as _r}from"child_process";import kr from"path";function ur(D,$){if($===void 0)return!0;if(typeof $==="string")return D===$;if($ instanceof RegExp)return $.test(D);return $(D)}function xr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"environment",signal:$.name,value:U}}function yr(D,$){let U=[],X=YA($.command);for(let F of D)for(let Q of F.process??[]){if(!Q.pattern.test(X))continue;U.push(mr(F,Q,{...$,command:X}))}return U}function mr(D,$,U){return{agent:{id:D.id,name:D.name},strategy:"process-tree",signal:$.pattern.toString(),value:`${U.pid}:${U.command}`}}function QA(D,$){try{return _r("ps",["-o",`${$}=`,"-p",String(D)],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return""}}function YA(D){return kr.basename(D.trim()).replace(/^-+/,"")}function JA(D={}){let $=D.agents??vr,U=D.strategies??hr(D.experimentalProcessTree),X={env:D.env??process.env,pid:D.pid??process.pid,agents:$,maxProcessDepth:D.maxProcessDepth??20},F=U.flatMap((Y)=>Y.detect(X)),Q=dr($,F,X.env);if(Q===void 0)return{detected:!1};return{detected:!0,agent:Q}}function hr(D=!1){let $=[new br];if(D)$.push(new fr);return $}function dr(D,$,U){let X=new Set($.map((F)=>F.agent.id));for(let F of D){if(!X.has(F.id))continue;return{id:F.id,name:F.name,...lr(F,U)}}return}function lr(D,$){for(let U of D.sessionEnv??[]){let X=$[U];if(X!==void 0&&X.length>0)return{sessionId:X}}return{}}var vr,br=class{name="environment";detect(D){let $=[];for(let U of D.agents)for(let X of U.env??[]){let F=D.env[X.name];if(F===void 0||!ur(F,X.value))continue;$.push(xr(U,X,F))}return $}},gr=class{read(D){let $=QA(D,"comm"),U=Number.parseInt(QA(D,"ppid"),10);if(!$||!Number.isInteger(U))return;return{pid:D,ppid:U,command:YA($)}}},fr=class{constructor(D=new gr){this.reader=D}reader;name="process-tree";detect(D){let $=[],U=D.pid;for(let X=0;X<D.maxProcessDepth;X+=1){let F=this.reader.read(U);if(F===void 0)break;if($.push(...yr(D.agents,F)),F.ppid===void 0||F.ppid<=1||F.ppid===U)break;U=F.ppid}return $}};var qA=g(()=>{vr=[{id:"codex",name:"Codex",env:[{name:"CODEX_CI",value:"1"},{name:"CODEX_SHELL",value:"1"},{name:"CODEX_THREAD_ID"}],process:[{pattern:/^codex$/i}],sessionEnv:["CODEX_THREAD_ID"]},{id:"cursor",name:"Cursor",env:[{name:"CURSOR_AGENT",value:"1"},{name:"CURSOR_CONVERSATION_ID"}],process:[{pattern:/^cursor$/i}],sessionEnv:["CURSOR_CONVERSATION_ID"]},{id:"claude-code",name:"Claude Code",env:[{name:"CLAUDECODE",value:"1"},{name:"CLAUDE_CODE_SESSION_ID"}],process:[{pattern:/^claude$/i}],sessionEnv:["CLAUDE_CODE_SESSION_ID"]},{id:"opencode",name:"OpenCode",env:[{name:"OPENCODE",value:"1"},{name:"OPENCODE_PID"}],process:[{pattern:/^opencode$/i}]},{id:"devin",name:"Devin",process:[{pattern:/devin/i}]},{id:"gemini",name:"Gemini CLI",env:[{name:"GEMINI_CLI",value:"1"}],process:[{pattern:/^gemini$/i}]},{id:"antigravity",name:"Antigravity",env:[{name:"ANTIGRAVITY_AGENT",value:"1"},{name:"ANTIGRAVITY_TRAJECTORY_ID"}],process:[{pattern:/^antigravity$/i}],sessionEnv:["ANTIGRAVITY_TRAJECTORY_ID"]},{id:"bolt",name:"Bolt",env:[{name:"BOLT_ENV"},{name:"BOLT_ORIGIN"},{name:"BOLT_SERVER_URL"}]},{id:"pi",name:"Pi",env:[{name:"PI_CODING_AGENT",value:"true"}]},{id:"replit",name:"Replit",env:[{name:"REPLIT_SESSION"}],sessionEnv:["REPLIT_SESSION"]},{id:"rork",name:"Rork",env:[{name:"RORK_API_URL"}]},{id:"kiro",name:"Kiro",env:[{name:"KIRO_SESSION_ID"}],process:[{pattern:/kiro/i}],sessionEnv:["KIRO_SESSION_ID"]},{id:"muse",name:"Muse Code",env:[{name:"MUSE_RELEASE_INFO"}]},{id:"cline",name:"Cline",env:[{name:"CLINE_WRAPPER_PATH"}],process:[{pattern:/^cline$/i}]},{id:"kilocode",name:"Kilo Code",env:[{name:"KILO",value:"1"},{name:"KILOCODE_VERSION"},{name:"KILO_RUN_ID"}],process:[{pattern:/^(kilo|kilocode)$/i}],sessionEnv:["KILO_RUN_ID"]},{id:"copilot",name:"GitHub Copilot CLI",env:[{name:"COPILOT_CLI",value:"1"},{name:"COPILOT_AGENT_SESSION_ID"},{name:"COPILOT_RUN_APP",value:"1"}],process:[{pattern:/^(github-copilot-cli|copilot)$/i}],sessionEnv:["COPILOT_AGENT_SESSION_ID"]}]});import{platform as cr,release as nr}from"node:os";import{arch as ir,env as pr,version as rr}from"node:process";function BBD(D){$J=D}function KBD(){return $J}function zA(D=pr){let $=JA({env:D}),U={cli_version:X$.version,node_version:rr,os_platform:cr(),os_arch:ir,os_release:nr(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"undefined",is_ci:J3.isCI,is_tty:Boolean(process.stdout.isTTY),invocation_source:$J,agent_invoker:$.detected};if($.detected&&$.agent)U.agent_identity=$.agent;if(J3.name)U.ci_provider=J3.name;return U}var J3,$J="cli";var WA=g(()=>{qA();m4();J3=j0(hQ(),1)});import{AsyncLocalStorage as ar}from"node:async_hooks";function LBD(D,$){return GA.run(D,()=>Promise.resolve($()))}function or(){return GA.getStore()}function OBD(){ZA=!0}function VA(){return ZA}function NBD(D){BA=D}function IA(D){try{BA?.(D)}catch{}}function EBD(D,$){let U;try{U=new URL(D).pathname}catch{U=D.split("?")[0]}let X="/functions/v1/",F=U.indexOf(X);if(F>=0){let z=U.slice(F+X.length),W=0,I=z.length;while(W<I&&z[W]==="/")W+=1;while(I>W&&z[I-1]==="/")I-=1;let G=z.slice(W,I);return G?`${$} functions:${G}`:`${$} functions`}let Q="/rest/v1/",Y=U.indexOf(Q),J=Y>=0?U.slice(Y+Q.length):U.replace(/^\//,"");if(J.startsWith("rpc/"))return`rpc:${J.slice(4).split("/")[0]}`;let q=J.split("/")[0]||U;return`${$} ${q}`}function tr(D){let $=D?.headers;if(!$)return;let U=$.get;if(typeof U==="function")return U.call($,"capgkey")??void 0;if(Array.isArray($))return $.find(([X])=>X.toLowerCase()==="capgkey")?.[1];return $.capgkey}function KA(){return async($,U)=>{let X=(U?.method??"GET").toUpperCase(),F=typeof $==="string"?$:$ instanceof URL?$.href:$.url,Q=or(),Y=tr(U),J=Date.now();try{let q=await globalThis.fetch($,U);return IA({url:F,method:X,status:q.status,ok:q.ok,durationMs:Date.now()-J,source:Q,apikey:Y}),q}catch(q){throw IA({url:F,method:X,status:0,ok:!1,durationMs:Date.now()-J,source:Q,apikey:Y,error:q}),q}}}var GA,ZA=!1,BA,MBD=5000;var wA=g(()=>{GA=new ar});function sr(D,$){if(!N2(D)||!N2($))return!1;return c6($$(D),$$($))}function er(D,$,U){let X=U?.trim()?`
90
90
  ${U.trim()}`:"";return`This Capgo API requires @capgo/cli@${$} or newer. You are using @capgo/cli@${D}.${X}
91
91
  Please update: npx @capgo/cli@latest`}function HA(D,$,U=!1){let X=$||X$.version,F=D.minCliVersion?.trim();if(!F||!sr(X,F))return;let Q=er(X,F,D.minCliVersionReason);if(!U)ED.error(Q);throw new ND(Q,{minCliVersion:F,currentVersion:X})}var LA=g(()=>{D6();AQ();m4();G1()});function OA(D,$){let X=["normal","bold","dim","italic","underline","strikethrough"].indexOf(D),F="\x1B[";return"\x1B["+X+"m"+$+"\x1B[0m"}var q3;var NA=g(()=>{q3=class q3{title=null;headers=[];rows=[];static narrowTheme={top:["╔","═","╤","╗"],row:["║"," ","│","║"],div:["╟","─","┼","╢"],bot:["╚","═","╧","╝"]};static wideTheme={top:["╔═","═","═╤═","═╗"],row:["║ "," "," │ "," ║"],div:["╟─","─","─┼─","─╢"],bot:["╚═","═","═╧═","═╝"]};static roundTheme={top:["╭─","─","─┬─","─╮"],row:["│ "," "," │ "," │"],div:["├─","─","─┼─","─┤"],bot:["╰─","─","─┴─","─╯"]};theme=q3.wideTheme;columnWidth(){let D=[this.headers,...this.rows].filter((U)=>U.length>0),$=D[0].map((U)=>this.cast(U).length);for(let U of D.slice(1))for(let X=0;X<$.length;X++){let F=this.cast(U[X]).length;if(F>$[X])$[X]=F}return $}cast(D){if(typeof D==="object")return"obj";if(D!==void 0&&typeof D.toString==="function")return D.toString();else return""}renderTitle(){return"[ "+this.title+" ]"}renderLine(D){let $=this.columnWidth();return D[0]+$.map((U)=>D[1].repeat(U)).join(D[2])+D[3]}renderCell(D,$,U=!1){let X=this.cast(D),F=U?OA("bold",X):X,Q=$-X.length,Y=this.theme.row[1];switch(typeof D){case"number":return Y.repeat(Q)+F;case"string":return F+Y.repeat(Q);case"boolean":case"object":return Y.repeat(Math.ceil(Q/2))+OA("italic",X)+Y.repeat(Math.floor(Q/2));default:return Y.repeat(Q)}}renderRow(D,$=!1){let U=this.theme.row,X=this.columnWidth();return U[0]+D.map((F,Q)=>this.renderCell(F,X[Q],$)).join(U[2])+U[3]}toString(){let D=this.theme,$=this.headers.length>0,U=this.rows.length>0;return[this.title?this.renderTitle():"",$||U?this.renderLine(D.top):"",$?this.renderRow(this.headers,!0):"",$&&U?this.renderLine(D.div):"",...this.rows.map((X)=>this.renderRow(X)),$||U?this.renderLine(D.bot):""].filter((X)=>X.length>0).join(`
92
92
  `)}}});var MA=g(()=>{NA()});async function EA(D){try{let U=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,X=await fetch(U,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!X.ok)return null;return(await X.json())["dist-tags"]?.latest||null}catch{return null}}async function Da(){let D=await EA("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:X$.version,latestVersion:D,isOutdated:!!D&&D!==X$.version,majorVersion:$}}async function AA(D={warn:($)=>ED.warning($)}){let{isOutdated:$,currentVersion:U,latestVersion:X,majorVersion:F}=await Da();if($)D.warn(`\uD83D\uDEA8 You are using @capgo/cli@${U} it's not the latest version.
@@ -250,7 +250,7 @@ tell application "System Events" to get value of property list item "CFBundleNam
250
250
  `)}function pMD(D){return[`Bundle upload timed out after ${Math.round(D/1000)}s.`,"The standard upload has to finish the whole transfer within this window and does not retry, so a large bundle or a slow connection can trip it.","What you can do:","1. Retry with the resumable upload, which uploads in chunks and retries automatically: npx @capgo/cli@latest bundle upload --tus","2. Or raise the limit for the standard upload: npx @capgo/cli@latest bundle upload --timeout <milliseconds>"].join(`
251
251
  `)}function I0(D){if(!D)return"Unknown error";if(uV(D).isSecurityPolicyError)return nb(D);let U=D;if(typeof D==="string")return D;if(D instanceof Error){let X=U.message||U.cause?.message||U.stack||D.name,F=U.cause?.name,Q=X.toLowerCase();if(Q.includes("fetch failed")||Q.includes("failed to fetch")||Q.includes("connect timeout")||Q.includes("network")||F?.startsWith("UND_ERR"))return`Network error: ${X}${U.code?` (code ${U.code})`:""}. Check your network connection and API endpoint availability.`;let Y=U.status||U.statusCode;return[X,U.code?`Code: ${U.code}`:void 0,Y?`Status: ${Y}`:void 0].filter(Boolean).join(" | ")||D.name}if(U.message){let X=[U.message,U.code?`Code: ${U.code}`:void 0,U.status||U.statusCode?`Status: ${U.status||U.statusCode}`:void 0].filter(Boolean).join(" | "),F=U.message.toLowerCase();if(F.includes("fetch failed")||F.includes("failed to fetch")||U.error==="Failed to fetch")return`Network error: ${X}. Check your network connection and API endpoint availability.`;if(U.details||U.hint||U.error)return`${X}${X?" | ":""}${U.error?typeof U.error==="string"?U.error:U.error.message??"":""}${U.details?`Details: ${U.details}`:""}${U.hint?`Hint: ${U.hint}`:""}`.trim();return X}if(typeof U.error==="string"&&U.error.length>0)return U.error;if(U.error&&typeof U.error==="object"&&typeof U.error.message==="string"&&U.error.message.length>0)return U.error.message;return`
252
252
  ${bu.default.render(D)}`}async function aMD(D,$,U=!1){let{data:X,error:F}=await mb(()=>D.rpc("reject_access_due_to_2fa_for_org",{org_id:$}));if(F){if(!U&&!k8(F))p.error(`Cannot check 2FA compliance: ${F.message}`);if(k8(F)){await hb({silent:U,telemetryFunctionName:"check2FAAccessForOrg"});return}db(F)}if(X){if(!U)p.error(`\uD83D\uDD10 Access Denied: 2FA Required. Enable 2FA at ${uu("/settings/account")}`);throw Error("2FA required for this organization")}}function oMD({silent:D=!1,stdinIsTTY:$=!!Cu.isTTY,stdoutIsTTY:U=!!vu.isTTY,ci:X=XB.isCI}={}){return!D&&$&&U&&!X}function F2D(D={}){let $=D.ci??XB.isCI,U=D.stdinIsTTY??!!Cu.isTTY,X=D.stdoutIsTTY??!!vu.isTTY,F=D.platform??Su(),Q="display"in D?D.display:y1.DISPLAY;if($||!U||!X)return!1;if(F==="linux"&&!Q)return!1;return!0}async function X2D(D){if(!F2D())return;try{await(await Promise.resolve().then(() => (Lu(),Hu))).default(D)}catch($){if($?.code==="ENOENT")return}}function tMD(D){return Xq(D)||Qq(D)}function n$(D){if(Xq(D))return zP(D);else if(Qq(D))return WP(D);return D}function xu(D=n$(X0()),$=void 0){let U=$?.split(",")[0],X=U??GD(D,x0);if(!zD(X)){let Q=U?`Package.json at ${X} does not exist`:`No package.json found at ${X}. Run this command from your project root (the folder that contains package.json), or pass --package-json <path> to point at it (for example in a monorepo).`;throw p.error(Q),Error(Q)}let F=pD(X);return JSON.parse(F)}function sMD(D=n$(X0()),$=void 0){return xu(D,$).scripts}function eMD(D=n$(X0()),$=void 0){return xu(D,$).version??""}function Q2D(D){let $=D.replace("^","").replace("~","");if(N2($))try{let U=$$($);return LQ(U)}catch{return $}return $}async function DED(D,$=X0(),U){let X=U?U.split(",").map((Y)=>Y.trim()).filter(Boolean):[],F=[],Q=(Y)=>{let J=gD(Y);if(!F.includes(J))F.push(J)};for(let Y of X){let J=gD($,Y);if(zD(J))Q(c$(J))}Q(gD($)),Q(X0());for(let Y of F)try{let J=`${D}/package.json`,{createRequire:q}=await import("node:module"),W=q(GD(Y,"package.json")).resolve(J),I=JSON.parse(pD(W,"utf-8"));if(I.version)return I.version}catch{}for(let Y of F){let J=Y,q=h1.parse(J).root;while(J!==q){let z=GD(J,"node_modules",D,x0);if(zD(z))try{let I=JSON.parse(pD(z,"utf-8"));if(I.version)return I.version}catch{}let W=c$(J);if(W===J)break;J=W}}if(D==="@capgo/capacitor-updater"){let Y=null,J=GD($,"ios","App","Podfile");if(zD(J))try{let z=pD(J,"utf-8").match(/pod\s+['"]CapgoCapacitorUpdater['"],\s*:path\s*=>\s*['"]([^'"]+)['"]/);if(z?.[1])Y=gD(GD($,"ios","App",z[1]))}catch{}if(!Y){let q=GD($,"android","capacitor.settings.gradle");if(zD(q))try{let W=pD(q,"utf-8").match(/project\(':capgo-capacitor-updater'\)\.projectDir\s*=\s*new\s+File\(['"]([^'"]+)['"]/);if(W?.[1])Y=gD(GD($,"android",W[1])).replace(/\/android$/,"")}catch{}}if(Y){let q=GD(Y,x0);if(zD(q))try{let z=JSON.parse(pD(q,"utf-8"));if(z.version)return z.version}catch{}}}try{let Y=U?U.split(",").map((z)=>z.trim()).filter(Boolean).join(","):U,q=(await oF($,Y)).get(D);if(q)return q}catch{}return null}async function oF(D=n$(X0()),$=void 0){let U=$?.split(",").map((Q)=>Q.trim()).filter(Boolean);if(U??=[GD(D,x0)],U){for(let Q of U)if(!zD(Q)){let Y=`Package.json at ${Q} does not exist`;throw p.error(Y),Error(Y)}}let X=new Map,{createRequire:F}=await import("node:module");for(let Q of U){let Y=pD(Q),J=JSON.parse(Y),q=c$(Q),z=(W,I)=>{try{let K=F(GD(q,"package.json")).resolve(`${W}/package.json`),B=JSON.parse(pD(K,"utf-8"));if(B.version)return B.version}catch{}let G=q,V=h1.parse(G).root;while(G!==V){let Z=GD(G,"node_modules",W,x0);if(zD(Z))try{let B=JSON.parse(pD(Z,"utf-8"));if(B.version)return B.version}catch{}let K=c$(G);if(K===G)break;G=K}return Q2D(I)};for(let W in J.dependencies)X.set(W,z(W,J.dependencies[W]));for(let W in J.devDependencies)X.set(W,z(W,J.devDependencies[W]))}return X}async function Y2D(D=n$(X0()),$=void 0){let U=$?.split(",").map((F)=>F.trim()).filter(Boolean);if(U??=[GD(D,x0)],U){for(let F of U)if(!zD(F)){let Q=`Package.json at ${F} does not exist`;throw p.error(Q),Error(Q)}}let X=new Map;for(let F of U){let Q=pD(F),Y=JSON.parse(Q);for(let J in Y.dependencies??{})if(typeof Y.dependencies[J]==="string")X.set(J,Y.dependencies[J]);for(let J in Y.devDependencies??{})if(typeof Y.devDependencies[J]==="string")X.set(J,Y.devDependencies[J])}return X}function J2D(D){if(!D)return!1;if(D.config&&Object.keys(D.config).length>0)return!0;return!!D.path&&zD(D.path)}async function _u(D,$=!1){let U=q2D;try{let X=await D();if(!J2D(X)){if(!$)p.error(U);throw new ND(U)}return X}catch(X){if(X instanceof ND)throw X;let F=I0(X);if(!$)p.error(`${U}: ${F}`);throw new ND(U,{cause:F})}}function FJ(D=!1){return _u(Zq,D)}function z2D(D=!1){return _u(Vq,D)}async function W2D(D,$){let U=await z2D();if(U?.config)U.config.plugins??={},U.config.plugins.extConfig??={},U.config.plugins[D]??={},U.config.plugins[D]={...U.config.plugins[D],...$},await Bq(D,U);return U}async function $ED(D){return W2D("CapacitorUpdater",D)}async function Z1(D=!1){try{let $=await FJ(D),U={host:$?.config?.plugins?.CapacitorUpdater?.localHost||Ou,hostWeb:$?.config?.plugins?.CapacitorUpdater?.localWebHost||pF,hostFilesApi:$?.config?.plugins?.CapacitorUpdater?.localApiFiles||Nu,hostApi:$?.config?.plugins?.CapacitorUpdater?.localApi||C6};if($?.config?.plugins?.CapacitorUpdater?.localSupa&&$?.config?.plugins?.CapacitorUpdater?.localSupaAnon){if(!D)p.info("Using custom supabase instance from capacitor.config.json");U.supaKey=$?.config?.plugins?.CapacitorUpdater?.localSupaAnon,U.supaHost=$?.config?.plugins?.CapacitorUpdater?.localSupa}return U}catch{return{host:Ou,hostWeb:pF,hostFilesApi:Nu,hostApi:C6}}}function Eu(D){return typeof D==="object"&&D!==null}function I2D(D){if(!Eu(D))return!1;let $=D.capacitor;if(Eu($)&&($.ios!==void 0||$.android!==void 0))return!0;return!1}function G2D(D){if(zD(GD(D,"plugin.xml")))return!0;let $=GD(D,x0);if(!zD($))return!1;try{return I2D(JSON.parse(pD($,"utf-8")))}catch{return!1}}async function K9(D=!1,$){let U=(F)=>{let Q={...F};return HA(Q,void 0,D),Q};if(!$&&sV)return U(sV);if(!$&&cF)return cF.then(U);let X=(async()=>{let F=await Z1(D);try{let Q=sF(),Y=await fetch(`${F.hostApi}/private/config`,{...$?{signal:$}:{},headers:W6(Q?{capgkey:Q}:void 0)});if(!Y.ok)throw Error(`HTTP error! status: ${Y.status}`);let q={...await Y.json(),...F};if(!$)sV=q;return{...q}}catch{if(!D)p.info(`Local config ${I0(F)}`);return{...F}}finally{if(!$)cF=null}})();if(!$)cF=X;return X.then(U)}async function UED(){let D=await Z1();try{let $=sF(),U=await fetch(`${D.hostFilesApi}/files/config`,{headers:W6($?{capgkey:$}:void 0)});if(!U.ok)throw Error(`HTTP error! status: ${U.status}`);return await U.json()}catch{return{partialUpload:!1,TUSUpload:!1,partialUploadForced:!1,TUSUploadForced:!1,maxUploadLength:e8D,maxChunkSize:D2D,alertUploadSize:s8D}}}function v6(D){let $=new URL(D);if(!["http:","https:"].includes($.protocol))throw Error("Invalid Supabase host protocol");if($.username||$.password)throw Error("Supabase host must not include credentials");if($.search||$.hash)throw Error("Supabase host must not include query parameters or fragments");let U=X8($.pathname);return`${$.origin}${U}`}function Z2D(D){if(!D||typeof D!=="object")return"";let $=D;return[$.error,$.message,$.status].filter(Boolean).join(" | ")}function Au(D,$){let U=D.indexOf($);if(U<0)return D;return D.slice(U+$.length).replace(/^:\s*/,"").split(`
253
- `)[0].trim()}async function FED(D){let $=await gu(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let U=D instanceof Error?D.message:String(D??"");if(U.includes("CHANNEL_ZIP_REQUIRED"))return Au(U,"CHANNEL_ZIP_REQUIRED");if(U.includes("CHANNEL_DELTA_REQUIRED"))return Au(U,"CHANNEL_DELTA_REQUIRED");return null}function m1(D){if(!D)return!1;try{let $=new URL(v6(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function QB(D){if(D.supaHost&&D.supaKey&&D.hostApi===C6&&!m1(D.supaHost))return`${v6(D.supaHost)}/functions/v1`;return D.hostApi}function XED(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function gu(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let U=await $.clone().text();try{return JSON.parse(U)}catch{return U?{message:U}:null}}catch{return null}}async function QED(D){let $=await gu(D);if($){let U=Z2D($);if(U)return U}return I0(D)}async function tF(D,$){let U=($.method??"POST").toUpperCase(),X,F=$.supaAnon;if($.supaHost&&$.supaAnon&&!m1($.supaHost))X=`${v6($.supaHost)}/functions/v1`;else{let J=await K9(!0);if(F=$.supaAnon??J.supaKey,J.supaHost&&J.supaKey&&J.hostApi===C6&&!m1(J.supaHost)&&!($.supaHost&&m1($.supaHost)))X=`${v6(J.supaHost)}/functions/v1`;else if($.useFilesHost)X=J.hostFilesApi;else X=J.hostApi}let Q=X.includes("/functions/v1"),Y=`${X8(X)}/${D.replace(/^\//,"")}`;try{let J=await fetch(Y,{method:U,headers:W6({"Content-Type":"application/json",Authorization:Q&&F?`Bearer ${F}`:$.apikey,capgkey:$.apikey}),body:U==="GET"||U==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!J.ok)return{data:null,error:new i0.FunctionsHttpError(J)};return{data:(J.headers.get("content-type")??"").includes("application/json")?await J.json().catch(()=>null):await J.text().catch(()=>null),error:null}}catch(J){return{data:null,error:J instanceof Error?J:Error(String(J))}}}async function YED(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(m1(D.supaHost))return(await Z1($)).hostApi;return`${v6(D.supaHost)}/functions/v1`}let U=await Z1($);if(U.supaHost&&U.supaKey)return QB(U);return(await K9($)).hostApi}async function JED(D,$,U,X=!1,F=!0,Q){let Y=await K9(X,Q);if($&&U){if(!X)p.info("Using custom supabase instance from provided options");Y.supaHost=$,Y.supaKey=U}if(!Y.supaHost||!Y.supaKey)throw p.error(Mu),new ND(Mu,{missingSupaHost:!Y.supaHost,missingSupaKey:!Y.supaKey});let J=v6(Y.supaHost);return ZL(J,Y.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:eY("capgkey",D)},...VA()&&F?{fetch:KA()}:{}}})}async function V2D(D,$){let{data:U}=await D.rpc("is_paying_org",{orgid:$}).single();return U||!1}async function B2D(D,$){let{data:U}=await D.rpc("is_trial_org",{orgid:$}).single();return U||0}async function K2D(D,$,U){let{data:X}=await D.rpc("has_usage_credits_org",U?{orgid:$,appid:U}:{orgid:$}).single();return X||!1}function w2D(D){let{trialDays:$,isPaying:U,hasCredits:X,warning:F=!0}=D;return!!F&&$>0&&!U&&!X}async function H2D(D,$){let{data:U,error:X}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(X)throw Error(`Cannot validate plan: ${I0(X)}`);return U===!0}async function eV(D,$,U,X){let{data:F,error:Q}=X?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U,appid:X}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U});if(Q){if(X&&Q.code==="PGRST202")return H2D(D,$);throw Error(`Cannot validate plan: ${I0(Q)}`)}return F===!0}async function L2D(D,$,U,X){if(X){if(await eV(D,$,U,X))return"allowed";if(await eV(D,$,U))return"permission_denied";return"billing_denied"}return await eV(D,$,U)?"allowed":"billing_denied"}async function O2D(D,$){throw p.error(`You need to upgrade your plan to continue to use capgo.
253
+ `)[0].trim()}async function FED(D){let $=await gu(D);if($?.error==="channel_zip_required"||$?.error==="channel_delta_required")return $.message||$.error;let U=D instanceof Error?D.message:String(D??"");if(U.includes("CHANNEL_ZIP_REQUIRED"))return Au(U,"CHANNEL_ZIP_REQUIRED");if(U.includes("CHANNEL_DELTA_REQUIRED"))return Au(U,"CHANNEL_DELTA_REQUIRED");return null}function m1(D){if(!D)return!1;try{let $=new URL(v6(D)).hostname.toLowerCase();return $==="sb.capgo.app"||$==="xvwzpoazmxkqosrdewyv.supabase.co"||$==="ibwjdnhknbkcqfbabwei.supabase.co"||$==="aucsybvnhavogdmzwtcw.supabase.co"}catch{return!1}}function QB(D){if(D.supaHost&&D.supaKey&&D.hostApi===C6&&!m1(D.supaHost))return`${v6(D.supaHost)}/functions/v1`;return D.hostApi}function XED(D){let $=D?.context;return typeof $?.status==="number"?$.status:void 0}async function gu(D){let $=D?.context;if(!$||typeof $.clone!=="function")return null;try{let U=await $.clone().text();try{return JSON.parse(U)}catch{return U?{message:U}:null}}catch{return null}}async function QED(D){let $=await gu(D);if($){let U=Z2D($);if(U)return U}return I0(D)}async function tF(D,$){let U=($.method??"POST").toUpperCase(),X,F=$.supaAnon;if($.supaHost&&$.supaAnon&&!m1($.supaHost))X=`${v6($.supaHost)}/functions/v1`;else{let J=await K9(!0);if(F=$.supaAnon??J.supaKey,J.supaHost&&J.supaKey&&J.hostApi===C6&&!m1(J.supaHost)&&!($.supaHost&&m1($.supaHost)))X=`${v6(J.supaHost)}/functions/v1`;else if($.useFilesHost)X=J.hostFilesApi;else X=J.hostApi}let Q=X.includes("/functions/v1"),Y=`${X8(X)}/${D.replace(/^\//,"")}`;try{let J=await fetch(Y,{method:U,headers:W6({"Content-Type":"application/json",Authorization:Q&&F?`Bearer ${F}`:$.apikey,capgkey:$.apikey}),body:U==="GET"||U==="HEAD"?void 0:typeof $.body==="string"?$.body:JSON.stringify($.body??{}),signal:$.signal});if(!J.ok)return{data:null,error:new i0.FunctionsHttpError(J)};return{data:(J.headers.get("content-type")??"").includes("application/json")?await J.json().catch(()=>null):await J.text().catch(()=>null),error:null}}catch(J){return{data:null,error:J instanceof Error?J:Error(String(J))}}}async function YED(D,$=!0){if(D?.supaHost&&D?.supaAnon){if(m1(D.supaHost))return(await Z1($)).hostApi;return`${v6(D.supaHost)}/functions/v1`}let U=await Z1($);if(U.supaHost&&U.supaKey)return QB(U);return(await K9($)).hostApi}async function JED(D,$,U,X=!1,F=!0,Q){let Y=await K9(X,Q);if($&&U){if(!X)p.info("Using custom supabase instance from provided options");Y.supaHost=$,Y.supaKey=U}if(!Y.supaHost||!Y.supaKey){if(!X)p.error(Mu);throw new ND(Mu,{missingSupaHost:!Y.supaHost,missingSupaKey:!Y.supaKey})}let J=v6(Y.supaHost);return ZL(J,Y.supaKey,{auth:{persistSession:!1},global:{headers:{capgkey:eY("capgkey",D)},...VA()&&F?{fetch:KA()}:{}}})}async function V2D(D,$){let{data:U}=await D.rpc("is_paying_org",{orgid:$}).single();return U||!1}async function B2D(D,$){let{data:U}=await D.rpc("is_trial_org",{orgid:$}).single();return U||0}async function K2D(D,$,U){let{data:X}=await D.rpc("has_usage_credits_org",U?{orgid:$,appid:U}:{orgid:$}).single();return X||!1}function w2D(D){let{trialDays:$,isPaying:U,hasCredits:X,warning:F=!0}=D;return!!F&&$>0&&!U&&!X}async function H2D(D,$){let{data:U,error:X}=await D.rpc("is_allowed_action_org",{orgid:$}).single();if(X)throw Error(`Cannot validate plan: ${I0(X)}`);return U===!0}async function eV(D,$,U,X){let{data:F,error:Q}=X?await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U,appid:X}):await D.rpc("is_allowed_action_org_action",{orgid:$,actions:U});if(Q){if(X&&Q.code==="PGRST202")return H2D(D,$);throw Error(`Cannot validate plan: ${I0(Q)}`)}return F===!0}async function L2D(D,$,U,X){if(X){if(await eV(D,$,U,X))return"allowed";if(await eV(D,$,U))return"permission_denied";return"billing_denied"}return await eV(D,$,U)?"allowed":"billing_denied"}async function O2D(D,$){throw p.error(`You need to upgrade your plan to continue to use capgo.
254
254
  Upgrade here: ${D}
255
255
  `),await X2D(D),new ND($)}async function N2D(){throw p.error("Cannot validate plan usage for this app. The API key may lack permission to read app billing details."),new ND("Plan validation permission denied")}async function qED(D,$,U){let{data:X,error:F}=await D.rpc("get_organization_cli_warnings",{orgid:$,cli_version:U});if(F){p.error(`Cannot get cli warnings: ${I0(F)}`);return}if(X.length>0){p.warn(`Found ${X.length} cli warnings for your organization.`);let Q=null;for(let Y of X){if(typeof Y!=="object"||typeof Y.message!=="string"||typeof Y.fatal!=="boolean"){p.error(`Invalid cli warning: ${Y}`);continue}let J=Y;if(J.fatal)p.error(`${J.message.replaceAll("\\n",`
256
256
  `)}`),Q=Error(J.message);else p.warn(`${J.message.replaceAll("\\n",`
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "8.59.0",
4
+ "version": "8.61.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -168,6 +168,7 @@
168
168
  "test:frame-fit-ios-shared": "bun test/test-frame-fit-ios-shared.mjs",
169
169
  "test:ios-confirm-app-id": "bun test/test-ios-confirm-app-id.mjs",
170
170
  "test:ios-create-new": "bun test/test-ios-create-new.mjs",
171
+ "test:ios-credential-action": "bun test/test-ios-credential-action.mjs",
171
172
  "test:ios-e2e": "bun test/test-ios-e2e.mjs",
172
173
  "test:ios-flow-contract": "bun test/test-ios-flow-contract.mjs",
173
174
  "test:ios-import-discovery": "bun test/test-ios-import-discovery.mjs",
@@ -186,9 +187,10 @@
186
187
  "test:android-version": "bun test/test-android-version.mjs",
187
188
  "test:platform-flow-contract": "bun test/test-platform-flow-contract.mjs",
188
189
  "test:tail-engine-shared": "bun test/test-tail-engine-shared.mjs",
189
- "test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation",
190
+ "test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:notify-app-ready-background && bun run test:bundle-validation && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:cordova-upload-mode && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && bun run test:credentials && bun run test:credentials-export && bun run test:ios-provisioning-map && bun run test:ios-provisioning-command && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:cli-help && bun run test:build-cache-payload && bun run test:build-cancellation && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:cli-headers && bun run test:min-cli-version && bun run test:authenticated-command-invocation && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test:app-add-exists && bun run test:app-add-getting-started && bun run test:app-list-output-text && bun run test:app-todo && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:cli-recovery && bun run test:create-supabase-client && bun run test:build-platform-selection && bun run test:builder-project-discovery && bun run test:builder-login-gate && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-monorepo-targeting && bun run test:init-app-conflict && bun run test:channel-list && bun run test:channel-add-exists && bun run test:wait-log && bun run test:init-guardrails && bun run test:init-upload-recovery && bun run test:init-replay && bun run test:init-telemetry && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-credential-action && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:android-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-gcp && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:2fa-compliance-network && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation",
190
191
  "test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
191
192
  "test:builder-project-discovery": "bun test/test-builder-project-discovery.mjs",
193
+ "test:builder-login-gate": "bun test/test-builder-login-gate.mjs",
192
194
  "test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
193
195
  "test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",
194
196
  "test:cicd-failure-help": "bun test/test-cicd-failure-help.mjs",
@@ -0,0 +1,15 @@
1
+ import type { BrowserLoginSession } from '../../init/browser-login.js';
2
+ export interface BuilderLoginOptions {
3
+ supaHost?: string;
4
+ supaAnon?: string;
5
+ }
6
+ export interface BuilderLoginServices {
7
+ browserAvailable: boolean;
8
+ validateExisting: (key: string) => Promise<void>;
9
+ getAccountEmail: (key: string) => Promise<string>;
10
+ savePasted: (key: string) => Promise<void>;
11
+ beginBrowser: (onUrl: (url: string) => void) => Promise<BrowserLoginSession>;
12
+ completeBrowser: (session: BrowserLoginSession, key: string) => Promise<void>;
13
+ }
14
+ export declare function resolveBuilderCandidateKey(explicitKey?: string): string | undefined;
15
+ export declare function createBuilderLoginServices(options?: BuilderLoginOptions): BuilderLoginServices;
@@ -1,5 +1,15 @@
1
1
  import type { AndroidOnboardingErrorCategory, AndroidOnboardingStep } from './android/types.js';
2
2
  import type { OnboardingErrorCategory, OnboardingStep, Platform } from './types.js';
3
+ export interface TrackBuilderOnboardingLoginInput {
4
+ apikey: string;
5
+ appId: string;
6
+ journeyId: string;
7
+ method: 'browser' | 'paste';
8
+ retryCount: number;
9
+ durationMs: number;
10
+ }
11
+ /** Login happens before platform and owner-org resolution. Send once a key is valid. */
12
+ export declare function trackBuilderOnboardingLogin(input: TrackBuilderOnboardingLoginInput): Promise<void>;
3
13
  export interface TrackBuilderOnboardingStepInput {
4
14
  apikey: string;
5
15
  appId: string;
@@ -17,7 +27,7 @@ export interface TrackBuilderOnboardingStepInput {
17
27
  errorCategory?: OnboardingErrorCategory | AndroidOnboardingErrorCategory;
18
28
  replaySessionId?: string;
19
29
  }
20
- export type BuilderOnboardingAction = 'resume_prompt_decision' | 'question_shown' | 'question_answered' | 'android_sa_method_selected' | 'android_sa_validation_recovery_selected' | 'android_sa_validation_result';
30
+ export type BuilderOnboardingAction = 'resume_prompt_decision' | 'question_shown' | 'question_answered' | 'question_skipped' | 'android_sa_method_selected' | 'android_sa_validation_recovery_selected' | 'android_sa_validation_result' | 'credential_verified' | 'credential_verification_failed';
21
31
  export interface TrackBuilderOnboardingActionInput {
22
32
  apikey: string;
23
33
  appId: string;
@@ -86,6 +86,8 @@ export declare const FilteredTextInput: FC<{
86
86
  */
87
87
  transform?: (value: string) => string;
88
88
  mask?: boolean;
89
+ /** Limit only the rendered mask; the full value is still submitted. */
90
+ maxMaskWidth?: number;
89
91
  /**
90
92
  * Pre-fills the input. Used when the user is editing an already-entered
91
93
  * value (e.g. fixing a typo in their ASC Key ID / Issuer ID after a
@@ -0,0 +1,5 @@
1
+ type DistributionChoice = 'app_store' | 'ad_hoc' | '__cancel__';
2
+ type TrackAction = (action: 'question_shown' | 'question_answered', tags: Record<string, string>) => void;
3
+ export declare function trackImportDistributionShown(journeyId: string, trackAction: TrackAction): void;
4
+ export declare function saveImportDistributionAnswer(save: () => Promise<void>, value: DistributionChoice, journeyId: string, trackAction: TrackAction): Promise<void>;
5
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { IosEffectResult } from '../ios/flow.js';
2
+ import type { BuilderOnboardingAction } from '../telemetry.js';
3
+ import type { OnboardingStep } from '../types.js';
4
+ type TrackAction = (action: BuilderOnboardingAction, tags: Record<string, string>, step: OnboardingStep) => void;
5
+ export declare function trackGuidedKeyValidationFailure(eventName: string, journeyId: string, trackAction: TrackAction, cancelled?: boolean): void;
6
+ export declare function verifyIosKeyWithTelemetry<T>(verify: () => Promise<T>, journeyId: string, trackAction: TrackAction, isCancelled: () => boolean): Promise<T>;
7
+ export declare function trackVerifiedIosKey(result: IosEffectResult, journeyId: string, trackAction: TrackAction): void;
8
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { FC, ReactNode } from 'react';
2
+ import type { BuilderLoginServices } from '../login.js';
3
+ type LoginMethod = 'browser' | 'paste';
4
+ export interface BuilderLoginMetadata {
5
+ method?: LoginMethod;
6
+ retryCount: number;
7
+ durationMs: number;
8
+ }
9
+ export interface BuilderLoginGateProps {
10
+ candidateKey?: string;
11
+ services: BuilderLoginServices;
12
+ cols: number;
13
+ rows: number;
14
+ footer?: ReactNode;
15
+ onAuthenticated: (key: string, metadata: BuilderLoginMetadata) => void;
16
+ onCancel: () => void;
17
+ }
18
+ declare const BuilderLoginGate: FC<BuilderLoginGateProps>;
19
+ export default BuilderLoginGate;
@@ -0,0 +1,8 @@
1
+ type TrackSkip = (action: 'question_skipped', tags: {
2
+ attempt_id: string;
3
+ question_id: string;
4
+ choice: string;
5
+ reason: string;
6
+ }, step: 'setup-method-select') => void;
7
+ export declare function routeFreshIosSetupMethod(onMac: boolean, journeyId: string, trackAction: TrackSkip): 'setup-method-select' | 'api-key-instructions';
8
+ export {};
@@ -1,5 +1,7 @@
1
1
  import type { FC } from 'react';
2
2
  import type { OnboardingResult, Platform } from '../types.js';
3
+ import type { BuilderLoginServices } from '../login.js';
4
+ import type { BuilderLoginMetadata } from './login-gate.js';
3
5
  import type { OnboardingBeforeExit } from './exit.js';
4
6
  export declare function useTerminalSize(): {
5
7
  cols: number;
@@ -27,6 +29,7 @@ export interface OnboardingShellProps {
27
29
  */
28
30
  guidedHelperUsable: boolean;
29
31
  apikey?: string;
32
+ loginServices: BuilderLoginServices;
30
33
  supaHost?: string;
31
34
  /** Custom Supabase anon key for self-hosting (--supa-anon). */
32
35
  supaAnon?: string;
@@ -57,6 +60,8 @@ export interface OnboardingShellProps {
57
60
  onResult?: (result: OnboardingResult) => void;
58
61
  /** Awaited immediately before Ink exits so replay can capture the alt-screen frame. */
59
62
  onBeforeExit?: OnboardingBeforeExit;
63
+ /** Called after the login gate has verified a key. */
64
+ onAuthenticated?: (key: string, metadata: BuilderLoginMetadata) => void;
60
65
  }
61
66
  declare const OnboardingShell: FC<OnboardingShellProps>;
62
67
  export default OnboardingShell;
@@ -2,6 +2,11 @@ import type { SaveKeyOptions } from '../auth/session';
2
2
  interface BrowserLoginOptions extends SaveKeyOptions {
3
3
  local: boolean;
4
4
  }
5
+ export interface BrowserLoginSession {
6
+ session: string;
7
+ url: string;
8
+ browserOpened: boolean;
9
+ }
5
10
  interface BrowserLoginEvent {
6
11
  channel: 'user-login';
7
12
  event: 'User CLI login';
@@ -22,5 +27,7 @@ interface BrowserLoginDependencies {
22
27
  writeUrl: (message: string) => void;
23
28
  }
24
29
  export declare function shouldStartInitBrowserLogin(resolvedKey: string | undefined, interactive: boolean): boolean;
30
+ export declare function beginBrowserLogin(onUrl: (url: string) => void, overrides?: Partial<BrowserLoginDependencies>): Promise<BrowserLoginSession>;
31
+ export declare function completeBrowserLogin(browserSession: BrowserLoginSession, key: string, options: BrowserLoginOptions, overrides?: Partial<BrowserLoginDependencies>): Promise<void>;
25
32
  export declare function loginInitInBrowser(options: BrowserLoginOptions, overrides?: Partial<BrowserLoginDependencies>): Promise<string>;
26
33
  export {};
@@ -127,9 +127,9 @@ export declare const onboardingNextStepSchema: z.ZodObject<{
127
127
  profileChoice: z.ZodOptional<z.ZodString>;
128
128
  importRecoveryAction: z.ZodOptional<z.ZodEnum<{
129
129
  create: "create";
130
+ browser: "browser";
130
131
  back: "back";
131
132
  "provide-profile-path": "provide-profile-path";
132
- browser: "browser";
133
133
  }>>;
134
134
  portalAction: z.ZodOptional<z.ZodEnum<{
135
135
  back: "back";