@capgo/cli 7.88.7 → 7.88.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.88.7",
4
+ "version": "7.88.8",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
package/dist/src/sdk.js CHANGED
@@ -127,7 +127,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
127
127
  `)}),$.__defineSetter__("stack",function(X){return[X].concat($.stack).join(`
128
128
 
129
129
  `)}),$}});var jx=T(($hD,Rx)=>{var d6=p("constants"),gQD=process.cwd,WJ=null,mQD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!WJ)WJ=gQD.call(process);return WJ};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(KJ=process.chdir,process.chdir=function(D){WJ=null,KJ.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,KJ)}var KJ;Rx.exports=cQD;function cQD(D){if(d6.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)X(D);if(D.chown=Q(D.chown),D.fchown=Q(D.fchown),D.lchown=Q(D.lchown),D.chmod=J(D.chmod),D.fchmod=J(D.fchmod),D.lchmod=J(D.lchmod),D.chownSync=F(D.chownSync),D.fchownSync=F(D.fchownSync),D.lchownSync=F(D.lchownSync),D.chmodSync=Y(D.chmodSync),D.fchmodSync=Y(D.fchmodSync),D.lchmodSync=Y(D.lchmodSync),D.stat=Z(D.stat),D.fstat=Z(D.fstat),D.lstat=Z(D.lstat),D.statSync=w(D.statSync),D.fstatSync=w(D.fstatSync),D.lstatSync=w(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(O,U,q){if(q)process.nextTick(q)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(O,U,q,z){if(z)process.nextTick(z)},D.lchownSync=function(){};if(mQD==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(O){function U(q,z,B){var W=Date.now(),L=0;O(q,z,function M(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-W<60000){if(setTimeout(function(){D.stat(z,function(K,V){if(K&&K.code==="ENOENT")O(q,z,M);else B(I)})},L),L<100)L+=10;return}if(B)B(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(U,O);return U}(D.rename);D.read=typeof D.read!=="function"?D.read:function(O){function U(q,z,B,W,L,M){var I;if(M&&typeof M==="function"){var K=0;I=function(V,N,R){if(V&&V.code==="EAGAIN"&&K<10)return K++,O.call(D,q,z,B,W,L,I);M.apply(this,arguments)}}return O.call(D,q,z,B,W,L,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(U,O);return U}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(O){return function(U,q,z,B,W){var L=0;while(!0)try{return O.call(D,U,q,z,B,W)}catch(M){if(M.code==="EAGAIN"&&L<10){L++;continue}throw M}}}(D.readSync);function $(O){O.lchmod=function(U,q,z){O.open(U,d6.O_WRONLY|d6.O_SYMLINK,q,function(B,W){if(B){if(z)z(B);return}O.fchmod(W,q,function(L){O.close(W,function(M){if(z)z(L||M)})})})},O.lchmodSync=function(U,q){var z=O.openSync(U,d6.O_WRONLY|d6.O_SYMLINK,q),B=!0,W;try{W=O.fchmodSync(z,q),B=!1}finally{if(B)try{O.closeSync(z)}catch(L){}else O.closeSync(z)}return W}}function X(O){if(d6.hasOwnProperty("O_SYMLINK")&&O.futimes)O.lutimes=function(U,q,z,B){O.open(U,d6.O_SYMLINK,function(W,L){if(W){if(B)B(W);return}O.futimes(L,q,z,function(M){O.close(L,function(I){if(B)B(M||I)})})})},O.lutimesSync=function(U,q,z){var B=O.openSync(U,d6.O_SYMLINK),W,L=!0;try{W=O.futimesSync(B,q,z),L=!1}finally{if(L)try{O.closeSync(B)}catch(M){}else O.closeSync(B)}return W};else if(O.futimes)O.lutimes=function(U,q,z,B){if(B)process.nextTick(B)},O.lutimesSync=function(){}}function J(O){if(!O)return O;return function(U,q,z){return O.call(D,U,q,function(B){if(G(B))B=null;if(z)z.apply(this,arguments)})}}function Y(O){if(!O)return O;return function(U,q){try{return O.call(D,U,q)}catch(z){if(!G(z))throw z}}}function Q(O){if(!O)return O;return function(U,q,z,B){return O.call(D,U,q,z,function(W){if(G(W))W=null;if(B)B.apply(this,arguments)})}}function F(O){if(!O)return O;return function(U,q,z){try{return O.call(D,U,q,z)}catch(B){if(!G(B))throw B}}}function Z(O){if(!O)return O;return function(U,q,z){if(typeof q==="function")z=q,q=null;function B(W,L){if(L){if(L.uid<0)L.uid+=4294967296;if(L.gid<0)L.gid+=4294967296}if(z)z.apply(this,arguments)}return q?O.call(D,U,q,B):O.call(D,U,B)}}function w(O){if(!O)return O;return function(U,q){var z=q?O.call(D,U,q):O.call(D,U);if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}return z}}function G(O){if(!O)return!0;if(O.code==="ENOSYS")return!0;var U=!process.getuid||process.getuid()!==0;if(U){if(O.code==="EINVAL"||O.code==="EPERM")return!0}return!1}}});var Cx=T((XhD,Tx)=>{var Ex=p("stream").Stream;Tx.exports=dQD;function dQD(D){return{ReadStream:$,WriteStream:X};function $(J,Y){if(!(this instanceof $))return new $(J,Y);Ex.call(this);var Q=this;this.path=J,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,Y=Y||{};var F=Object.keys(Y);for(var Z=0,w=F.length;Z<w;Z++){var G=F[Z];this[G]=Y[G]}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(O,U){if(O){Q.emit("error",O),Q.readable=!1;return}Q.fd=U,Q.emit("open",U),Q._read()})}function X(J,Y){if(!(this instanceof X))return new X(J,Y);Ex.call(this),this.path=J,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,Y=Y||{};var Q=Object.keys(Y);for(var F=0,Z=Q.length;F<Z;F++){var w=Q[F];this[w]=Y[w]}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 xx=T((YhD,Px)=>{Px.exports=nQD;var lQD=Object.getPrototypeOf||function(D){return D.__proto__};function nQD(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:lQD(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var S0=T((JhD,CU)=>{var M0=p("fs"),iQD=jx(),pQD=Cx(),rQD=xx(),HJ=p("util"),o0,NJ;if(typeof Symbol==="function"&&typeof Symbol.for==="function")o0=Symbol.for("graceful-fs.queue"),NJ=Symbol.for("graceful-fs.previous");else o0="___graceful-fs.queue",NJ="___graceful-fs.previous";function oQD(){}function ux(D,$){Object.defineProperty(D,o0,{get:function(){return $}})}var $8=oQD;if(HJ.debuglog)$8=HJ.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))$8=function(){var D=HJ.format.apply(HJ,arguments);D="GFS4: "+D.split(/\n/).join(`
130
- GFS4: `),console.error(D)};if(!M0[o0]){if(jU=global[o0]||[],ux(M0,jU),M0.close=function(D){function $(X,J){return D.call(M0,X,function(Y){if(!Y)Sx();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,NJ,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),Sx()}return Object.defineProperty($,NJ,{value:D}),$}(M0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(M0[o0]),p("assert").equal(M0[o0].length,0)})}var jU;if(!global[o0])ux(global,M0[o0]);CU.exports=EU(rQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)CU.exports=EU(M0),M0.__patched=!0;function EU(D){iQD(D),D.gracefulify=EU,D.createReadStream=N,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,u,x){if(typeof u==="function")x=u,u=null;return h(_,u,x);function h(b,l,f,j){return $(b,l,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))k9([h,[b,l,f],S,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return J(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var Z=D.copyFile;if(Z)D.copyFile=w;function w(_,u,x,h){if(typeof x==="function")h=x,x=0;return b(_,u,x,h);function b(l,f,j,S,v){return Z(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var G=D.readdir;D.readdir=U;var O=/^v[0-5]\./;function U(_,u,x){if(typeof u==="function")x=u,u=null;var h=O.test(process.version)?function(f,j,S,v){return G(f,b(f,j,S,v))}:function(f,j,S,v){return G(f,j,b(f,j,S,v))};return h(_,u,x);function b(l,f,j,S){return function(v,y){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))k9([h,[l,f,j],v,S||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,v,y)}}}}if(process.version.substr(0,4)==="v0.8"){var q=pQD(D);M=q.ReadStream,K=q.WriteStream}var z=D.ReadStream;if(z)M.prototype=Object.create(z.prototype),M.prototype.open=I;var B=D.WriteStream;if(B)K.prototype=Object.create(B.prototype),K.prototype.open=V;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var W=M;Object.defineProperty(D,"FileReadStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var L=K;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});function M(_,u){if(this instanceof M)return z.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(u,x){if(u){if(_.autoClose)_.destroy();_.emit("error",u)}else _.fd=x,_.emit("open",x),_.read()})}function K(_,u){if(this instanceof K)return B.apply(this,arguments),this;else return K.apply(Object.create(K.prototype),arguments)}function V(){var _=this;A(_.path,_.flags,_.mode,function(u,x){if(u)_.destroy(),_.emit("error",u);else _.fd=x,_.emit("open",x)})}function N(_,u){return new D.ReadStream(_,u)}function R(_,u){return new D.WriteStream(_,u)}var C=D.open;D.open=A;function A(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return C(l,f,j,function(y,g){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}return D}function k9(D){$8("ENQUEUE",D[0].name,D[1]),M0[o0].push(D),TU()}var VJ;function Sx(){var D=Date.now();for(var $=0;$<M0[o0].length;++$)if(M0[o0][$].length>2)M0[o0][$][3]=D,M0[o0][$][4]=D;TU()}function TU(){if(clearTimeout(VJ),VJ=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],Q=D[4];if(Y===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,J)}else{var Z=Date.now()-Q,w=Math.max(Q-Y,1),G=Math.min(w*1.2,100);if(Z>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else M0[o0].push(D)}if(VJ===void 0)VJ=setTimeout(TU,0)}});var _x=T((QhD,vx)=>{function e1(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)}vx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.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 X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var J=this,Y=setTimeout(function(){if(J._attempts++,J._operationTimeoutCb){if(J._timeout=setTimeout(function(){J._operationTimeoutCb(J._attempts)},J._operationTimeout),J._options.unref)J._timeout.unref()}J._fn(J._attempts)},X);if(this._options.unref)Y.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var J=0;J<this._errors.length;J++){var Y=this._errors[J],Q=Y.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=Y,X=F}return $}});var fx=T((tQD)=>{var aQD=_x();tQD.operation=function(D){var $=tQD.timeouts(D);return new aQD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};tQD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var J=[];for(var Y=0;Y<$.retries;Y++)J.push(this.createTimeout(Y,$));if(D&&D.forever&&!J.length)J.push(this.createTimeout(Y,$));return J.sort(function(Q,F){return Q-F}),J};tQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,J=Math.round(X*$.minTimeout*Math.pow($.factor,D));return J=Math.min(J,$.maxTimeout),J};tQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var J in D)if(typeof D[J]==="function")X.push(J)}for(var Y=0;Y<X.length;Y++){var Q=X[Y],F=D[Q];D[Q]=function(w){var G=tQD.operation($),O=Array.prototype.slice.call(arguments,1),U=O.pop();O.push(function(q){if(G.retry(q))return;if(q)arguments[0]=G.mainError();U.apply(this,arguments)}),G.attempt(function(){w.apply(D,O)})}.bind(D,F),D[Q].options=$}}});var yx=T((ZhD,LJ)=>{LJ.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")LJ.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")LJ.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var AJ=T((whD,y9)=>{var K0=global.process,X8=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(!X8(K0))y9.exports=function(){return function(){}};else{if(PU=p("assert"),Y8=yx(),xU=/^win/i.test(K0.platform),f9=p("events"),typeof f9!=="function")f9=f9.EventEmitter;if(K0.__signal_exit_emitter__)g0=K0.__signal_exit_emitter__;else g0=K0.__signal_exit_emitter__=new f9,g0.count=0,g0.emitted={};if(!g0.infinite)g0.setMaxListeners(1/0),g0.infinite=!0;y9.exports=function(D,$){if(!X8(global.process))return function(){};if(PU.equal(typeof D,"function","a callback must be provided for exit handler"),J8===!1)MJ();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)B3()};return g0.on(X,D),J},B3=function(){if(!J8||!X8(global.process))return;J8=!1,Y8.forEach(function($){try{K0.removeListener($,W3[$])}catch(X){}}),K0.emit=K3,K0.reallyExit=IJ,g0.count-=1},y9.exports.unload=B3,l6=function($,X,J){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,J)},W3={},Y8.forEach(function(D){W3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===g0.count){if(B3(),l6("exit",null,D),l6("afterexit",null,D),xU&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),y9.exports.signals=function(){return Y8},J8=!1,MJ=function(){if(J8||!X8(global.process))return;J8=!0,g0.count+=1,Y8=Y8.filter(function($){try{return K0.on($,W3[$]),!0}catch(X){return!1}}),K0.emit=uU,K0.reallyExit=SU},y9.exports.load=MJ,IJ=K0.reallyExit,SU=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),IJ.call(K0,K0.exitCode)},K3=K0.emit,uU=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var J=K3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),J}else return K3.apply(this,arguments)}}var PU,Y8,xU,f9,g0,B3,l6,W3,J8,MJ,IJ,SU,K3,uU});var hx=T((YFD,vU)=>{var bx=Symbol();function $FD(D,$,X){let J=$[bx];if(J)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,J)});let Y=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,Y,Y,(Q)=>{if(Q)return X(Q);$.stat(D,(F,Z)=>{if(F)return X(F);let w=Z.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,bx,{value:w}),X(null,Z.mtime,w)})})}function XFD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}YFD.probe=$FD;YFD.getMtime=XFD});var lx=T((qFD,V3)=>{var FFD=p("path"),fU=S0(),ZFD=fx(),wFD=AJ(),gx=hx(),Z6={};function H3(D,$){return $.lockfilePath||`${D}.lock`}function yU(D,$,X){if(!$.realpath)return X(null,FFD.resolve(D));$.fs.realpath(D,X)}function kU(D,$,X){let J=H3(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return gx.probe(J,$.fs,(Q,F,Z)=>{if(Q)return $.fs.rmdir(J,()=>{}),X(Q);X(null,F,Z)});if(Y.code!=="EEXIST")return X(Y);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(J,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return kU(D,{...$,stale:0},X);return X(Q)}if(!mx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));cx(D,$,(Z)=>{if(Z)return X(Z);kU(D,{...$,stale:0},X)})})})}function mx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function cx(D,$,X){$.fs.rmdir(H3(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function RJ(D,$){let X=Z6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(J,Y)=>{let Q=X.lastUpdate+$.stale<Date.now();if(J){if(J.code==="ENOENT"||Q)return _U(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RJ(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return _U(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let Z=gx.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,Z,Z,(w)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(w){if(w.code==="ENOENT"||G)return _U(D,X,Object.assign(w,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RJ(D,$)}X.mtime=Z,X.lastUpdate=Date.now(),X.updateDelay=null,RJ(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function _U(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Z6[D]===$)delete Z6[D];$.options.onCompromised(X)}function GFD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:fU,onCompromised:(J)=>{throw J},...$},$.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),yU(D,$,(J,Y)=>{if(J)return X(J);let Q=ZFD.operation($.retries);Q.attempt(()=>{kU(Y,$,(F,Z,w)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Z6[Y]={lockfilePath:H3(Y,$),mtime:Z,mtimePrecision:w,options:$,lastUpdate:Date.now()};RJ(Y,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dx(Y,{...$,realpath:!1},O)})})})})}function dx(D,$,X){$={fs:fU,realpath:!0,...$},yU(D,$,(J,Y)=>{if(J)return X(J);let Q=Z6[Y];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete Z6[Y],cx(Y,$,X)})}function OFD(D,$,X){$={stale:1e4,realpath:!0,fs:fU,...$},$.stale=Math.max($.stale||0,2000),yU(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(H3(Y,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!mx(F,$))})})}function UFD(){return Z6}wFD(()=>{for(let D in Z6){let $=Z6[D].options;try{$.fs.rmdirSync(H3(D,$))}catch(X){}}});qFD.lock=GFD;qFD.unlock=dx;qFD.check=OFD;qFD.getLocks=UFD});var ix=T((GhD,nx)=>{var HFD=S0();function VFD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let Q=Y.pop(),F;try{F=D[`${J}Sync`](...Y)}catch(Z){return Q(Z)}Q(null,F)}}),X}function NFD(D){return(...$)=>new Promise((X,J)=>{$.push((Y,Q)=>{if(Y)J(Y);else X(Q)}),D(...$)})}function LFD(D){return(...$)=>{let X,J;if($.push((Y,Q)=>{X=Y,J=Q}),D(...$),X)throw X;return J}}function MFD(D){if(D={...D},D.fs=VFD(D.fs||HFD),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}nx.exports={toPromise:NFD,toSync:LFD,toSyncOptions:MFD}});var rx=T((OhD,n6)=>{var b9=lx(),{toPromise:jJ,toSync:EJ,toSyncOptions:bU}=ix();async function px(D,$){let X=await jJ(b9.lock)(D,$);return jJ(X)}function IFD(D,$){let X=EJ(b9.lock)(D,bU($));return EJ(X)}function AFD(D,$){return jJ(b9.unlock)(D,$)}function RFD(D,$){return EJ(b9.unlock)(D,bU($))}function jFD(D,$){return jJ(b9.check)(D,$)}function EFD(D,$){return EJ(b9.check)(D,bU($))}n6.exports=px;n6.exports.lock=px;n6.exports.unlock=AFD;n6.exports.lockSync=IFD;n6.exports.unlockSync=RFD;n6.exports.check=jFD;n6.exports.checkSync=EFD});var $S=T((ex)=>{Object.defineProperty(ex,"__esModule",{value:!0});ex.canStoreURLs=ex.FileUrlStorage=void 0;var ox=p("fs"),TFD=PFD(Ax()),ax=CFD(rx());function sx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(sx=function(J){return J?X:$})(D)}function CFD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=sx($);if(X&&X.has(D))return X.get(D);var J={__proto__:null},Y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=Y?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(J,Q,F):J[Q]=D[Q]}return J.default=D,X&&X.set(D,J),J}function PFD(D){return D&&D.__esModule?D:{default:D}}function N3(D){return N3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},N3(D)}function xFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function tx(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,uFD(J.key),J)}}function SFD(D,$,X){if($)tx(D.prototype,$);if(X)tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function uFD(D){var $=vFD(D,"string");return N3($)=="symbol"?$:$+""}function vFD(D,$){if(N3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(N3(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var UhD=ex.canStoreURLs=!0,qhD=ex.FileUrlStorage=function(){function D($){xFD(this,D),this.path=$}return SFD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(Q,F){if(Q)Y(Q);else J(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,Q){J._getItems("tus::".concat(X),function(F,Z){if(F)Q(F);else Y(Z)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,Q){J._removeItem(X,function(F){if(F)Q(F);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(Z,w){Y._setItem(F,J,function(G){if(G)w(G);else Z(F)})})}},{key:"_setItem",value:function(X,J,Y){var Q=this;ax.lock(this.path,this._lockfileOptions()).then(function(F){Y=Q._releaseAndCb(F,Y),Q._getData(function(Z,w){if(Z){Y(Z);return}w[X]=J,Q._writeData(w,function(G){return Y(G)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,Q){if(Y){J(Y);return}var F=Object.keys(Q).filter(function(Z){return Z.startsWith(X)}).map(function(Z){var w=Q[Z];return w.urlStorageKey=Z,w});J(null,F)})}},{key:"_removeItem",value:function(X,J){var Y=this;ax.lock(this.path,this._lockfileOptions()).then(function(Q){J=Y._releaseAndCb(Q,J),Y._getData(function(F,Z){if(F){J(F);return}delete Z[X],Y._writeData(Z,function(w){return J(w)})})}).catch(J)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,J){return function(Y){if(Y){X().then(function(){return J(Y)}).catch(function(Q){return J((0,TFD.default)([Y,Q]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,ox.writeFile)(this.path,JSON.stringify(X),Y,function(Q){return J(Q)})}},{key:"_getData",value:function(X){(0,ox.readFile)(this.path,"utf8",function(J,Y){if(J){if(J.code==="ENOENT")X(null,{});else X(J);return}try{Y=!Y.trim().length?{}:JSON.parse(Y)}catch(Q){X(Q);return}X(null,Y)})}}])}()});var CJ=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return QS.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return kFD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return FS.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return gFD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return FS.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return fFD.enableDebugLog}});i6.isSupported=void 0;var kFD=Q8(bO()),fFD=hO(),yFD=Q8(rT()),hU=Q8(TC()),bFD=Q8(pC()),hFD=Q8(sC()),QS=Q8(BP()),gFD=Q8(aO()),FS=$S();function Q8(D){return D&&D.__esModule?D:{default:D}}function g9(D){return g9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},g9(D)}function mFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function XS(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,wS(J.key),J)}}function cFD(D,$,X){if($)XS(D.prototype,$);if(X)XS(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function dFD(D,$,X){return $=TJ($),lFD(D,ZS()?Reflect.construct($,X||[],TJ(D).constructor):$.apply(D,X))}function lFD(D,$){if($&&(g9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return nFD(D)}function nFD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function ZS(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(ZS=function(){return!!D})()}function TJ(D){return TJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},TJ(D)}function iFD(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}),$)gU(D,$)}function gU(D,$){return gU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},gU(D,$)}function YS(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);$&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor(D,Y).enumerable})),X.push.apply(X,J)}return X}function h9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?YS(Object(X),!0).forEach(function(J){pFD(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):YS(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function pFD(D,$,X){if($=wS($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function wS(D){var $=rFD(D,"string");return g9($)=="symbol"?$:$+""}function rFD(D,$){if(g9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(g9(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var JS=i6.defaultOptions=h9(h9({},hU.default.defaultOptions),{},{httpStack:new QS.default,fileReader:new bFD.default,urlStorage:new yFD.default,fingerprint:hFD.default}),BhD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mFD(this,$),J=h9(h9({},JS),J),dFD(this,$,[X,J])}return iFD($,D),cFD($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=h9(h9({},JS),Y),hU.default.terminate(J,Y)}}])}(hU.default),WhD=i6.isSupported=!0});var H$;var L3=o(()=>{H$={name:"@capgo/cli",type:"module",version:"7.88.7",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/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:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","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:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.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:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.5","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.79.0","@tanstack/intent":"^0.0.23","@types/adm-zip":"^0.5.7","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.0.0","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/react":"^18.3.28","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",partysocket:"^1.1.11",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",ws:"^8.18.3",zod:"^4.3.6"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^5.2.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.3.3",react:"^18.3.1"}}});async function PJ(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,J=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!J.ok)return null;return(await J.json())["dist-tags"]?.latest||null}catch{return null}}async function aFD(){let D=await PJ("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:H$.version,latestVersion:D,isOutdated:!!D&&D!==H$.version,majorVersion:$}}async function F0(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await aFD();if(D)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
130
+ GFS4: `),console.error(D)};if(!M0[o0]){if(jU=global[o0]||[],ux(M0,jU),M0.close=function(D){function $(X,J){return D.call(M0,X,function(Y){if(!Y)Sx();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,NJ,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),Sx()}return Object.defineProperty($,NJ,{value:D}),$}(M0.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){$8(M0[o0]),p("assert").equal(M0[o0].length,0)})}var jU;if(!global[o0])ux(global,M0[o0]);CU.exports=EU(rQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)CU.exports=EU(M0),M0.__patched=!0;function EU(D){iQD(D),D.gracefulify=EU,D.createReadStream=N,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,u,x){if(typeof u==="function")x=u,u=null;return h(_,u,x);function h(b,l,f,j){return $(b,l,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))k9([h,[b,l,f],S,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return J(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=F;function F(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return Q(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var Z=D.copyFile;if(Z)D.copyFile=w;function w(_,u,x,h){if(typeof x==="function")h=x,x=0;return b(_,u,x,h);function b(l,f,j,S,v){return Z(l,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var G=D.readdir;D.readdir=U;var O=/^v[0-5]\./;function U(_,u,x){if(typeof u==="function")x=u,u=null;var h=O.test(process.version)?function(f,j,S,v){return G(f,b(f,j,S,v))}:function(f,j,S,v){return G(f,j,b(f,j,S,v))};return h(_,u,x);function b(l,f,j,S){return function(v,y){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))k9([h,[l,f,j],v,S||Date.now(),Date.now()]);else{if(y&&y.sort)y.sort();if(typeof j==="function")j.call(this,v,y)}}}}if(process.version.substr(0,4)==="v0.8"){var q=pQD(D);M=q.ReadStream,K=q.WriteStream}var z=D.ReadStream;if(z)M.prototype=Object.create(z.prototype),M.prototype.open=I;var B=D.WriteStream;if(B)K.prototype=Object.create(B.prototype),K.prototype.open=V;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(_){M=_},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return K},set:function(_){K=_},enumerable:!0,configurable:!0});var W=M;Object.defineProperty(D,"FileReadStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});var L=K;Object.defineProperty(D,"FileWriteStream",{get:function(){return L},set:function(_){L=_},enumerable:!0,configurable:!0});function M(_,u){if(this instanceof M)return z.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(u,x){if(u){if(_.autoClose)_.destroy();_.emit("error",u)}else _.fd=x,_.emit("open",x),_.read()})}function K(_,u){if(this instanceof K)return B.apply(this,arguments),this;else return K.apply(Object.create(K.prototype),arguments)}function V(){var _=this;A(_.path,_.flags,_.mode,function(u,x){if(u)_.destroy(),_.emit("error",u);else _.fd=x,_.emit("open",x)})}function N(_,u){return new D.ReadStream(_,u)}function R(_,u){return new D.WriteStream(_,u)}var C=D.open;D.open=A;function A(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return C(l,f,j,function(y,g){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))k9([b,[l,f,j,S],y,v||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}return D}function k9(D){$8("ENQUEUE",D[0].name,D[1]),M0[o0].push(D),TU()}var VJ;function Sx(){var D=Date.now();for(var $=0;$<M0[o0].length;++$)if(M0[o0][$].length>2)M0[o0][$][3]=D,M0[o0][$][4]=D;TU()}function TU(){if(clearTimeout(VJ),VJ=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],Q=D[4];if(Y===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,J)}else{var Z=Date.now()-Q,w=Math.max(Q-Y,1),G=Math.min(w*1.2,100);if(Z>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else M0[o0].push(D)}if(VJ===void 0)VJ=setTimeout(TU,0)}});var _x=T((QhD,vx)=>{function e1(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)}vx.exports=e1;e1.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};e1.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};e1.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 X=this._timeouts.shift();if(X===void 0)if(this._cachedTimeouts)this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),X=this._timeouts.shift();else return!1;var J=this,Y=setTimeout(function(){if(J._attempts++,J._operationTimeoutCb){if(J._timeout=setTimeout(function(){J._operationTimeoutCb(J._attempts)},J._operationTimeout),J._options.unref)J._timeout.unref()}J._fn(J._attempts)},X);if(this._options.unref)Y.unref();return!0};e1.prototype.attempt=function(D,$){if(this._fn=D,$){if($.timeout)this._operationTimeout=$.timeout;if($.cb)this._operationTimeoutCb=$.cb}var X=this;if(this._operationTimeoutCb)this._timeout=setTimeout(function(){X._operationTimeoutCb()},X._operationTimeout);this._operationStart=new Date().getTime(),this._fn(this._attempts)};e1.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};e1.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};e1.prototype.start=e1.prototype.try;e1.prototype.errors=function(){return this._errors};e1.prototype.attempts=function(){return this._attempts};e1.prototype.mainError=function(){if(this._errors.length===0)return null;var D={},$=null,X=0;for(var J=0;J<this._errors.length;J++){var Y=this._errors[J],Q=Y.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=Y,X=F}return $}});var fx=T((tQD)=>{var aQD=_x();tQD.operation=function(D){var $=tQD.timeouts(D);return new aQD($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};tQD.timeouts=function(D){if(D instanceof Array)return[].concat(D);var $={retries:10,factor:2,minTimeout:1000,maxTimeout:1/0,randomize:!1};for(var X in D)$[X]=D[X];if($.minTimeout>$.maxTimeout)throw Error("minTimeout is greater than maxTimeout");var J=[];for(var Y=0;Y<$.retries;Y++)J.push(this.createTimeout(Y,$));if(D&&D.forever&&!J.length)J.push(this.createTimeout(Y,$));return J.sort(function(Q,F){return Q-F}),J};tQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,J=Math.round(X*$.minTimeout*Math.pow($.factor,D));return J=Math.min(J,$.maxTimeout),J};tQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var J in D)if(typeof D[J]==="function")X.push(J)}for(var Y=0;Y<X.length;Y++){var Q=X[Y],F=D[Q];D[Q]=function(w){var G=tQD.operation($),O=Array.prototype.slice.call(arguments,1),U=O.pop();O.push(function(q){if(G.retry(q))return;if(q)arguments[0]=G.mainError();U.apply(this,arguments)}),G.attempt(function(){w.apply(D,O)})}.bind(D,F),D[Q].options=$}}});var yx=T((ZhD,LJ)=>{LJ.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")LJ.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")LJ.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var AJ=T((whD,y9)=>{var K0=global.process,X8=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(!X8(K0))y9.exports=function(){return function(){}};else{if(PU=p("assert"),Y8=yx(),xU=/^win/i.test(K0.platform),f9=p("events"),typeof f9!=="function")f9=f9.EventEmitter;if(K0.__signal_exit_emitter__)g0=K0.__signal_exit_emitter__;else g0=K0.__signal_exit_emitter__=new f9,g0.count=0,g0.emitted={};if(!g0.infinite)g0.setMaxListeners(1/0),g0.infinite=!0;y9.exports=function(D,$){if(!X8(global.process))return function(){};if(PU.equal(typeof D,"function","a callback must be provided for exit handler"),J8===!1)MJ();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)B3()};return g0.on(X,D),J},B3=function(){if(!J8||!X8(global.process))return;J8=!1,Y8.forEach(function($){try{K0.removeListener($,W3[$])}catch(X){}}),K0.emit=K3,K0.reallyExit=IJ,g0.count-=1},y9.exports.unload=B3,l6=function($,X,J){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,J)},W3={},Y8.forEach(function(D){W3[D]=function(){if(!X8(global.process))return;var X=K0.listeners(D);if(X.length===g0.count){if(B3(),l6("exit",null,D),l6("afterexit",null,D),xU&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),y9.exports.signals=function(){return Y8},J8=!1,MJ=function(){if(J8||!X8(global.process))return;J8=!0,g0.count+=1,Y8=Y8.filter(function($){try{return K0.on($,W3[$]),!0}catch(X){return!1}}),K0.emit=uU,K0.reallyExit=SU},y9.exports.load=MJ,IJ=K0.reallyExit,SU=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),IJ.call(K0,K0.exitCode)},K3=K0.emit,uU=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var J=K3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),J}else return K3.apply(this,arguments)}}var PU,Y8,xU,f9,g0,B3,l6,W3,J8,MJ,IJ,SU,K3,uU});var hx=T((YFD,vU)=>{var bx=Symbol();function $FD(D,$,X){let J=$[bx];if(J)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,J)});let Y=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,Y,Y,(Q)=>{if(Q)return X(Q);$.stat(D,(F,Z)=>{if(F)return X(F);let w=Z.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,bx,{value:w}),X(null,Z.mtime,w)})})}function XFD(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}YFD.probe=$FD;YFD.getMtime=XFD});var lx=T((qFD,V3)=>{var FFD=p("path"),fU=S0(),ZFD=fx(),wFD=AJ(),gx=hx(),Z6={};function H3(D,$){return $.lockfilePath||`${D}.lock`}function yU(D,$,X){if(!$.realpath)return X(null,FFD.resolve(D));$.fs.realpath(D,X)}function kU(D,$,X){let J=H3(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return gx.probe(J,$.fs,(Q,F,Z)=>{if(Q)return $.fs.rmdir(J,()=>{}),X(Q);X(null,F,Z)});if(Y.code!=="EEXIST")return X(Y);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(J,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return kU(D,{...$,stale:0},X);return X(Q)}if(!mx(F,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));cx(D,$,(Z)=>{if(Z)return X(Z);kU(D,{...$,stale:0},X)})})})}function mx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function cx(D,$,X){$.fs.rmdir(H3(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function RJ(D,$){let X=Z6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(J,Y)=>{let Q=X.lastUpdate+$.stale<Date.now();if(J){if(J.code==="ENOENT"||Q)return _U(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RJ(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return _U(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let Z=gx.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,Z,Z,(w)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(w){if(w.code==="ENOENT"||G)return _U(D,X,Object.assign(w,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RJ(D,$)}X.mtime=Z,X.lastUpdate=Date.now(),X.updateDelay=null,RJ(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function _U(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(Z6[D]===$)delete Z6[D];$.options.onCompromised(X)}function GFD(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:fU,onCompromised:(J)=>{throw J},...$},$.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),yU(D,$,(J,Y)=>{if(J)return X(J);let Q=ZFD.operation($.retries);Q.attempt(()=>{kU(Y,$,(F,Z,w)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Z6[Y]={lockfilePath:H3(Y,$),mtime:Z,mtimePrecision:w,options:$,lastUpdate:Date.now()};RJ(Y,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dx(Y,{...$,realpath:!1},O)})})})})}function dx(D,$,X){$={fs:fU,realpath:!0,...$},yU(D,$,(J,Y)=>{if(J)return X(J);let Q=Z6[Y];if(!Q)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));Q.updateTimeout&&clearTimeout(Q.updateTimeout),Q.released=!0,delete Z6[Y],cx(Y,$,X)})}function OFD(D,$,X){$={stale:1e4,realpath:!0,fs:fU,...$},$.stale=Math.max($.stale||0,2000),yU(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(H3(Y,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!mx(F,$))})})}function UFD(){return Z6}wFD(()=>{for(let D in Z6){let $=Z6[D].options;try{$.fs.rmdirSync(H3(D,$))}catch(X){}}});qFD.lock=GFD;qFD.unlock=dx;qFD.check=OFD;qFD.getLocks=UFD});var ix=T((GhD,nx)=>{var HFD=S0();function VFD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let Q=Y.pop(),F;try{F=D[`${J}Sync`](...Y)}catch(Z){return Q(Z)}Q(null,F)}}),X}function NFD(D){return(...$)=>new Promise((X,J)=>{$.push((Y,Q)=>{if(Y)J(Y);else X(Q)}),D(...$)})}function LFD(D){return(...$)=>{let X,J;if($.push((Y,Q)=>{X=Y,J=Q}),D(...$),X)throw X;return J}}function MFD(D){if(D={...D},D.fs=VFD(D.fs||HFD),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}nx.exports={toPromise:NFD,toSync:LFD,toSyncOptions:MFD}});var rx=T((OhD,n6)=>{var b9=lx(),{toPromise:jJ,toSync:EJ,toSyncOptions:bU}=ix();async function px(D,$){let X=await jJ(b9.lock)(D,$);return jJ(X)}function IFD(D,$){let X=EJ(b9.lock)(D,bU($));return EJ(X)}function AFD(D,$){return jJ(b9.unlock)(D,$)}function RFD(D,$){return EJ(b9.unlock)(D,bU($))}function jFD(D,$){return jJ(b9.check)(D,$)}function EFD(D,$){return EJ(b9.check)(D,bU($))}n6.exports=px;n6.exports.lock=px;n6.exports.unlock=AFD;n6.exports.lockSync=IFD;n6.exports.unlockSync=RFD;n6.exports.check=jFD;n6.exports.checkSync=EFD});var $S=T((ex)=>{Object.defineProperty(ex,"__esModule",{value:!0});ex.canStoreURLs=ex.FileUrlStorage=void 0;var ox=p("fs"),TFD=PFD(Ax()),ax=CFD(rx());function sx(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(sx=function(J){return J?X:$})(D)}function CFD(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=sx($);if(X&&X.has(D))return X.get(D);var J={__proto__:null},Y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=Y?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(J,Q,F):J[Q]=D[Q]}return J.default=D,X&&X.set(D,J),J}function PFD(D){return D&&D.__esModule?D:{default:D}}function N3(D){return N3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},N3(D)}function xFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function tx(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,uFD(J.key),J)}}function SFD(D,$,X){if($)tx(D.prototype,$);if(X)tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function uFD(D){var $=vFD(D,"string");return N3($)=="symbol"?$:$+""}function vFD(D,$){if(N3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(N3(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var UhD=ex.canStoreURLs=!0,qhD=ex.FileUrlStorage=function(){function D($){xFD(this,D),this.path=$}return SFD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(Q,F){if(Q)Y(Q);else J(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,Q){J._getItems("tus::".concat(X),function(F,Z){if(F)Q(F);else Y(Z)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,Q){J._removeItem(X,function(F){if(F)Q(F);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(Z,w){Y._setItem(F,J,function(G){if(G)w(G);else Z(F)})})}},{key:"_setItem",value:function(X,J,Y){var Q=this;ax.lock(this.path,this._lockfileOptions()).then(function(F){Y=Q._releaseAndCb(F,Y),Q._getData(function(Z,w){if(Z){Y(Z);return}w[X]=J,Q._writeData(w,function(G){return Y(G)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,Q){if(Y){J(Y);return}var F=Object.keys(Q).filter(function(Z){return Z.startsWith(X)}).map(function(Z){var w=Q[Z];return w.urlStorageKey=Z,w});J(null,F)})}},{key:"_removeItem",value:function(X,J){var Y=this;ax.lock(this.path,this._lockfileOptions()).then(function(Q){J=Y._releaseAndCb(Q,J),Y._getData(function(F,Z){if(F){J(F);return}delete Z[X],Y._writeData(Z,function(w){return J(w)})})}).catch(J)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,J){return function(Y){if(Y){X().then(function(){return J(Y)}).catch(function(Q){return J((0,TFD.default)([Y,Q]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,ox.writeFile)(this.path,JSON.stringify(X),Y,function(Q){return J(Q)})}},{key:"_getData",value:function(X){(0,ox.readFile)(this.path,"utf8",function(J,Y){if(J){if(J.code==="ENOENT")X(null,{});else X(J);return}try{Y=!Y.trim().length?{}:JSON.parse(Y)}catch(Q){X(Q);return}X(null,Y)})}}])}()});var CJ=T((i6)=>{Object.defineProperty(i6,"__esModule",{value:!0});Object.defineProperty(i6,"DefaultHttpStack",{enumerable:!0,get:function(){return QS.default}});Object.defineProperty(i6,"DetailedError",{enumerable:!0,get:function(){return kFD.default}});Object.defineProperty(i6,"FileUrlStorage",{enumerable:!0,get:function(){return FS.FileUrlStorage}});Object.defineProperty(i6,"StreamSource",{enumerable:!0,get:function(){return gFD.default}});i6.Upload=void 0;Object.defineProperty(i6,"canStoreURLs",{enumerable:!0,get:function(){return FS.canStoreURLs}});i6.defaultOptions=void 0;Object.defineProperty(i6,"enableDebugLog",{enumerable:!0,get:function(){return fFD.enableDebugLog}});i6.isSupported=void 0;var kFD=Q8(bO()),fFD=hO(),yFD=Q8(rT()),hU=Q8(TC()),bFD=Q8(pC()),hFD=Q8(sC()),QS=Q8(BP()),gFD=Q8(aO()),FS=$S();function Q8(D){return D&&D.__esModule?D:{default:D}}function g9(D){return g9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},g9(D)}function mFD(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function XS(D,$){for(var X=0;X<$.length;X++){var J=$[X];if(J.enumerable=J.enumerable||!1,J.configurable=!0,"value"in J)J.writable=!0;Object.defineProperty(D,wS(J.key),J)}}function cFD(D,$,X){if($)XS(D.prototype,$);if(X)XS(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function dFD(D,$,X){return $=TJ($),lFD(D,ZS()?Reflect.construct($,X||[],TJ(D).constructor):$.apply(D,X))}function lFD(D,$){if($&&(g9($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return nFD(D)}function nFD(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function ZS(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return(ZS=function(){return!!D})()}function TJ(D){return TJ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},TJ(D)}function iFD(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}),$)gU(D,$)}function gU(D,$){return gU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},gU(D,$)}function YS(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var J=Object.getOwnPropertySymbols(D);$&&(J=J.filter(function(Y){return Object.getOwnPropertyDescriptor(D,Y).enumerable})),X.push.apply(X,J)}return X}function h9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?YS(Object(X),!0).forEach(function(J){pFD(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):YS(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function pFD(D,$,X){if($=wS($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function wS(D){var $=rFD(D,"string");return g9($)=="symbol"?$:$+""}function rFD(D,$){if(g9(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(g9(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var JS=i6.defaultOptions=h9(h9({},hU.default.defaultOptions),{},{httpStack:new QS.default,fileReader:new bFD.default,urlStorage:new yFD.default,fingerprint:hFD.default}),BhD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mFD(this,$),J=h9(h9({},JS),J),dFD(this,$,[X,J])}return iFD($,D),cFD($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=h9(h9({},JS),Y),hU.default.terminate(J,Y)}}])}(hU.default),WhD=i6.isSupported=!0});var H$;var L3=o(()=>{H$={name:"@capgo/cli",type:"module",version:"7.88.8",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/CLI#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/CLI.git"},bugs:{url:"https://github.com/Cap-go/CLI/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:"npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsc --noEmit",lint:'eslint "src/**/*.ts" --fix',"check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test:bundle":"bun test/test-bundle.mjs","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:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:esm-sdk":"node test/test-sdk-esm.mjs","test:mcp":"node test/test-mcp.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:payload-split":"bun test/test-payload-split.mjs",test:"bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:credentials && bun run test:credentials-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"},devDependencies:{"@antfu/eslint-config":"^7.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.5","@capacitor/cli":"^8.0.0","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.0.0","@modelcontextprotocol/sdk":"^1.25.3","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.79.0","@tanstack/intent":"^0.0.23","@types/adm-zip":"^0.5.7","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.0.0","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/react":"^18.3.28","@types/tmp":"^0.2.6","@vercel/ncc":"^0.38.4","adm-zip":"^0.5.16","ci-info":"^4.3.1",commander:"^14.0.2",eslint:"^9.38.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.0",micromatch:"^4.0.8",open:"^11.0.0",partysocket:"^1.1.11",prettyjson:"^1.2.5",tmp:"^0.2.5","tus-js-client":"^4.3.1",typescript:"^5.9.3",ws:"^8.18.3",zod:"^4.3.6"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^5.2.1","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.3.3",react:"^18.3.1"}}});async function PJ(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,J=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!J.ok)return null;return(await J.json())["dist-tags"]?.latest||null}catch{return null}}async function aFD(){let D=await PJ("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:H$.version,latestVersion:D,isOutdated:!!D&&D!==H$.version,majorVersion:$}}async function F0(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await aFD();if(D)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
131
131
  Please use @capgo/cli@${X}" or @capgo/cli@${J} to keep up to date with the latest features and bug fixes.`)}var U1=o(()=>{vD();L3()});async function qS(D,$,X,J,Y,Q="✅"){await AD(X,{channel:D,event:J,icon:Q,user_id:$,...Y?{tags:{"app-id":Y}}:{},notify:!1})}var zS=o(()=>{vD();D6();U1();kD()});import{Buffer as BS}from"node:buffer";import{createHash as tFD}from"node:crypto";function eFD(D){let $=4294967295;for(let X=0;X<D.length;X++){let J=D[X];$=sFD[($^J)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function p6(D,$="sha256"){let X=BS.isBuffer(D)?D:BS.from(D);if($==="crc32")return eFD(X);let J=tFD($);return J.update(X),J.digest("hex")}var sFD;var M3=o(()=>{sFD=(()=>{let D=[];for(let $=0;$<256;$++){let X=$;for(let J=0;J<8;J++)X=X&1?3988292384^X>>>1:X>>>1;D[$]=X}return D})()});var KS=T((ShD,WS)=>{var m9=1000,c9=m9*60,d9=c9*60,F8=d9*24,DZD=F8*7,$ZD=F8*365.25;WS.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return XZD(D);else if(X==="number"&&isFinite(D))return $.long?JZD(D):YZD(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function XZD(D){if(D=String(D),D.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(D);if(!$)return;var X=parseFloat($[1]),J=($[2]||"ms").toLowerCase();switch(J){case"years":case"year":case"yrs":case"yr":case"y":return X*$ZD;case"weeks":case"week":case"w":return X*DZD;case"days":case"day":case"d":return X*F8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*d9;case"minutes":case"minute":case"mins":case"min":case"m":return X*c9;case"seconds":case"second":case"secs":case"sec":case"s":return X*m9;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function YZD(D){var $=Math.abs(D);if($>=F8)return Math.round(D/F8)+"d";if($>=d9)return Math.round(D/d9)+"h";if($>=c9)return Math.round(D/c9)+"m";if($>=m9)return Math.round(D/m9)+"s";return D+"ms"}function JZD(D){var $=Math.abs(D);if($>=F8)return xJ(D,$,F8,"day");if($>=d9)return xJ(D,$,d9,"hour");if($>=c9)return xJ(D,$,c9,"minute");if($>=m9)return xJ(D,$,m9,"second");return D+" ms"}function xJ(D,$,X,J){var Y=$>=X*1.5;return Math.round(D/X)+" "+J+(Y?"s":"")}});var mU=T((uhD,HS)=>{function QZD(D){X.debug=X,X.default=X,X.coerce=w,X.disable=F,X.enable=Y,X.enabled=Z,X.humanize=KS(),X.destroy=G,Object.keys(D).forEach((O)=>{X[O]=D[O]}),X.names=[],X.skips=[],X.formatters={};function $(O){let U=0;for(let q=0;q<O.length;q++)U=(U<<5)-U+O.charCodeAt(q),U|=0;return X.colors[Math.abs(U)%X.colors.length]}X.selectColor=$;function X(O){let U,q=null,z,B;function W(...L){if(!W.enabled)return;let M=W,I=Number(new Date),K=I-(U||I);if(M.diff=K,M.prev=U,M.curr=I,U=I,L[0]=X.coerce(L[0]),typeof L[0]!=="string")L.unshift("%O");let V=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(R,C)=>{if(R==="%%")return"%";V++;let A=X.formatters[C];if(typeof A==="function"){let _=L[V];R=A.call(M,_),L.splice(V,1),V--}return R}),X.formatArgs.call(M,L),(M.log||X.log).apply(M,L)}if(W.namespace=O,W.useColors=X.useColors(),W.color=X.selectColor(O),W.extend=J,W.destroy=X.destroy,Object.defineProperty(W,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(q!==null)return q;if(z!==X.namespaces)z=X.namespaces,B=X.enabled(O);return B},set:(L)=>{q=L}}),typeof X.init==="function")X.init(W);return W}function J(O,U){let q=X(this.namespace+(typeof U>"u"?":":U)+O);return q.log=this.log,q}function Y(O){X.save(O),X.namespaces=O,X.names=[],X.skips=[];let U=(typeof O==="string"?O:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let q of U)if(q[0]==="-")X.skips.push(q.slice(1));else X.names.push(q)}function Q(O,U){let q=0,z=0,B=-1,W=0;while(q<O.length)if(z<U.length&&(U[z]===O[q]||U[z]==="*"))if(U[z]==="*")B=z,W=q,z++;else q++,z++;else if(B!==-1)z=B+1,W++,q=W;else return!1;while(z<U.length&&U[z]==="*")z++;return z===U.length}function F(){let O=[...X.names,...X.skips.map((U)=>"-"+U)].join(",");return X.enable(""),O}function Z(O){for(let U of X.skips)if(Q(O,U))return!1;for(let U of X.names)if(Q(O,U))return!0;return!1}function w(O){if(O instanceof Error)return O.stack||O.message;return O}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}HS.exports=QZD});var NS=T((VS,SJ)=>{VS.formatArgs=ZZD;VS.save=wZD;VS.load=GZD;VS.useColors=FZD;VS.storage=OZD();VS.destroy=(()=>{let D=!1;return()=>{if(!D)D=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();VS.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function FZD(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let D;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(D=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(D[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ZZD(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+SJ.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let X=0,J=0;D[0].replace(/%[a-zA-Z%]/g,(Y)=>{if(Y==="%%")return;if(X++,Y==="%c")J=X}),D.splice(J,0,$)}VS.log=console.debug||console.log||(()=>{});function wZD(D){try{if(D)VS.storage.setItem("debug",D);else VS.storage.removeItem("debug")}catch($){}}function GZD(){let D;try{D=VS.storage.getItem("debug")||VS.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function OZD(){try{return localStorage}catch(D){}}SJ.exports=mU()(VS);var{formatters:UZD}=SJ.exports;UZD.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var MS=T((_hD,LS)=>{LS.exports=(D,$=process.argv)=>{let X=D.startsWith("-")?"":D.length===1?"-":"--",J=$.indexOf(X+D),Y=$.indexOf("--");return J!==-1&&(Y===-1||J<Y)}});var RS=T((khD,AS)=>{var NZD=p("os"),IS=p("tty"),D$=MS(),{env:n0}=process,r6;if(D$("no-color")||D$("no-colors")||D$("color=false")||D$("color=never"))r6=0;else if(D$("color")||D$("colors")||D$("color=true")||D$("color=always"))r6=1;if("FORCE_COLOR"in n0)if(n0.FORCE_COLOR==="true")r6=1;else if(n0.FORCE_COLOR==="false")r6=0;else r6=n0.FORCE_COLOR.length===0?1:Math.min(parseInt(n0.FORCE_COLOR,10),3);function cU(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function dU(D,$){if(r6===0)return 0;if(D$("color=16m")||D$("color=full")||D$("color=truecolor"))return 3;if(D$("color=256"))return 2;if(D&&!$&&r6===void 0)return 0;let X=r6||0;if(n0.TERM==="dumb")return X;if(process.platform==="win32"){let J=NZD.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in n0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((J)=>(J in n0))||n0.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in n0)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n0.TEAMCITY_VERSION)?1:0;if(n0.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in n0){let J=parseInt((n0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n0.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(n0.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n0.TERM))return 1;if("COLORTERM"in n0)return 1;return X}function LZD(D){let $=dU(D,D&&D.isTTY);return cU($)}AS.exports={supportsColor:LZD,stdout:cU(dU(!0,IS.isatty(1))),stderr:cU(dU(!0,IS.isatty(2)))}});var CS=T((ES,vJ)=>{var MZD=p("tty"),uJ=p("util");ES.init=CZD;ES.log=jZD;ES.formatArgs=AZD;ES.save=EZD;ES.load=TZD;ES.useColors=IZD;ES.destroy=uJ.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ES.colors=[6,2,3,4,5,1];try{let D=RS();if(D&&(D.stderr||D).level>=2)ES.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(D){}ES.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let X=$.substring(6).toLowerCase().replace(/_([a-z])/g,(Y,Q)=>{return Q.toUpperCase()}),J=process.env[$];if(/^(yes|on|true|enabled)$/i.test(J))J=!0;else if(/^(no|off|false|disabled)$/i.test(J))J=!1;else if(J==="null")J=null;else J=Number(J);return D[X]=J,D},{});function IZD(){return"colors"in ES.inspectOpts?Boolean(ES.inspectOpts.colors):MZD.isatty(process.stderr.fd)}function AZD(D){let{namespace:$,useColors:X}=this;if(X){let J=this.color,Y="\x1B[3"+(J<8?J:"8;5;"+J),Q=` ${Y};1m${$} \x1B[0m`;D[0]=Q+D[0].split(`
132
132
  `).join(`
133
133
  `+Q),D.push(Y+"m+"+vJ.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=RZD()+$+" "+D[0]}function RZD(){if(ES.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function jZD(...D){return process.stderr.write(uJ.formatWithOptions(ES.inspectOpts,...D)+`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "7.88.7",
4
+ "version": "7.88.8",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",