@capgo/cli 7.92.1 → 7.93.1
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/README.md +6 -0
- package/dist/index.js +388 -384
- package/dist/package.json +3 -2
- package/dist/src/build/onboarding/command.d.ts +4 -1
- package/dist/src/build/onboarding/recovery.d.ts +7 -0
- package/dist/src/build/onboarding/types.d.ts +1 -1
- package/dist/src/build/onboarding/ui/app.d.ts +2 -0
- package/dist/src/onboarding-support.d.ts +18 -0
- package/dist/src/runner-command.d.ts +5 -0
- package/dist/src/sdk.js +1 -1
- package/dist/src/utils.d.ts +1 -0
- package/package.json +3 -2
- package/skills/native-builds/SKILL.md +5 -0
- package/skills/usage/SKILL.md +2 -2
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.93.1",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"test:build-zip-filter": "bun test/test-build-zip-filter.mjs",
|
|
73
73
|
"test:checksum": "bun test/test-checksum-algorithm.mjs",
|
|
74
74
|
"test:ci-prompts": "bun test/test-ci-prompts.mjs",
|
|
75
|
+
"test:onboarding-recovery": "bun test/test-onboarding-recovery.mjs",
|
|
75
76
|
"test:prompt-preferences": "bun test/test-prompt-preferences.mjs",
|
|
76
77
|
"test:esm-sdk": "node test/test-sdk-esm.mjs",
|
|
77
78
|
"test:mcp": "node test/test-mcp.mjs",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"test:version-detection:setup": "./test/fixtures/setup-test-projects.sh",
|
|
80
81
|
"test:platform-paths": "bun test/test-platform-paths.mjs",
|
|
81
82
|
"test:payload-split": "bun test/test-payload-split.mjs",
|
|
82
|
-
"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:ci-prompts && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"
|
|
83
|
+
"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:ci-prompts && bun run test:onboarding-recovery && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
86
|
"@antfu/eslint-config": "^7.0.0",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { OnboardingStep } from './types.js';
|
|
2
|
+
export interface BuildOnboardingRecoveryAdvice {
|
|
3
|
+
summary: string[];
|
|
4
|
+
commands: string[];
|
|
5
|
+
docs: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function getBuildOnboardingRecoveryAdvice(message: string, step: OnboardingStep | null, pmRunner: string, appId: string): BuildOnboardingRecoveryAdvice;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type Platform = 'ios' | 'android';
|
|
2
|
-
export type OnboardingStep = 'welcome' | 'platform-select' | 'credentials-exist' | 'backing-up' | 'api-key-instructions' | 'p8-method-select' | 'input-p8-path' | 'input-key-id' | 'input-issuer-id' | 'verifying-key' | 'creating-certificate' | 'cert-limit-prompt' | 'revoking-certificate' | 'creating-profile' | 'duplicate-profile-prompt' | 'deleting-duplicate-profiles' | 'saving-credentials' | 'ask-build' | 'requesting-build' | 'build-complete' | 'no-platform' | 'error';
|
|
2
|
+
export type OnboardingStep = 'welcome' | 'platform-select' | 'adding-platform' | 'credentials-exist' | 'backing-up' | 'api-key-instructions' | 'p8-method-select' | 'input-p8-path' | 'input-key-id' | 'input-issuer-id' | 'verifying-key' | 'creating-certificate' | 'cert-limit-prompt' | 'revoking-certificate' | 'creating-profile' | 'duplicate-profile-prompt' | 'deleting-duplicate-profiles' | 'saving-credentials' | 'ask-build' | 'requesting-build' | 'build-complete' | 'no-platform' | 'error';
|
|
3
3
|
export interface ApiKeyData {
|
|
4
4
|
keyId: string;
|
|
5
5
|
issuerId: string;
|
|
@@ -5,6 +5,8 @@ interface AppProps {
|
|
|
5
5
|
initialProgress: OnboardingProgress | null;
|
|
6
6
|
/** Resolved iOS directory from capacitor.config (defaults to 'ios') */
|
|
7
7
|
iosDir: string;
|
|
8
|
+
/** Optional Capgo API key passed via -a/--apikey flag; takes precedence over saved key */
|
|
9
|
+
apikey?: string;
|
|
8
10
|
}
|
|
9
11
|
declare const OnboardingApp: FC<AppProps>;
|
|
10
12
|
export default OnboardingApp;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface OnboardingSupportSection {
|
|
2
|
+
title: string;
|
|
3
|
+
lines: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface OnboardingSupportBundleInput {
|
|
6
|
+
kind: 'init' | 'build-init';
|
|
7
|
+
error: string;
|
|
8
|
+
appId?: string;
|
|
9
|
+
currentStep?: string;
|
|
10
|
+
packageManager?: string;
|
|
11
|
+
cwd?: string;
|
|
12
|
+
commands?: string[];
|
|
13
|
+
docs?: string[];
|
|
14
|
+
logs?: string[];
|
|
15
|
+
sections?: OnboardingSupportSection[];
|
|
16
|
+
}
|
|
17
|
+
export declare function renderOnboardingSupportBundle(input: OnboardingSupportBundleInput): string;
|
|
18
|
+
export declare function writeOnboardingSupportBundle(input: OnboardingSupportBundleInput, supportDir?: string): string | null;
|
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 Nx=E((Ip0,Vx)=>{var e6=l("constants"),tO0=process.cwd,aY=null,aO0=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!aY)aY=tO0.call(process);return aY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(sY=process.chdir,process.chdir=function(D){aY=null,sY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,sY)}var sY;Vx.exports=sO0;function sO0(D){if(e6.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=U(D.chownSync),D.fchownSync=U(D.fchownSync),D.lchownSync=U(D.lchownSync),D.chmodSync=Y(D.chmodSync),D.fchmodSync=Y(D.fchmodSync),D.lchmodSync=Y(D.lchmodSync),D.stat=F(D.stat),D.fstat=F(D.fstat),D.lstat=F(D.lstat),D.statSync=Z(D.statSync),D.fstatSync=Z(D.fstatSync),D.lstatSync=Z(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(G,q,w){if(w)process.nextTick(w)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(G,q,w,B){if(B)process.nextTick(B)},D.lchownSync=function(){};if(aO0==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(G){function q(w,B,K){var H=Date.now(),W=0;G(w,B,function M(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-H<60000){if(setTimeout(function(){D.stat(B,function(z,V){if(z&&z.code==="ENOENT")G(w,B,M);else K(I)})},W),W<100)W+=10;return}if(K)K(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(q,G);return q}(D.rename);D.read=typeof D.read!=="function"?D.read:function(G){function q(w,B,K,H,W,M){var I;if(M&&typeof M==="function"){var z=0;I=function(V,L,R){if(V&&V.code==="EAGAIN"&&z<10)return z++,G.call(D,w,B,K,H,W,I);M.apply(this,arguments)}}return G.call(D,w,B,K,H,W,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(q,G);return q}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(G){return function(q,w,B,K,H){var W=0;while(!0)try{return G.call(D,q,w,B,K,H)}catch(M){if(M.code==="EAGAIN"&&W<10){W++;continue}throw M}}}(D.readSync);function $(G){G.lchmod=function(q,w,B){G.open(q,e6.O_WRONLY|e6.O_SYMLINK,w,function(K,H){if(K){if(B)B(K);return}G.fchmod(H,w,function(W){G.close(H,function(M){if(B)B(W||M)})})})},G.lchmodSync=function(q,w){var B=G.openSync(q,e6.O_WRONLY|e6.O_SYMLINK,w),K=!0,H;try{H=G.fchmodSync(B,w),K=!1}finally{if(K)try{G.closeSync(B)}catch(W){}else G.closeSync(B)}return H}}function X(G){if(e6.hasOwnProperty("O_SYMLINK")&&G.futimes)G.lutimes=function(q,w,B,K){G.open(q,e6.O_SYMLINK,function(H,W){if(H){if(K)K(H);return}G.futimes(W,w,B,function(M){G.close(W,function(I){if(K)K(M||I)})})})},G.lutimesSync=function(q,w,B){var K=G.openSync(q,e6.O_SYMLINK),H,W=!0;try{H=G.futimesSync(K,w,B),W=!1}finally{if(W)try{G.closeSync(K)}catch(M){}else G.closeSync(K)}return H};else if(G.futimes)G.lutimes=function(q,w,B,K){if(K)process.nextTick(K)},G.lutimesSync=function(){}}function J(G){if(!G)return G;return function(q,w,B){return G.call(D,q,w,function(K){if(O(K))K=null;if(B)B.apply(this,arguments)})}}function Y(G){if(!G)return G;return function(q,w){try{return G.call(D,q,w)}catch(B){if(!O(B))throw B}}}function Q(G){if(!G)return G;return function(q,w,B,K){return G.call(D,q,w,B,function(H){if(O(H))H=null;if(K)K.apply(this,arguments)})}}function U(G){if(!G)return G;return function(q,w,B){try{return G.call(D,q,w,B)}catch(K){if(!O(K))throw K}}}function F(G){if(!G)return G;return function(q,w,B){if(typeof w==="function")B=w,w=null;function K(H,W){if(W){if(W.uid<0)W.uid+=4294967296;if(W.gid<0)W.gid+=4294967296}if(B)B.apply(this,arguments)}return w?G.call(D,q,w,K):G.call(D,q,K)}}function Z(G){if(!G)return G;return function(q,w){var B=w?G.call(D,q,w):G.call(D,q);if(B){if(B.uid<0)B.uid+=4294967296;if(B.gid<0)B.gid+=4294967296}return B}}function O(G){if(!G)return!0;if(G.code==="ENOSYS")return!0;var q=!process.getuid||process.getuid()!==0;if(q){if(G.code==="EINVAL"||G.code==="EPERM")return!0}return!1}}});var Ix=E((Ap0,Mx)=>{var Lx=l("stream").Stream;Mx.exports=eO0;function eO0(D){return{ReadStream:$,WriteStream:X};function $(J,Y){if(!(this instanceof $))return new $(J,Y);Lx.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 U=Object.keys(Y);for(var F=0,Z=U.length;F<Z;F++){var O=U[F];this[O]=Y[O]}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(G,q){if(G){Q.emit("error",G),Q.readable=!1;return}Q.fd=q,Q.emit("open",q),Q._read()})}function X(J,Y){if(!(this instanceof X))return new X(J,Y);Lx.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 U=0,F=Q.length;U<F;U++){var Z=Q[U];this[Z]=Y[Z]}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 Rx=E((Rp0,Ax)=>{Ax.exports=$G0;var DG0=Object.getPrototypeOf||function(D){return D.__proto__};function $G0(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:DG0(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var xD=E((Ep0,Aw)=>{var ID=l("fs"),XG0=Nx(),JG0=Ix(),YG0=Rx(),eY=l("util"),eD,$Q;if(typeof Symbol==="function"&&typeof Symbol.for==="function")eD=Symbol.for("graceful-fs.queue"),$Q=Symbol.for("graceful-fs.previous");else eD="___graceful-fs.queue",$Q="___graceful-fs.previous";function QG0(){}function jx(D,$){Object.defineProperty(D,eD,{get:function(){return $}})}var W8=QG0;if(eY.debuglog)W8=eY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))W8=function(){var D=eY.format.apply(eY,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
130
|
-
GFS4: `),console.error(D)};if(!ID[eD]){if(Lw=global[eD]||[],jx(ID,Lw),ID.close=function(D){function $(X,J){return D.call(ID,X,function(Y){if(!Y)Ex();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,$Q,{value:D}),$}(ID.close),ID.closeSync=function(D){function $(X){D.apply(ID,arguments),Ex()}return Object.defineProperty($,$Q,{value:D}),$}(ID.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){W8(ID[eD]),l("assert").equal(ID[eD].length,0)})}var Lw;if(!global[eD])jx(global,ID[eD]);Aw.exports=Mw(YG0(ID));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ID.__patched)Aw.exports=Mw(ID),ID.__patched=!0;function Mw(D){XG0(D),D.gracefulify=Mw,D.createReadStream=L,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,x,S){if(typeof x==="function")S=x,x=null;return h(_,x,S);function h(b,n,f,j){return $(b,n,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))e9([h,[b,n,f],u,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(_,x,S,h){if(typeof S==="function")h=S,S=null;return b(_,x,S,h);function b(n,f,j,u,v){return J(n,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=U;function U(_,x,S,h){if(typeof S==="function")h=S,S=null;return b(_,x,S,h);function b(n,f,j,u,v){return Q(n,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var F=D.copyFile;if(F)D.copyFile=Z;function Z(_,x,S,h){if(typeof S==="function")h=S,S=0;return b(_,x,S,h);function b(n,f,j,u,v){return F(n,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var O=D.readdir;D.readdir=q;var G=/^v[0-5]\./;function q(_,x,S){if(typeof x==="function")S=x,x=null;var h=G.test(process.version)?function(f,j,u,v){return O(f,b(f,j,u,v))}:function(f,j,u,v){return O(f,j,b(f,j,u,v))};return h(_,x,S);function b(n,f,j,u){return function(v,y){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))e9([h,[n,f,j],v,u||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 w=JG0(D);M=w.ReadStream,z=w.WriteStream}var B=D.ReadStream;if(B)M.prototype=Object.create(B.prototype),M.prototype.open=I;var K=D.WriteStream;if(K)z.prototype=Object.create(K.prototype),z.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 z},set:function(_){z=_},enumerable:!0,configurable:!0});var H=M;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(_){H=_},enumerable:!0,configurable:!0});var W=z;Object.defineProperty(D,"FileWriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});function M(_,x){if(this instanceof M)return B.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(x,S){if(x){if(_.autoClose)_.destroy();_.emit("error",x)}else _.fd=S,_.emit("open",S),_.read()})}function z(_,x){if(this instanceof z)return K.apply(this,arguments),this;else return z.apply(Object.create(z.prototype),arguments)}function V(){var _=this;A(_.path,_.flags,_.mode,function(x,S){if(x)_.destroy(),_.emit("error",x);else _.fd=S,_.emit("open",S)})}function L(_,x){return new D.ReadStream(_,x)}function R(_,x){return new D.WriteStream(_,x)}var C=D.open;D.open=A;function A(_,x,S,h){if(typeof S==="function")h=S,S=null;return b(_,x,S,h);function b(n,f,j,u,v){return C(n,f,j,function(y,g){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return D}function e9(D){W8("ENQUEUE",D[0].name,D[1]),ID[eD].push(D),Iw()}var DQ;function Ex(){var D=Date.now();for(var $=0;$<ID[eD].length;++$)if(ID[eD][$].length>2)ID[eD][$][3]=D,ID[eD][$][4]=D;Iw()}function Iw(){if(clearTimeout(DQ),DQ=void 0,ID[eD].length===0)return;var D=ID[eD].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],Q=D[4];if(Y===void 0)W8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){W8("TIMEOUT",$.name,X);var U=X.pop();if(typeof U==="function")U.call(null,J)}else{var F=Date.now()-Q,Z=Math.max(Q-Y,1),O=Math.min(Z*1.2,100);if(F>=O)W8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else ID[eD].push(D)}if(DQ===void 0)DQ=setTimeout(Iw,0)}});var Cx=E((jp0,Tx)=>{function Q$(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)}Tx.exports=Q$;Q$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Q$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};Q$.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};Q$.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)};Q$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};Q$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};Q$.prototype.start=Q$.prototype.try;Q$.prototype.errors=function(){return this._errors};Q$.prototype.attempts=function(){return this._attempts};Q$.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,U=(D[Q]||0)+1;if(D[Q]=U,U>=X)$=Y,X=U}return $}});var Sx=E((FG0)=>{var UG0=Cx();FG0.operation=function(D){var $=FG0.timeouts(D);return new UG0($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};FG0.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,U){return Q-U}),J};FG0.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};FG0.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],U=D[Q];D[Q]=function(Z){var O=FG0.operation($),G=Array.prototype.slice.call(arguments,1),q=G.pop();G.push(function(w){if(O.retry(w))return;if(w)arguments[0]=O.mainError();q.apply(this,arguments)}),O.attempt(function(){Z.apply(D,G)})}.bind(D,U),D[Q].options=$}}});var ux=E((Cp0,XQ)=>{XQ.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")XQ.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")XQ.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var QQ=E((Pp0,$5)=>{var VD=global.process,V8=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(!V8(VD))$5.exports=function(){return function(){}};else{if(Rw=l("assert"),N8=ux(),Ew=/^win/i.test(VD.platform),D5=l("events"),typeof D5!=="function")D5=D5.EventEmitter;if(VD.__signal_exit_emitter__)dD=VD.__signal_exit_emitter__;else dD=VD.__signal_exit_emitter__=new D5,dD.count=0,dD.emitted={};if(!dD.infinite)dD.setMaxListeners(1/0),dD.infinite=!0;$5.exports=function(D,$){if(!V8(global.process))return function(){};if(Rw.equal(typeof D,"function","a callback must be provided for exit handler"),L8===!1)JQ();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(dD.removeListener(X,D),dD.listeners("exit").length===0&&dD.listeners("afterexit").length===0)m3()};return dD.on(X,D),J},m3=function(){if(!L8||!V8(global.process))return;L8=!1,N8.forEach(function($){try{VD.removeListener($,c3[$])}catch(X){}}),VD.emit=d3,VD.reallyExit=YQ,dD.count-=1},$5.exports.unload=m3,D4=function($,X,J){if(dD.emitted[$])return;dD.emitted[$]=!0,dD.emit($,X,J)},c3={},N8.forEach(function(D){c3[D]=function(){if(!V8(global.process))return;var X=VD.listeners(D);if(X.length===dD.count){if(m3(),D4("exit",null,D),D4("afterexit",null,D),Ew&&D==="SIGHUP")D="SIGINT";VD.kill(VD.pid,D)}}}),$5.exports.signals=function(){return N8},L8=!1,JQ=function(){if(L8||!V8(global.process))return;L8=!0,dD.count+=1,N8=N8.filter(function($){try{return VD.on($,c3[$]),!0}catch(X){return!1}}),VD.emit=Tw,VD.reallyExit=jw},$5.exports.load=JQ,YQ=VD.reallyExit,jw=function($){if(!V8(global.process))return;VD.exitCode=$||0,D4("exit",VD.exitCode,null),D4("afterexit",VD.exitCode,null),YQ.call(VD,VD.exitCode)},d3=VD.emit,Tw=function($,X){if($==="exit"&&V8(global.process)){if(X!==void 0)VD.exitCode=X;var J=d3.apply(this,arguments);return D4("exit",VD.exitCode,null),D4("afterexit",VD.exitCode,null),J}else return d3.apply(this,arguments)}}var Rw,N8,Ew,D5,dD,m3,D4,c3,L8,JQ,YQ,jw,d3,Tw});var vx=E((BG0,Cw)=>{var xx=Symbol();function qG0(D,$,X){let J=$[xx];if(J)return $.stat(D,(Q,U)=>{if(Q)return X(Q);X(null,U.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,(U,F)=>{if(U)return X(U);let Z=F.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,xx,{value:Z}),X(null,F.mtime,Z)})})}function wG0(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}BG0.probe=qG0;BG0.getMtime=wG0});var bx=E((IG0,n3)=>{var zG0=l("path"),uw=xD(),WG0=Sx(),VG0=QQ(),_x=vx(),W6={};function l3(D,$){return $.lockfilePath||`${D}.lock`}function xw(D,$,X){if(!$.realpath)return X(null,zG0.resolve(D));$.fs.realpath(D,X)}function Sw(D,$,X){let J=l3(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return _x.probe(J,$.fs,(Q,U,F)=>{if(Q)return $.fs.rmdir(J,()=>{}),X(Q);X(null,U,F)});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,U)=>{if(Q){if(Q.code==="ENOENT")return Sw(D,{...$,stale:0},X);return X(Q)}if(!kx(U,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));fx(D,$,(F)=>{if(F)return X(F);Sw(D,{...$,stale:0},X)})})})}function kx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function fx(D,$,X){$.fs.rmdir(l3(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function UQ(D,$){let X=W6[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 Pw(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,UQ(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return Pw(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let F=_x.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,F,F,(Z)=>{let O=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||O)return Pw(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,UQ(D,$)}X.mtime=F,X.lastUpdate=Date.now(),X.updateDelay=null,UQ(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function Pw(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(W6[D]===$)delete W6[D];$.options.onCompromised(X)}function NG0(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:uw,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),xw(D,$,(J,Y)=>{if(J)return X(J);let Q=WG0.operation($.retries);Q.attempt(()=>{Sw(Y,$,(U,F,Z)=>{if(Q.retry(U))return;if(U)return X(Q.mainError());let O=W6[Y]={lockfilePath:l3(Y,$),mtime:F,mtimePrecision:Z,options:$,lastUpdate:Date.now()};UQ(Y,$),X(null,(G)=>{if(O.released)return G&&G(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));yx(Y,{...$,realpath:!1},G)})})})})}function yx(D,$,X){$={fs:uw,realpath:!0,...$},xw(D,$,(J,Y)=>{if(J)return X(J);let Q=W6[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 W6[Y],fx(Y,$,X)})}function LG0(D,$,X){$={stale:1e4,realpath:!0,fs:uw,...$},$.stale=Math.max($.stale||0,2000),xw(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(l3(Y,$),(Q,U)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!kx(U,$))})})}function MG0(){return W6}VG0(()=>{for(let D in W6){let $=W6[D].options;try{$.fs.rmdirSync(l3(D,$))}catch(X){}}});IG0.lock=NG0;IG0.unlock=yx;IG0.check=LG0;IG0.getLocks=MG0});var gx=E((Sp0,hx)=>{var TG0=xD();function CG0(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let Q=Y.pop(),U;try{U=D[`${J}Sync`](...Y)}catch(F){return Q(F)}Q(null,U)}}),X}function PG0(D){return(...$)=>new Promise((X,J)=>{$.push((Y,Q)=>{if(Y)J(Y);else X(Q)}),D(...$)})}function SG0(D){return(...$)=>{let X,J;if($.push((Y,Q)=>{X=Y,J=Q}),D(...$),X)throw X;return J}}function uG0(D){if(D={...D},D.fs=CG0(D.fs||TG0),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}hx.exports={toPromise:PG0,toSync:SG0,toSyncOptions:uG0}});var cx=E((up0,$4)=>{var X5=bx(),{toPromise:FQ,toSync:ZQ,toSyncOptions:vw}=gx();async function mx(D,$){let X=await FQ(X5.lock)(D,$);return FQ(X)}function xG0(D,$){let X=ZQ(X5.lock)(D,vw($));return ZQ(X)}function vG0(D,$){return FQ(X5.unlock)(D,$)}function _G0(D,$){return ZQ(X5.unlock)(D,vw($))}function kG0(D,$){return FQ(X5.check)(D,$)}function fG0(D,$){return ZQ(X5.check)(D,vw($))}$4.exports=mx;$4.exports.lock=mx;$4.exports.unlock=vG0;$4.exports.lockSync=xG0;$4.exports.unlockSync=_G0;$4.exports.check=kG0;$4.exports.checkSync=fG0});var ox=E((px)=>{Object.defineProperty(px,"__esModule",{value:!0});px.canStoreURLs=px.FileUrlStorage=void 0;var dx=l("fs"),yG0=hG0(Wx()),lx=bG0(cx());function ix(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(ix=function(J){return J?X:$})(D)}function bG0(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=ix($);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 U=Y?Object.getOwnPropertyDescriptor(D,Q):null;U&&(U.get||U.set)?Object.defineProperty(J,Q,U):J[Q]=D[Q]}return J.default=D,X&&X.set(D,J),J}function hG0(D){return D&&D.__esModule?D:{default:D}}function i3(D){return i3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},i3(D)}function gG0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function nx(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,cG0(J.key),J)}}function mG0(D,$,X){if($)nx(D.prototype,$);if(X)nx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function cG0(D){var $=dG0(D,"string");return i3($)=="symbol"?$:$+""}function dG0(D,$){if(i3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(i3(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var xp0=px.canStoreURLs=!0,vp0=px.FileUrlStorage=function(){function D($){gG0(this,D),this.path=$}return mG0(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(Q,U){if(Q)Y(Q);else J(U)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,Q){J._getItems("tus::".concat(X),function(U,F){if(U)Q(U);else Y(F)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,Q){J._removeItem(X,function(U){if(U)Q(U);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,Q=Math.round(Math.random()*1000000000000),U="tus::".concat(X,"::").concat(Q);return new Promise(function(F,Z){Y._setItem(U,J,function(O){if(O)Z(O);else F(U)})})}},{key:"_setItem",value:function(X,J,Y){var Q=this;lx.lock(this.path,this._lockfileOptions()).then(function(U){Y=Q._releaseAndCb(U,Y),Q._getData(function(F,Z){if(F){Y(F);return}Z[X]=J,Q._writeData(Z,function(O){return Y(O)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,Q){if(Y){J(Y);return}var U=Object.keys(Q).filter(function(F){return F.startsWith(X)}).map(function(F){var Z=Q[F];return Z.urlStorageKey=F,Z});J(null,U)})}},{key:"_removeItem",value:function(X,J){var Y=this;lx.lock(this.path,this._lockfileOptions()).then(function(Q){J=Y._releaseAndCb(Q,J),Y._getData(function(U,F){if(U){J(U);return}delete F[X],Y._writeData(F,function(Z){return J(Z)})})}).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,yG0.default)([Y,Q]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,dx.writeFile)(this.path,JSON.stringify(X),Y,function(Q){return J(Q)})}},{key:"_getData",value:function(X){(0,dx.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 GQ=E((X4)=>{Object.defineProperty(X4,"__esModule",{value:!0});Object.defineProperty(X4,"DefaultHttpStack",{enumerable:!0,get:function(){return ex.default}});Object.defineProperty(X4,"DetailedError",{enumerable:!0,get:function(){return nG0.default}});Object.defineProperty(X4,"FileUrlStorage",{enumerable:!0,get:function(){return Dv.FileUrlStorage}});Object.defineProperty(X4,"StreamSource",{enumerable:!0,get:function(){return tG0.default}});X4.Upload=void 0;Object.defineProperty(X4,"canStoreURLs",{enumerable:!0,get:function(){return Dv.canStoreURLs}});X4.defaultOptions=void 0;Object.defineProperty(X4,"enableDebugLog",{enumerable:!0,get:function(){return iG0.enableDebugLog}});X4.isSupported=void 0;var nG0=M8(vq()),iG0=_q(),pG0=M8(cP()),_w=M8(MS()),rG0=M8(mS()),oG0=M8(iS()),ex=M8(Zu()),tG0=M8(nq()),Dv=ox();function M8(D){return D&&D.__esModule?D:{default:D}}function Y5(D){return Y5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},Y5(D)}function aG0(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,Xv(J.key),J)}}function sG0(D,$,X){if($)tx(D.prototype,$);if(X)tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function eG0(D,$,X){return $=OQ($),Dq0(D,$v()?Reflect.construct($,X||[],OQ(D).constructor):$.apply(D,X))}function Dq0(D,$){if($&&(Y5($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return $q0(D)}function $q0(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function $v(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return($v=function(){return!!D})()}function OQ(D){return OQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},OQ(D)}function Xq0(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}),$)kw(D,$)}function kw(D,$){return kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},kw(D,$)}function ax(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 J5(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?ax(Object(X),!0).forEach(function(J){Jq0(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):ax(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function Jq0(D,$,X){if($=Xv($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function Xv(D){var $=Yq0(D,"string");return Y5($)=="symbol"?$:$+""}function Yq0(D,$){if(Y5(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(Y5(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var sx=X4.defaultOptions=J5(J5({},_w.default.defaultOptions),{},{httpStack:new ex.default,fileReader:new rG0.default,urlStorage:new pG0.default,fingerprint:oG0.default}),kp0=X4.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 aG0(this,$),J=J5(J5({},sx),J),eG0(this,$,[X,J])}return Xq0($,D),sG0($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=J5(J5({},sx),Y),_w.default.terminate(J,Y)}}])}(_w.default),fp0=X4.isSupported=!0});var R$;var p3=o(()=>{R$={name:"@capgo/cli",type:"module",version:"7.92.1",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:ci-prompts":"bun test/test-ci-prompts.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.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:ci-prompts && bun run test:prompt-preferences && 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/qrcode":"^1.5.6","@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",qrcode:"^1.5.4",react:"^18.3.1"}}});async function qQ(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 Uq0(){let D=await qQ("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:R$.version,latestVersion:D,isOutdated:!!D&&D!==R$.version,majorVersion:$}}async function FD(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await Uq0();if(D)N.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
|
|
130
|
+
GFS4: `),console.error(D)};if(!ID[eD]){if(Lw=global[eD]||[],jx(ID,Lw),ID.close=function(D){function $(X,J){return D.call(ID,X,function(Y){if(!Y)Ex();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,$Q,{value:D}),$}(ID.close),ID.closeSync=function(D){function $(X){D.apply(ID,arguments),Ex()}return Object.defineProperty($,$Q,{value:D}),$}(ID.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){W8(ID[eD]),l("assert").equal(ID[eD].length,0)})}var Lw;if(!global[eD])jx(global,ID[eD]);Aw.exports=Mw(YG0(ID));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ID.__patched)Aw.exports=Mw(ID),ID.__patched=!0;function Mw(D){XG0(D),D.gracefulify=Mw,D.createReadStream=L,D.createWriteStream=R;var $=D.readFile;D.readFile=X;function X(_,x,S){if(typeof x==="function")S=x,x=null;return h(_,x,S);function h(b,n,f,j){return $(b,n,function(u){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))e9([h,[b,n,f],u,j||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(_,x,S,h){if(typeof S==="function")h=S,S=null;return b(_,x,S,h);function b(n,f,j,u,v){return J(n,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var Q=D.appendFile;if(Q)D.appendFile=U;function U(_,x,S,h){if(typeof S==="function")h=S,S=null;return b(_,x,S,h);function b(n,f,j,u,v){return Q(n,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var F=D.copyFile;if(F)D.copyFile=Z;function Z(_,x,S,h){if(typeof S==="function")h=S,S=0;return b(_,x,S,h);function b(n,f,j,u,v){return F(n,f,j,function(y){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}var O=D.readdir;D.readdir=q;var G=/^v[0-5]\./;function q(_,x,S){if(typeof x==="function")S=x,x=null;var h=G.test(process.version)?function(f,j,u,v){return O(f,b(f,j,u,v))}:function(f,j,u,v){return O(f,j,b(f,j,u,v))};return h(_,x,S);function b(n,f,j,u){return function(v,y){if(v&&(v.code==="EMFILE"||v.code==="ENFILE"))e9([h,[n,f,j],v,u||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 w=JG0(D);M=w.ReadStream,z=w.WriteStream}var B=D.ReadStream;if(B)M.prototype=Object.create(B.prototype),M.prototype.open=I;var K=D.WriteStream;if(K)z.prototype=Object.create(K.prototype),z.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 z},set:function(_){z=_},enumerable:!0,configurable:!0});var H=M;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(_){H=_},enumerable:!0,configurable:!0});var W=z;Object.defineProperty(D,"FileWriteStream",{get:function(){return W},set:function(_){W=_},enumerable:!0,configurable:!0});function M(_,x){if(this instanceof M)return B.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var _=this;A(_.path,_.flags,_.mode,function(x,S){if(x){if(_.autoClose)_.destroy();_.emit("error",x)}else _.fd=S,_.emit("open",S),_.read()})}function z(_,x){if(this instanceof z)return K.apply(this,arguments),this;else return z.apply(Object.create(z.prototype),arguments)}function V(){var _=this;A(_.path,_.flags,_.mode,function(x,S){if(x)_.destroy(),_.emit("error",x);else _.fd=S,_.emit("open",S)})}function L(_,x){return new D.ReadStream(_,x)}function R(_,x){return new D.WriteStream(_,x)}var C=D.open;D.open=A;function A(_,x,S,h){if(typeof S==="function")h=S,S=null;return b(_,x,S,h);function b(n,f,j,u,v){return C(n,f,j,function(y,g){if(y&&(y.code==="EMFILE"||y.code==="ENFILE"))e9([b,[n,f,j,u],y,v||Date.now(),Date.now()]);else if(typeof u==="function")u.apply(this,arguments)})}}return D}function e9(D){W8("ENQUEUE",D[0].name,D[1]),ID[eD].push(D),Iw()}var DQ;function Ex(){var D=Date.now();for(var $=0;$<ID[eD].length;++$)if(ID[eD][$].length>2)ID[eD][$][3]=D,ID[eD][$][4]=D;Iw()}function Iw(){if(clearTimeout(DQ),DQ=void 0,ID[eD].length===0)return;var D=ID[eD].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],Q=D[4];if(Y===void 0)W8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){W8("TIMEOUT",$.name,X);var U=X.pop();if(typeof U==="function")U.call(null,J)}else{var F=Date.now()-Q,Z=Math.max(Q-Y,1),O=Math.min(Z*1.2,100);if(F>=O)W8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else ID[eD].push(D)}if(DQ===void 0)DQ=setTimeout(Iw,0)}});var Cx=E((jp0,Tx)=>{function Q$(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)}Tx.exports=Q$;Q$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};Q$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};Q$.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};Q$.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)};Q$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};Q$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};Q$.prototype.start=Q$.prototype.try;Q$.prototype.errors=function(){return this._errors};Q$.prototype.attempts=function(){return this._attempts};Q$.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,U=(D[Q]||0)+1;if(D[Q]=U,U>=X)$=Y,X=U}return $}});var Sx=E((FG0)=>{var UG0=Cx();FG0.operation=function(D){var $=FG0.timeouts(D);return new UG0($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};FG0.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,U){return Q-U}),J};FG0.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};FG0.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],U=D[Q];D[Q]=function(Z){var O=FG0.operation($),G=Array.prototype.slice.call(arguments,1),q=G.pop();G.push(function(w){if(O.retry(w))return;if(w)arguments[0]=O.mainError();q.apply(this,arguments)}),O.attempt(function(){Z.apply(D,G)})}.bind(D,U),D[Q].options=$}}});var ux=E((Cp0,XQ)=>{XQ.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")XQ.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")XQ.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var QQ=E((Pp0,$5)=>{var VD=global.process,V8=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(!V8(VD))$5.exports=function(){return function(){}};else{if(Rw=l("assert"),N8=ux(),Ew=/^win/i.test(VD.platform),D5=l("events"),typeof D5!=="function")D5=D5.EventEmitter;if(VD.__signal_exit_emitter__)dD=VD.__signal_exit_emitter__;else dD=VD.__signal_exit_emitter__=new D5,dD.count=0,dD.emitted={};if(!dD.infinite)dD.setMaxListeners(1/0),dD.infinite=!0;$5.exports=function(D,$){if(!V8(global.process))return function(){};if(Rw.equal(typeof D,"function","a callback must be provided for exit handler"),L8===!1)JQ();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(dD.removeListener(X,D),dD.listeners("exit").length===0&&dD.listeners("afterexit").length===0)m3()};return dD.on(X,D),J},m3=function(){if(!L8||!V8(global.process))return;L8=!1,N8.forEach(function($){try{VD.removeListener($,c3[$])}catch(X){}}),VD.emit=d3,VD.reallyExit=YQ,dD.count-=1},$5.exports.unload=m3,D4=function($,X,J){if(dD.emitted[$])return;dD.emitted[$]=!0,dD.emit($,X,J)},c3={},N8.forEach(function(D){c3[D]=function(){if(!V8(global.process))return;var X=VD.listeners(D);if(X.length===dD.count){if(m3(),D4("exit",null,D),D4("afterexit",null,D),Ew&&D==="SIGHUP")D="SIGINT";VD.kill(VD.pid,D)}}}),$5.exports.signals=function(){return N8},L8=!1,JQ=function(){if(L8||!V8(global.process))return;L8=!0,dD.count+=1,N8=N8.filter(function($){try{return VD.on($,c3[$]),!0}catch(X){return!1}}),VD.emit=Tw,VD.reallyExit=jw},$5.exports.load=JQ,YQ=VD.reallyExit,jw=function($){if(!V8(global.process))return;VD.exitCode=$||0,D4("exit",VD.exitCode,null),D4("afterexit",VD.exitCode,null),YQ.call(VD,VD.exitCode)},d3=VD.emit,Tw=function($,X){if($==="exit"&&V8(global.process)){if(X!==void 0)VD.exitCode=X;var J=d3.apply(this,arguments);return D4("exit",VD.exitCode,null),D4("afterexit",VD.exitCode,null),J}else return d3.apply(this,arguments)}}var Rw,N8,Ew,D5,dD,m3,D4,c3,L8,JQ,YQ,jw,d3,Tw});var vx=E((BG0,Cw)=>{var xx=Symbol();function qG0(D,$,X){let J=$[xx];if(J)return $.stat(D,(Q,U)=>{if(Q)return X(Q);X(null,U.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,(U,F)=>{if(U)return X(U);let Z=F.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,xx,{value:Z}),X(null,F.mtime,Z)})})}function wG0(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}BG0.probe=qG0;BG0.getMtime=wG0});var bx=E((IG0,n3)=>{var zG0=l("path"),uw=xD(),WG0=Sx(),VG0=QQ(),_x=vx(),W6={};function l3(D,$){return $.lockfilePath||`${D}.lock`}function xw(D,$,X){if(!$.realpath)return X(null,zG0.resolve(D));$.fs.realpath(D,X)}function Sw(D,$,X){let J=l3(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return _x.probe(J,$.fs,(Q,U,F)=>{if(Q)return $.fs.rmdir(J,()=>{}),X(Q);X(null,U,F)});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,U)=>{if(Q){if(Q.code==="ENOENT")return Sw(D,{...$,stale:0},X);return X(Q)}if(!kx(U,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));fx(D,$,(F)=>{if(F)return X(F);Sw(D,{...$,stale:0},X)})})})}function kx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function fx(D,$,X){$.fs.rmdir(l3(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function UQ(D,$){let X=W6[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 Pw(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,UQ(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return Pw(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let F=_x.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,F,F,(Z)=>{let O=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||O)return Pw(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,UQ(D,$)}X.mtime=F,X.lastUpdate=Date.now(),X.updateDelay=null,UQ(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function Pw(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(W6[D]===$)delete W6[D];$.options.onCompromised(X)}function NG0(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:uw,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),xw(D,$,(J,Y)=>{if(J)return X(J);let Q=WG0.operation($.retries);Q.attempt(()=>{Sw(Y,$,(U,F,Z)=>{if(Q.retry(U))return;if(U)return X(Q.mainError());let O=W6[Y]={lockfilePath:l3(Y,$),mtime:F,mtimePrecision:Z,options:$,lastUpdate:Date.now()};UQ(Y,$),X(null,(G)=>{if(O.released)return G&&G(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));yx(Y,{...$,realpath:!1},G)})})})})}function yx(D,$,X){$={fs:uw,realpath:!0,...$},xw(D,$,(J,Y)=>{if(J)return X(J);let Q=W6[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 W6[Y],fx(Y,$,X)})}function LG0(D,$,X){$={stale:1e4,realpath:!0,fs:uw,...$},$.stale=Math.max($.stale||0,2000),xw(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(l3(Y,$),(Q,U)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!kx(U,$))})})}function MG0(){return W6}VG0(()=>{for(let D in W6){let $=W6[D].options;try{$.fs.rmdirSync(l3(D,$))}catch(X){}}});IG0.lock=NG0;IG0.unlock=yx;IG0.check=LG0;IG0.getLocks=MG0});var gx=E((Sp0,hx)=>{var TG0=xD();function CG0(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let Q=Y.pop(),U;try{U=D[`${J}Sync`](...Y)}catch(F){return Q(F)}Q(null,U)}}),X}function PG0(D){return(...$)=>new Promise((X,J)=>{$.push((Y,Q)=>{if(Y)J(Y);else X(Q)}),D(...$)})}function SG0(D){return(...$)=>{let X,J;if($.push((Y,Q)=>{X=Y,J=Q}),D(...$),X)throw X;return J}}function uG0(D){if(D={...D},D.fs=CG0(D.fs||TG0),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}hx.exports={toPromise:PG0,toSync:SG0,toSyncOptions:uG0}});var cx=E((up0,$4)=>{var X5=bx(),{toPromise:FQ,toSync:ZQ,toSyncOptions:vw}=gx();async function mx(D,$){let X=await FQ(X5.lock)(D,$);return FQ(X)}function xG0(D,$){let X=ZQ(X5.lock)(D,vw($));return ZQ(X)}function vG0(D,$){return FQ(X5.unlock)(D,$)}function _G0(D,$){return ZQ(X5.unlock)(D,vw($))}function kG0(D,$){return FQ(X5.check)(D,$)}function fG0(D,$){return ZQ(X5.check)(D,vw($))}$4.exports=mx;$4.exports.lock=mx;$4.exports.unlock=vG0;$4.exports.lockSync=xG0;$4.exports.unlockSync=_G0;$4.exports.check=kG0;$4.exports.checkSync=fG0});var ox=E((px)=>{Object.defineProperty(px,"__esModule",{value:!0});px.canStoreURLs=px.FileUrlStorage=void 0;var dx=l("fs"),yG0=hG0(Wx()),lx=bG0(cx());function ix(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(ix=function(J){return J?X:$})(D)}function bG0(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=ix($);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 U=Y?Object.getOwnPropertyDescriptor(D,Q):null;U&&(U.get||U.set)?Object.defineProperty(J,Q,U):J[Q]=D[Q]}return J.default=D,X&&X.set(D,J),J}function hG0(D){return D&&D.__esModule?D:{default:D}}function i3(D){return i3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},i3(D)}function gG0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function nx(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,cG0(J.key),J)}}function mG0(D,$,X){if($)nx(D.prototype,$);if(X)nx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function cG0(D){var $=dG0(D,"string");return i3($)=="symbol"?$:$+""}function dG0(D,$){if(i3(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(i3(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var xp0=px.canStoreURLs=!0,vp0=px.FileUrlStorage=function(){function D($){gG0(this,D),this.path=$}return mG0(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(Q,U){if(Q)Y(Q);else J(U)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,Q){J._getItems("tus::".concat(X),function(U,F){if(U)Q(U);else Y(F)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,Q){J._removeItem(X,function(U){if(U)Q(U);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,Q=Math.round(Math.random()*1000000000000),U="tus::".concat(X,"::").concat(Q);return new Promise(function(F,Z){Y._setItem(U,J,function(O){if(O)Z(O);else F(U)})})}},{key:"_setItem",value:function(X,J,Y){var Q=this;lx.lock(this.path,this._lockfileOptions()).then(function(U){Y=Q._releaseAndCb(U,Y),Q._getData(function(F,Z){if(F){Y(F);return}Z[X]=J,Q._writeData(Z,function(O){return Y(O)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,Q){if(Y){J(Y);return}var U=Object.keys(Q).filter(function(F){return F.startsWith(X)}).map(function(F){var Z=Q[F];return Z.urlStorageKey=F,Z});J(null,U)})}},{key:"_removeItem",value:function(X,J){var Y=this;lx.lock(this.path,this._lockfileOptions()).then(function(Q){J=Y._releaseAndCb(Q,J),Y._getData(function(U,F){if(U){J(U);return}delete F[X],Y._writeData(F,function(Z){return J(Z)})})}).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,yG0.default)([Y,Q]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,dx.writeFile)(this.path,JSON.stringify(X),Y,function(Q){return J(Q)})}},{key:"_getData",value:function(X){(0,dx.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 GQ=E((X4)=>{Object.defineProperty(X4,"__esModule",{value:!0});Object.defineProperty(X4,"DefaultHttpStack",{enumerable:!0,get:function(){return ex.default}});Object.defineProperty(X4,"DetailedError",{enumerable:!0,get:function(){return nG0.default}});Object.defineProperty(X4,"FileUrlStorage",{enumerable:!0,get:function(){return Dv.FileUrlStorage}});Object.defineProperty(X4,"StreamSource",{enumerable:!0,get:function(){return tG0.default}});X4.Upload=void 0;Object.defineProperty(X4,"canStoreURLs",{enumerable:!0,get:function(){return Dv.canStoreURLs}});X4.defaultOptions=void 0;Object.defineProperty(X4,"enableDebugLog",{enumerable:!0,get:function(){return iG0.enableDebugLog}});X4.isSupported=void 0;var nG0=M8(vq()),iG0=_q(),pG0=M8(cP()),_w=M8(MS()),rG0=M8(mS()),oG0=M8(iS()),ex=M8(Zu()),tG0=M8(nq()),Dv=ox();function M8(D){return D&&D.__esModule?D:{default:D}}function Y5(D){return Y5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},Y5(D)}function aG0(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,Xv(J.key),J)}}function sG0(D,$,X){if($)tx(D.prototype,$);if(X)tx(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function eG0(D,$,X){return $=OQ($),Dq0(D,$v()?Reflect.construct($,X||[],OQ(D).constructor):$.apply(D,X))}function Dq0(D,$){if($&&(Y5($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return $q0(D)}function $q0(D){if(D===void 0)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return D}function $v(){try{var D=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch($){}return($v=function(){return!!D})()}function OQ(D){return OQ=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},OQ(D)}function Xq0(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}),$)kw(D,$)}function kw(D,$){return kw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},kw(D,$)}function ax(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 J5(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?ax(Object(X),!0).forEach(function(J){Jq0(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):ax(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function Jq0(D,$,X){if($=Xv($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function Xv(D){var $=Yq0(D,"string");return Y5($)=="symbol"?$:$+""}function Yq0(D,$){if(Y5(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(Y5(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var sx=X4.defaultOptions=J5(J5({},_w.default.defaultOptions),{},{httpStack:new ex.default,fileReader:new rG0.default,urlStorage:new pG0.default,fingerprint:oG0.default}),kp0=X4.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 aG0(this,$),J=J5(J5({},sx),J),eG0(this,$,[X,J])}return Xq0($,D),sG0($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=J5(J5({},sx),Y),_w.default.terminate(J,Y)}}])}(_w.default),fp0=X4.isSupported=!0});var R$;var p3=o(()=>{R$={name:"@capgo/cli",type:"module",version:"7.93.1",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:ci-prompts":"bun test/test-ci-prompts.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:prompt-preferences":"bun test/test-prompt-preferences.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:ci-prompts && bun run test:onboarding-recovery && bun run test:prompt-preferences && 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/qrcode":"^1.5.6","@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",qrcode:"^1.5.4",react:"^18.3.1"}}});async function qQ(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 Uq0(){let D=await qQ("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:R$.version,latestVersion:D,isOutdated:!!D&&D!==R$.version,majorVersion:$}}async function FD(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await Uq0();if(D)N.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 z1=o(()=>{x0();p3()});async function Uv(D,$,X,J,Y,Q="✅"){await A0(X,{channel:D,event:J,icon:Q,user_id:$,...Y?{tags:{"app-id":Y}}:{},notify:!1})}var Fv=o(()=>{x0();G6();z1();_0()});import{Buffer as Zv}from"node:buffer";import{createHash as Fq0}from"node:crypto";function Oq0(D){let $=4294967295;for(let X=0;X<D.length;X++){let J=D[X];$=Zq0[($^J)&255]^$>>>8}return $=$^4294967295,($>>>0).toString(16).padStart(8,"0")}async function J4(D,$="sha256"){let X=Zv.isBuffer(D)?D:Zv.from(D);if($==="crc32")return Oq0(X);let J=Fq0($);return J.update(X),J.digest("hex")}var Zq0;var r3=o(()=>{Zq0=(()=>{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 Gv=E((sp0,Ov)=>{var Q5=1000,U5=Q5*60,F5=U5*60,I8=F5*24,Gq0=I8*7,qq0=I8*365.25;Ov.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return wq0(D);else if(X==="number"&&isFinite(D))return $.long?Kq0(D):Bq0(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function wq0(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*qq0;case"weeks":case"week":case"w":return X*Gq0;case"days":case"day":case"d":return X*I8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*F5;case"minutes":case"minute":case"mins":case"min":case"m":return X*U5;case"seconds":case"second":case"secs":case"sec":case"s":return X*Q5;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function Bq0(D){var $=Math.abs(D);if($>=I8)return Math.round(D/I8)+"d";if($>=F5)return Math.round(D/F5)+"h";if($>=U5)return Math.round(D/U5)+"m";if($>=Q5)return Math.round(D/Q5)+"s";return D+"ms"}function Kq0(D){var $=Math.abs(D);if($>=I8)return wQ(D,$,I8,"day");if($>=F5)return wQ(D,$,F5,"hour");if($>=U5)return wQ(D,$,U5,"minute");if($>=Q5)return wQ(D,$,Q5,"second");return D+" ms"}function wQ(D,$,X,J){var Y=$>=X*1.5;return Math.round(D/X)+" "+J+(Y?"s":"")}});var fw=E((ep0,qv)=>{function Hq0(D){X.debug=X,X.default=X,X.coerce=Z,X.disable=U,X.enable=Y,X.enabled=F,X.humanize=Gv(),X.destroy=O,Object.keys(D).forEach((G)=>{X[G]=D[G]}),X.names=[],X.skips=[],X.formatters={};function $(G){let q=0;for(let w=0;w<G.length;w++)q=(q<<5)-q+G.charCodeAt(w),q|=0;return X.colors[Math.abs(q)%X.colors.length]}X.selectColor=$;function X(G){let q,w=null,B,K;function H(...W){if(!H.enabled)return;let M=H,I=Number(new Date),z=I-(q||I);if(M.diff=z,M.prev=q,M.curr=I,q=I,W[0]=X.coerce(W[0]),typeof W[0]!=="string")W.unshift("%O");let V=0;W[0]=W[0].replace(/%([a-zA-Z%])/g,(R,C)=>{if(R==="%%")return"%";V++;let A=X.formatters[C];if(typeof A==="function"){let _=W[V];R=A.call(M,_),W.splice(V,1),V--}return R}),X.formatArgs.call(M,W),(M.log||X.log).apply(M,W)}if(H.namespace=G,H.useColors=X.useColors(),H.color=X.selectColor(G),H.extend=J,H.destroy=X.destroy,Object.defineProperty(H,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(w!==null)return w;if(B!==X.namespaces)B=X.namespaces,K=X.enabled(G);return K},set:(W)=>{w=W}}),typeof X.init==="function")X.init(H);return H}function J(G,q){let w=X(this.namespace+(typeof q>"u"?":":q)+G);return w.log=this.log,w}function Y(G){X.save(G),X.namespaces=G,X.names=[],X.skips=[];let q=(typeof G==="string"?G:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let w of q)if(w[0]==="-")X.skips.push(w.slice(1));else X.names.push(w)}function Q(G,q){let w=0,B=0,K=-1,H=0;while(w<G.length)if(B<q.length&&(q[B]===G[w]||q[B]==="*"))if(q[B]==="*")K=B,H=w,B++;else w++,B++;else if(K!==-1)B=K+1,H++,w=H;else return!1;while(B<q.length&&q[B]==="*")B++;return B===q.length}function U(){let G=[...X.names,...X.skips.map((q)=>"-"+q)].join(",");return X.enable(""),G}function F(G){for(let q of X.skips)if(Q(G,q))return!1;for(let q of X.names)if(Q(G,q))return!0;return!1}function Z(G){if(G instanceof Error)return G.stack||G.message;return G}function O(){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}qv.exports=Hq0});var Bv=E((wv,BQ)=>{wv.formatArgs=Wq0;wv.save=Vq0;wv.load=Nq0;wv.useColors=zq0;wv.storage=Lq0();wv.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`.")}})();wv.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 zq0(){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 Wq0(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+BQ.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,$)}wv.log=console.debug||console.log||(()=>{});function Vq0(D){try{if(D)wv.storage.setItem("debug",D);else wv.storage.removeItem("debug")}catch($){}}function Nq0(){let D;try{D=wv.storage.getItem("debug")||wv.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function Lq0(){try{return localStorage}catch(D){}}BQ.exports=fw()(wv);var{formatters:Mq0}=BQ.exports;Mq0.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var Hv=E(($r0,Kv)=>{Kv.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 Vv=E((Xr0,Wv)=>{var Pq0=l("os"),zv=l("tty"),U$=Hv(),{env:rD}=process,Y4;if(U$("no-color")||U$("no-colors")||U$("color=false")||U$("color=never"))Y4=0;else if(U$("color")||U$("colors")||U$("color=true")||U$("color=always"))Y4=1;if("FORCE_COLOR"in rD)if(rD.FORCE_COLOR==="true")Y4=1;else if(rD.FORCE_COLOR==="false")Y4=0;else Y4=rD.FORCE_COLOR.length===0?1:Math.min(parseInt(rD.FORCE_COLOR,10),3);function yw(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function bw(D,$){if(Y4===0)return 0;if(U$("color=16m")||U$("color=full")||U$("color=truecolor"))return 3;if(U$("color=256"))return 2;if(D&&!$&&Y4===void 0)return 0;let X=Y4||0;if(rD.TERM==="dumb")return X;if(process.platform==="win32"){let J=Pq0.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in rD){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((J)=>(J in rD))||rD.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in rD)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(rD.TEAMCITY_VERSION)?1:0;if(rD.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in rD){let J=parseInt((rD.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(rD.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(rD.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(rD.TERM))return 1;if("COLORTERM"in rD)return 1;return X}function Sq0(D){let $=bw(D,D&&D.isTTY);return yw($)}Wv.exports={supportsColor:Sq0,stdout:yw(bw(!0,zv.isatty(1))),stderr:yw(bw(!0,zv.isatty(2)))}});var Iv=E((Lv,HQ)=>{var uq0=l("tty"),KQ=l("util");Lv.init=bq0;Lv.log=kq0;Lv.formatArgs=vq0;Lv.save=fq0;Lv.load=yq0;Lv.useColors=xq0;Lv.destroy=KQ.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Lv.colors=[6,2,3,4,5,1];try{let D=Vv();if(D&&(D.stderr||D).level>=2)Lv.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){}Lv.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 xq0(){return"colors"in Lv.inspectOpts?Boolean(Lv.inspectOpts.colors):uq0.isatty(process.stderr.fd)}function vq0(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+"+HQ.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=_q0()+$+" "+D[0]}function _q0(){if(Lv.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function kq0(...D){return process.stderr.write(KQ.formatWithOptions(Lv.inspectOpts,...D)+`
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -3619,6 +3619,7 @@ export declare function isAllowedAppOrg(supabase: SupabaseClient<Database>, apik
|
|
|
3619
3619
|
export declare function checkRemoteCliMessages(supabase: SupabaseClient<Database>, orgId: string, cliVersion: string): Promise<void>;
|
|
3620
3620
|
export declare function checkPlanValid(supabase: SupabaseClient<Database>, orgId: string, apikey: string, appId?: string, warning?: boolean): Promise<void>;
|
|
3621
3621
|
export declare function checkPlanValidUpload(supabase: SupabaseClient<Database>, orgId: string, apikey: string, appId?: string, warning?: boolean): Promise<void>;
|
|
3622
|
+
export declare function findSavedKeySilent(): string | undefined;
|
|
3622
3623
|
export declare function findSavedKey(quiet?: boolean): string;
|
|
3623
3624
|
export declare function getContentType(filename: string): string;
|
|
3624
3625
|
export declare function findProjectType(options?: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.93.1",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
"test:build-zip-filter": "bun test/test-build-zip-filter.mjs",
|
|
73
73
|
"test:checksum": "bun test/test-checksum-algorithm.mjs",
|
|
74
74
|
"test:ci-prompts": "bun test/test-ci-prompts.mjs",
|
|
75
|
+
"test:onboarding-recovery": "bun test/test-onboarding-recovery.mjs",
|
|
75
76
|
"test:prompt-preferences": "bun test/test-prompt-preferences.mjs",
|
|
76
77
|
"test:esm-sdk": "node test/test-sdk-esm.mjs",
|
|
77
78
|
"test:mcp": "node test/test-mcp.mjs",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"test:version-detection:setup": "./test/fixtures/setup-test-projects.sh",
|
|
80
81
|
"test:platform-paths": "bun test/test-platform-paths.mjs",
|
|
81
82
|
"test:payload-split": "bun test/test-payload-split.mjs",
|
|
82
|
-
"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:ci-prompts && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"
|
|
83
|
+
"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:ci-prompts && bun run test:onboarding-recovery && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:version-detection && bun run test:platform-paths && bun run test:payload-split"
|
|
83
84
|
},
|
|
84
85
|
"devDependencies": {
|
|
85
86
|
"@antfu/eslint-config": "^7.0.0",
|
|
@@ -15,6 +15,9 @@ Use this skill for Capgo Cloud native iOS and Android build workflows.
|
|
|
15
15
|
- Reduces iOS setup from ~10 manual steps to 1 manual step (creating an API key) + 1 command.
|
|
16
16
|
- Example: `npx @capgo/cli@latest build init`
|
|
17
17
|
- Backward compatibility: `npx @capgo/cli@latest build onboarding` still works.
|
|
18
|
+
- Options:
|
|
19
|
+
- `-a, --apikey <apikey>` — Capgo API key to authenticate with (alternative to the `CAPGO_TOKEN` env var or `~/.capgo` / local `.capgo` file). Takes precedence over a saved key when both are present. Lets the SaaS onboarding wizard render a single copy-pasteable command across bash, zsh, fish, PowerShell, and cmd.exe.
|
|
20
|
+
- Example: `npx @capgo/cli@latest build init -a cap_xxx`
|
|
18
21
|
- Notes:
|
|
19
22
|
- Uses Ink (React for terminal) for the interactive UI, alongside the main `init` onboarding flow.
|
|
20
23
|
- Requires running inside a Capacitor project directory with an `ios/` folder.
|
|
@@ -24,6 +27,8 @@ Use this skill for Capgo Cloud native iOS and Android build workflows.
|
|
|
24
27
|
- Progress persists in `~/.capgo-credentials/onboarding/<appId>.json` — safe to interrupt and resume.
|
|
25
28
|
- Saves credentials to the same `~/.capgo-credentials/credentials.json` used by `build request`.
|
|
26
29
|
- Optionally kicks off the first build at the end.
|
|
30
|
+
- If the native `ios/` folder is missing, onboarding can offer to run `cap add ios` automatically instead of exiting immediately.
|
|
31
|
+
- Unexpected failures now keep the user inside the recovery screen, show package-manager-aware commands, and save a support bundle under `~/.capgo-credentials/support/`.
|
|
27
32
|
|
|
28
33
|
#### What it automates (iOS)
|
|
29
34
|
|
package/skills/usage/SKILL.md
CHANGED
|
@@ -16,7 +16,7 @@ TanStack Intent skills should stay focused and under the validator line limit, s
|
|
|
16
16
|
|
|
17
17
|
## Shared invocation rules
|
|
18
18
|
|
|
19
|
-
- Prefer `npx @capgo/cli@latest ...` in user-facing examples
|
|
19
|
+
- Prefer `npx @capgo/cli@latest ...` in user-facing examples in this repo.
|
|
20
20
|
- Many commands can infer `appId` and related config from the current Capacitor project.
|
|
21
21
|
- Shared public flags commonly include `-a, --apikey <apikey>` and `--verbose` on commands that support verbose output.
|
|
22
22
|
|
|
@@ -24,7 +24,7 @@ TanStack Intent skills should stay focused and under the validator line limit, s
|
|
|
24
24
|
|
|
25
25
|
### Project setup and diagnostics
|
|
26
26
|
|
|
27
|
-
- `init [apikey] [appId]`: guided first-time setup for Capgo in a Capacitor app. The interactive flow now runs as a real Ink-based fullscreen onboarding so it uses the same UI stack as `build init` (alias: `build onboarding`), with a persistent dashboard, phase roadmap, progress cards, shared log area, and resume support. When dependency auto-detection fails on macOS, the flow opens a native file picker for `package.json` before falling back to manual path entry. If the user reuses a pending app that was already created in the web onboarding flow, the CLI syncs that selected dashboard app ID back into `capacitor.config.*` before the remaining steps continue. Outside that reused pending-app path, the CLI keeps using the local Capacitor app ID. It can also offer a final `npx skills add https://github.com/Cap-go/capgo-skills -g -y` install step before the GitHub support prompt; if accepted, the support menu includes `Cap-go/capgo-skills` alongside the updater-only and all-Capgo choices. If iOS sync validation fails during onboarding, the CLI can offer to run a one-line native reset command, wait for you to type `ready` after a manual fix, and
|
|
27
|
+
- `init [apikey] [appId]`: guided first-time setup for Capgo in a Capacitor app. The interactive flow now runs as a real Ink-based fullscreen onboarding so it uses the same UI stack as `build init` (alias: `build onboarding`), with a persistent dashboard, phase roadmap, progress cards, shared log area, and resume support. When dependency auto-detection fails on macOS, the flow opens a native file picker for `package.json` before falling back to manual path entry. If the user reuses a pending app that was already created in the web onboarding flow, the CLI syncs that selected dashboard app ID back into `capacitor.config.*` before the remaining steps continue. Outside that reused pending-app path, the CLI keeps using the local Capacitor app ID. It can also offer a final `npx skills add https://github.com/Cap-go/capgo-skills -g -y` install step before the GitHub support prompt; if accepted, the support menu includes `Cap-go/capgo-skills` alongside the updater-only and all-Capgo choices. If native platforms are missing, the onboarding can offer to run `cap add` for you. If iOS sync validation fails during onboarding, the CLI can offer to run a one-line native reset command, wait for you to type `ready` after a manual fix, surface `doctor`, and save a support bundle before you leave the flow.
|
|
28
28
|
- `login [apikey]`: store an API key locally.
|
|
29
29
|
- `doctor`: inspect installation health and gather troubleshooting details.
|
|
30
30
|
- `probe`: test whether the update endpoint would deliver an update.
|