@capgo/cli 7.88.1 → 7.88.2
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 +5 -3
- package/dist/index.js +389 -407
- package/dist/package.json +1 -1
- package/dist/src/build/onboarding/command.d.ts +1 -1
- package/dist/src/build/onboarding/file-picker.d.ts +1 -0
- package/dist/src/{init.d.ts → init/command.d.ts} +1 -1
- package/dist/src/init/index.d.ts +1 -0
- package/dist/src/init/prompts.d.ts +41 -0
- package/dist/src/init/runtime.d.ts +66 -0
- package/dist/src/init/ui/app.d.ts +8 -0
- package/dist/src/init/ui/components.d.ts +28 -0
- package/dist/src/init/ui.d.ts +12 -0
- package/dist/src/sdk.js +1 -1
- package/package.json +1 -1
- package/skills/native-builds/SKILL.md +4 -3
- package/skills/usage/SKILL.md +1 -1
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function onboardingBuilderCommand(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { initApp } from './command';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const CANCEL: symbol;
|
|
2
|
+
type SpinnerTone = 'success' | 'neutral' | 'error';
|
|
3
|
+
type PromptResult<T> = Promise<T | symbol>;
|
|
4
|
+
interface ConfirmOptions {
|
|
5
|
+
message: string;
|
|
6
|
+
initialValue?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface TextOptions {
|
|
9
|
+
message: string;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
validate?: (value: string | undefined) => string | undefined;
|
|
12
|
+
}
|
|
13
|
+
interface SelectOption<T extends string = string> {
|
|
14
|
+
value: T;
|
|
15
|
+
label: string;
|
|
16
|
+
hint?: string;
|
|
17
|
+
}
|
|
18
|
+
interface SelectOptions<T extends string = string> {
|
|
19
|
+
message: string;
|
|
20
|
+
options: SelectOption<T>[];
|
|
21
|
+
}
|
|
22
|
+
interface SpinnerController {
|
|
23
|
+
start: (message: string) => void;
|
|
24
|
+
stop: (message?: string, tone?: SpinnerTone) => void;
|
|
25
|
+
message: (message: string) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function intro(_message: string): void;
|
|
28
|
+
export declare function outro(message: string): void;
|
|
29
|
+
export declare function cancel(message: string): void;
|
|
30
|
+
export declare function isCancel(value: unknown): value is symbol;
|
|
31
|
+
export declare const log: {
|
|
32
|
+
info(message: string): void;
|
|
33
|
+
warn(message: string): void;
|
|
34
|
+
error(message: string): void;
|
|
35
|
+
success(message: string): void;
|
|
36
|
+
};
|
|
37
|
+
export declare function confirm(options: ConfirmOptions): PromptResult<boolean>;
|
|
38
|
+
export declare function text(options: TextOptions): PromptResult<string>;
|
|
39
|
+
export declare function select<T extends string = string>(options: SelectOptions<T>): PromptResult<T>;
|
|
40
|
+
export declare function spinner(): SpinnerController;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const INIT_CANCEL: unique symbol;
|
|
2
|
+
export type InitLogTone = 'cyan' | 'yellow' | 'green' | 'red';
|
|
3
|
+
export type InitScreenTone = 'cyan' | 'blue' | 'green' | 'yellow';
|
|
4
|
+
export interface InitScreen {
|
|
5
|
+
title?: string;
|
|
6
|
+
introLines?: string[];
|
|
7
|
+
phaseLabel?: string;
|
|
8
|
+
progress?: number;
|
|
9
|
+
stepLabel?: string;
|
|
10
|
+
stepSummary?: string;
|
|
11
|
+
roadmapLine?: string;
|
|
12
|
+
statusLine?: string;
|
|
13
|
+
resumeLine?: string;
|
|
14
|
+
completionLines?: string[];
|
|
15
|
+
tone?: InitScreenTone;
|
|
16
|
+
}
|
|
17
|
+
export interface ConfirmPrompt {
|
|
18
|
+
kind: 'confirm';
|
|
19
|
+
message: string;
|
|
20
|
+
initialValue?: boolean;
|
|
21
|
+
resolve: (value: boolean | symbol) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface TextPrompt {
|
|
24
|
+
kind: 'text';
|
|
25
|
+
message: string;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
validate?: (value: string | undefined) => string | undefined;
|
|
28
|
+
error?: string;
|
|
29
|
+
resolve: (value: string | symbol) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface SelectPromptOption {
|
|
32
|
+
label: string;
|
|
33
|
+
hint?: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}
|
|
36
|
+
export interface SelectPrompt {
|
|
37
|
+
kind: 'select';
|
|
38
|
+
message: string;
|
|
39
|
+
options: SelectPromptOption[];
|
|
40
|
+
resolve: (value: string | symbol) => void;
|
|
41
|
+
}
|
|
42
|
+
export type PromptRequest = ConfirmPrompt | TextPrompt | SelectPrompt;
|
|
43
|
+
export interface InitLogEntry {
|
|
44
|
+
message: string;
|
|
45
|
+
tone: InitLogTone;
|
|
46
|
+
}
|
|
47
|
+
export interface InitRuntimeState {
|
|
48
|
+
screen?: InitScreen;
|
|
49
|
+
logs: InitLogEntry[];
|
|
50
|
+
spinner?: string;
|
|
51
|
+
prompt?: PromptRequest;
|
|
52
|
+
}
|
|
53
|
+
export declare function subscribe(listener: () => void): () => boolean;
|
|
54
|
+
export declare function getInitSnapshot(): InitRuntimeState;
|
|
55
|
+
export declare function ensureInitInkSession(): void;
|
|
56
|
+
export declare function stopInitInkSession(finalMessage?: {
|
|
57
|
+
text: string;
|
|
58
|
+
tone: 'green' | 'yellow';
|
|
59
|
+
}): void;
|
|
60
|
+
export declare function setInitScreen(screen: InitScreen): void;
|
|
61
|
+
export declare function pushInitLog(message: string, tone: InitLogTone): void;
|
|
62
|
+
export declare function clearInitLogs(): void;
|
|
63
|
+
export declare function setInitSpinner(message?: string): void;
|
|
64
|
+
export declare function requestInitConfirm(message: string, initialValue?: boolean): Promise<boolean | symbol>;
|
|
65
|
+
export declare function requestInitText(message: string, placeholder?: string, validate?: (value: string | undefined) => string | undefined): Promise<string | symbol>;
|
|
66
|
+
export declare function requestInitSelect(message: string, options: SelectPromptOption[]): Promise<string | symbol>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InitRuntimeState } from '../runtime';
|
|
2
|
+
interface InitInkAppProps {
|
|
3
|
+
getSnapshot: () => InitRuntimeState;
|
|
4
|
+
subscribe: (listener: () => void) => () => void;
|
|
5
|
+
updatePromptError: (error?: string) => void;
|
|
6
|
+
}
|
|
7
|
+
export default function InitInkApp({ getSnapshot, subscribe, updatePromptError }: Readonly<InitInkAppProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ConfirmPrompt, InitScreen, PromptRequest, SelectPrompt, TextPrompt } from '../runtime';
|
|
2
|
+
export declare function InitHeader(): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function ScreenIntro({ screen }: Readonly<{
|
|
4
|
+
screen: InitScreen;
|
|
5
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare function ProgressSection({ screen }: Readonly<{
|
|
7
|
+
screen: InitScreen;
|
|
8
|
+
}>): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare function CurrentStepSection({ screen }: Readonly<{
|
|
10
|
+
screen: InitScreen;
|
|
11
|
+
}>): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export declare function ConfirmPromptView({ prompt }: Readonly<{
|
|
13
|
+
prompt: ConfirmPrompt;
|
|
14
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function TextPromptView({ prompt, onError }: Readonly<{
|
|
16
|
+
prompt: TextPrompt;
|
|
17
|
+
onError: (error?: string) => void;
|
|
18
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function SelectPromptView({ prompt }: Readonly<{
|
|
20
|
+
prompt: SelectPrompt;
|
|
21
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function PromptArea({ prompt, onTextError }: Readonly<{
|
|
23
|
+
prompt?: PromptRequest;
|
|
24
|
+
onTextError: (error?: string) => void;
|
|
25
|
+
}>): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
+
export declare function SpinnerArea({ text }: Readonly<{
|
|
27
|
+
text?: string;
|
|
28
|
+
}>): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface InitOnboardingStepDefinition {
|
|
2
|
+
title: string;
|
|
3
|
+
summary: string;
|
|
4
|
+
phase: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const initOnboardingSteps: InitOnboardingStepDefinition[];
|
|
7
|
+
export declare function renderInitOnboardingWelcome(totalSteps: number): void;
|
|
8
|
+
export declare function renderInitOnboardingFrame(currentStepNumber: number, totalSteps: number, options?: {
|
|
9
|
+
resumed?: boolean;
|
|
10
|
+
}): void;
|
|
11
|
+
export declare function renderInitOnboardingComplete(appId: string, nextUploadCommand: string, debugCommand: string): void;
|
|
12
|
+
export declare function formatInitResumeMessage(stepDone: number, totalSteps: number): string;
|
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((DhD,Rx)=>{var d6=p("constants"),gQD=process.cwd,WY=null,mQD=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!WY)WY=gQD.call(process);return WY};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(KY=process.chdir,process.chdir=function(D){WY=null,KY.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,KY)}var KY;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=Y(D.chmod),D.fchmod=Y(D.fchmod),D.lchmod=Y(D.lchmod),D.chownSync=F(D.chownSync),D.fchownSync=F(D.fchownSync),D.lchownSync=F(D.lchownSync),D.chmodSync=J(D.chmodSync),D.fchmodSync=J(D.fchmodSync),D.lchmodSync=J(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(U,O,q){if(q)process.nextTick(q)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(U,O,q,z){if(z)process.nextTick(z)},D.lchownSync=function(){};if(mQD==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(U){function O(q,z,B){var W=Date.now(),L=0;U(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")U(q,z,M);else B(I)})},L),L<100)L+=10;return}if(B)B(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(O,U);return O}(D.rename);D.read=typeof D.read!=="function"?D.read:function(U){function O(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++,U.call(D,q,z,B,W,L,I);M.apply(this,arguments)}}return U.call(D,q,z,B,W,L,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(O,U);return O}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(U){return function(O,q,z,B,W){var L=0;while(!0)try{return U.call(D,O,q,z,B,W)}catch(M){if(M.code==="EAGAIN"&&L<10){L++;continue}throw M}}}(D.readSync);function $(U){U.lchmod=function(O,q,z){U.open(O,d6.O_WRONLY|d6.O_SYMLINK,q,function(B,W){if(B){if(z)z(B);return}U.fchmod(W,q,function(L){U.close(W,function(M){if(z)z(L||M)})})})},U.lchmodSync=function(O,q){var z=U.openSync(O,d6.O_WRONLY|d6.O_SYMLINK,q),B=!0,W;try{W=U.fchmodSync(z,q),B=!1}finally{if(B)try{U.closeSync(z)}catch(L){}else U.closeSync(z)}return W}}function X(U){if(d6.hasOwnProperty("O_SYMLINK")&&U.futimes)U.lutimes=function(O,q,z,B){U.open(O,d6.O_SYMLINK,function(W,L){if(W){if(B)B(W);return}U.futimes(L,q,z,function(M){U.close(L,function(I){if(B)B(M||I)})})})},U.lutimesSync=function(O,q,z){var B=U.openSync(O,d6.O_SYMLINK),W,L=!0;try{W=U.futimesSync(B,q,z),L=!1}finally{if(L)try{U.closeSync(B)}catch(M){}else U.closeSync(B)}return W};else if(U.futimes)U.lutimes=function(O,q,z,B){if(B)process.nextTick(B)},U.lutimesSync=function(){}}function Y(U){if(!U)return U;return function(O,q,z){return U.call(D,O,q,function(B){if(G(B))B=null;if(z)z.apply(this,arguments)})}}function J(U){if(!U)return U;return function(O,q){try{return U.call(D,O,q)}catch(z){if(!G(z))throw z}}}function Q(U){if(!U)return U;return function(O,q,z,B){return U.call(D,O,q,z,function(W){if(G(W))W=null;if(B)B.apply(this,arguments)})}}function F(U){if(!U)return U;return function(O,q,z){try{return U.call(D,O,q,z)}catch(B){if(!G(B))throw B}}}function Z(U){if(!U)return U;return function(O,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?U.call(D,O,q,B):U.call(D,O,B)}}function w(U){if(!U)return U;return function(O,q){var z=q?U.call(D,O,q):U.call(D,O);if(z){if(z.uid<0)z.uid+=4294967296;if(z.gid<0)z.gid+=4294967296}return z}}function G(U){if(!U)return!0;if(U.code==="ENOSYS")return!0;var O=!process.getuid||process.getuid()!==0;if(O){if(U.code==="EINVAL"||U.code==="EPERM")return!0}return!1}}});var Cx=T(($hD,Tx)=>{var Ex=p("stream").Stream;Tx.exports=dQD;function dQD(D){return{ReadStream:$,WriteStream:X};function $(Y,J){if(!(this instanceof $))return new $(Y,J);Ex.call(this);var Q=this;this.path=Y,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,J=J||{};var F=Object.keys(J);for(var Z=0,w=F.length;Z<w;Z++){var G=F[Z];this[G]=J[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(U,O){if(U){Q.emit("error",U),Q.readable=!1;return}Q.fd=O,Q.emit("open",O),Q._read()})}function X(Y,J){if(!(this instanceof X))return new X(Y,J);Ex.call(this),this.path=Y,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,J=J||{};var Q=Object.keys(J);for(var F=0,Z=Q.length;F<Z;F++){var w=Q[F];this[w]=J[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((XhD,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,CO)=>{var M0=p("fs"),iQD=jx(),pQD=Cx(),rQD=xx(),HY=p("util"),o0,NY;if(typeof Symbol==="function"&&typeof Symbol.for==="function")o0=Symbol.for("graceful-fs.queue"),NY=Symbol.for("graceful-fs.previous");else o0="___graceful-fs.queue",NY="___graceful-fs.previous";function oQD(){}function ux(D,$){Object.defineProperty(D,o0,{get:function(){return $}})}var $8=oQD;if(HY.debuglog)$8=HY.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))$8=function(){var D=HY.format.apply(HY,arguments);D="GFS4: "+D.split(/\n/).join(`
|
|
130
|
-
GFS4: `),console.error(D)};if(!M0[o0]){if(jO=global[o0]||[],ux(M0,jO),M0.close=function(D){function $(X,Y){return D.call(M0,X,function(J){if(!J)Sx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,NY,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),Sx()}return Object.defineProperty($,NY,{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 jO;if(!global[o0])ux(global,M0[o0]);CO.exports=EO(rQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)CO.exports=EO(M0),M0.__patched=!0;function EO(D){iQD(D),D.gracefulify=EO,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 Y=D.writeFile;D.writeFile=J;function J(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return Y(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=O;var U=/^v[0-5]\./;function O(_,u,x){if(typeof u==="function")x=u,u=null;var h=U.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),TO()}var VY;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;TO()}function TO(){if(clearTimeout(VY),VY=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var Z=Date.now()-Q,w=Math.max(Q-J,1),G=Math.min(w*1.2,100);if(Z>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([J]));else M0[o0].push(D)}if(VY===void 0)VY=setTimeout(TO,0)}});var _x=T((YhD,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 Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.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 Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,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 Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};tQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};tQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(w){var G=tQD.operation($),U=Array.prototype.slice.call(arguments,1),O=U.pop();U.push(function(q){if(G.retry(q))return;if(q)arguments[0]=G.mainError();O.apply(this,arguments)}),G.attempt(function(){w.apply(D,U)})}.bind(D,F),D[Q].options=$}}});var yx=T((FhD,LY)=>{LY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")LY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")LY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var AY=T((ZhD,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(PO=p("assert"),J8=yx(),xO=/^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(PO.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)MY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)B3()};return g0.on(X,D),Y},B3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,W3[$])}catch(X){}}),K0.emit=K3,K0.reallyExit=IY,g0.count-=1},y9.exports.unload=B3,l6=function($,X,Y){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,Y)},W3={},J8.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),xO&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),y9.exports.signals=function(){return J8},Y8=!1,MY=function(){if(Y8||!X8(global.process))return;Y8=!0,g0.count+=1,J8=J8.filter(function($){try{return K0.on($,W3[$]),!0}catch(X){return!1}}),K0.emit=uO,K0.reallyExit=SO},y9.exports.load=MY,IY=K0.reallyExit,SO=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),IY.call(K0,K0.exitCode)},K3=K0.emit,uO=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=K3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return K3.apply(this,arguments)}}var PO,J8,xO,f9,g0,B3,l6,W3,Y8,MY,IY,SO,K3,uO});var hx=T((JFD,vO)=>{var bx=Symbol();function $FD(D,$,X){let Y=$[bx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(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($)}JFD.probe=$FD;JFD.getMtime=XFD});var lx=T((qFD,V3)=>{var FFD=p("path"),fO=S0(),ZFD=fx(),wFD=AY(),gx=hx(),Z6={};function H3(D,$){return $.lockfilePath||`${D}.lock`}function yO(D,$,X){if(!$.realpath)return X(null,FFD.resolve(D));$.fs.realpath(D,X)}function kO(D,$,X){let Y=H3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return gx.probe(Y,$.fs,(Q,F,Z)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,Z)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return kO(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);kO(D,{...$,stale:0},X)})})})}function mx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function cx(D,$,X){$.fs.rmdir(H3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function RY(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,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return _O(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return _O(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 _O(D,X,Object.assign(w,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RY(D,$)}X.mtime=Z,X.lastUpdate=Date.now(),X.updateDelay=null,RY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function _O(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:fO,onCompromised:(Y)=>{throw Y},...$},$.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),yO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=ZFD.operation($.retries);Q.attempt(()=>{kO(J,$,(F,Z,w)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Z6[J]={lockfilePath:H3(J,$),mtime:Z,mtimePrecision:w,options:$,lastUpdate:Date.now()};RY(J,$),X(null,(U)=>{if(G.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dx(J,{...$,realpath:!1},U)})})})})}function dx(D,$,X){$={fs:fO,realpath:!0,...$},yO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Z6[J];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[J],cx(J,$,X)})}function UFD(D,$,X){$={stale:1e4,realpath:!0,fs:fO,...$},$.stale=Math.max($.stale||0,2000),yO(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(H3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!mx(F,$))})})}function OFD(){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=UFD;qFD.getLocks=OFD});var ix=T((whD,nx)=>{var HFD=S0();function VFD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(Z){return Q(Z)}Q(null,F)}}),X}function NFD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function LFD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}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((GhD,n6)=>{var b9=lx(),{toPromise:jY,toSync:EY,toSyncOptions:bO}=ix();async function px(D,$){let X=await jY(b9.lock)(D,$);return jY(X)}function IFD(D,$){let X=EY(b9.lock)(D,bO($));return EY(X)}function AFD(D,$){return jY(b9.unlock)(D,$)}function RFD(D,$){return EY(b9.unlock)(D,bO($))}function jFD(D,$){return jY(b9.check)(D,$)}function EFD(D,$){return EY(b9.check)(D,bO($))}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(Y){return Y?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 Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}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 Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,uFD(Y.key),Y)}}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 Y=X.call(D,$||"default");if(N3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var UhD=ex.canStoreURLs=!0,OhD=ex.FileUrlStorage=function(){function D($){xFD(this,D),this.path=$}return SFD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,Z){if(F)Q(F);else J(Z)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(Z,w){J._setItem(F,Y,function(G){if(G)w(G);else Z(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;ax.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(Z,w){if(Z){J(Z);return}w[X]=Y,Q._writeData(w,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);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});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;ax.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,Z){if(F){Y(F);return}delete Z[X],J._writeData(Z,function(w){return Y(w)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,TFD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,ox.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,ox.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var CY=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(bU()),fFD=hU(),yFD=Q8(rT()),hO=Q8(TC()),bFD=Q8(pC()),hFD=Q8(sC()),QS=Q8(BP()),gFD=Q8(aU()),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 Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,wS(Y.key),Y)}}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 $=TY($),lFD(D,ZS()?Reflect.construct($,X||[],TY(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 TY(D){return TY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},TY(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}),$)gO(D,$)}function gO(D,$){return gO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},gO(D,$)}function JS(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function h9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?JS(Object(X),!0).forEach(function(Y){pFD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):JS(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}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 Y=X.call(D,$||"default");if(g9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var YS=i6.defaultOptions=h9(h9({},hO.default.defaultOptions),{},{httpStack:new QS.default,fileReader:new bFD.default,urlStorage:new yFD.default,fingerprint:hFD.default}),zhD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mFD(this,$),Y=h9(h9({},YS),Y),dFD(this,$,[X,Y])}return iFD($,D),cFD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=h9(h9({},YS),J),hO.default.terminate(Y,J)}}])}(hO.default),BhD=i6.isSupported=!0});var H$;var L3=o(()=>{H$={name:"@capgo/cli",type:"module",version:"7.88.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: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 PY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function F0(){let D=await PY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==H$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${H$.version} it's not the latest version.
|
|
130
|
+
GFS4: `),console.error(D)};if(!M0[o0]){if(jO=global[o0]||[],ux(M0,jO),M0.close=function(D){function $(X,Y){return D.call(M0,X,function(J){if(!J)Sx();if(typeof Y==="function")Y.apply(this,arguments)})}return Object.defineProperty($,NY,{value:D}),$}(M0.close),M0.closeSync=function(D){function $(X){D.apply(M0,arguments),Sx()}return Object.defineProperty($,NY,{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 jO;if(!global[o0])ux(global,M0[o0]);CO.exports=EO(rQD(M0));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!M0.__patched)CO.exports=EO(M0),M0.__patched=!0;function EO(D){iQD(D),D.gracefulify=EO,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 Y=D.writeFile;D.writeFile=J;function J(_,u,x,h){if(typeof x==="function")h=x,x=null;return b(_,u,x,h);function b(l,f,j,S,v){return Y(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=O;var U=/^v[0-5]\./;function O(_,u,x){if(typeof u==="function")x=u,u=null;var h=U.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),TO()}var VY;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;TO()}function TO(){if(clearTimeout(VY),VY=void 0,M0[o0].length===0)return;var D=M0[o0].shift(),$=D[0],X=D[1],Y=D[2],J=D[3],Q=D[4];if(J===void 0)$8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-J>=60000){$8("TIMEOUT",$.name,X);var F=X.pop();if(typeof F==="function")F.call(null,Y)}else{var Z=Date.now()-Q,w=Math.max(Q-J,1),G=Math.min(w*1.2,100);if(Z>=G)$8("RETRY",$.name,X),$.apply(null,X.concat([J]));else M0[o0].push(D)}if(VY===void 0)VY=setTimeout(TO,0)}});var _x=T((YhD,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 Y=this,J=setTimeout(function(){if(Y._attempts++,Y._operationTimeoutCb){if(Y._timeout=setTimeout(function(){Y._operationTimeoutCb(Y._attempts)},Y._operationTimeout),Y._options.unref)Y._timeout.unref()}Y._fn(Y._attempts)},X);if(this._options.unref)J.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 Y=0;Y<this._errors.length;Y++){var J=this._errors[Y],Q=J.message,F=(D[Q]||0)+1;if(D[Q]=F,F>=X)$=J,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 Y=[];for(var J=0;J<$.retries;J++)Y.push(this.createTimeout(J,$));if(D&&D.forever&&!Y.length)Y.push(this.createTimeout(J,$));return Y.sort(function(Q,F){return Q-F}),Y};tQD.createTimeout=function(D,$){var X=$.randomize?Math.random()+1:1,Y=Math.round(X*$.minTimeout*Math.pow($.factor,D));return Y=Math.min(Y,$.maxTimeout),Y};tQD.wrap=function(D,$,X){if($ instanceof Array)X=$,$=null;if(!X){X=[];for(var Y in D)if(typeof D[Y]==="function")X.push(Y)}for(var J=0;J<X.length;J++){var Q=X[J],F=D[Q];D[Q]=function(w){var G=tQD.operation($),U=Array.prototype.slice.call(arguments,1),O=U.pop();U.push(function(q){if(G.retry(q))return;if(q)arguments[0]=G.mainError();O.apply(this,arguments)}),G.attempt(function(){w.apply(D,U)})}.bind(D,F),D[Q].options=$}}});var yx=T((FhD,LY)=>{LY.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")LY.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")LY.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var AY=T((ZhD,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(PO=p("assert"),J8=yx(),xO=/^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(PO.equal(typeof D,"function","a callback must be provided for exit handler"),Y8===!1)MY();var X="exit";if($&&$.alwaysLast)X="afterexit";var Y=function(){if(g0.removeListener(X,D),g0.listeners("exit").length===0&&g0.listeners("afterexit").length===0)B3()};return g0.on(X,D),Y},B3=function(){if(!Y8||!X8(global.process))return;Y8=!1,J8.forEach(function($){try{K0.removeListener($,W3[$])}catch(X){}}),K0.emit=K3,K0.reallyExit=IY,g0.count-=1},y9.exports.unload=B3,l6=function($,X,Y){if(g0.emitted[$])return;g0.emitted[$]=!0,g0.emit($,X,Y)},W3={},J8.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),xO&&D==="SIGHUP")D="SIGINT";K0.kill(K0.pid,D)}}}),y9.exports.signals=function(){return J8},Y8=!1,MY=function(){if(Y8||!X8(global.process))return;Y8=!0,g0.count+=1,J8=J8.filter(function($){try{return K0.on($,W3[$]),!0}catch(X){return!1}}),K0.emit=uO,K0.reallyExit=SO},y9.exports.load=MY,IY=K0.reallyExit,SO=function($){if(!X8(global.process))return;K0.exitCode=$||0,l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),IY.call(K0,K0.exitCode)},K3=K0.emit,uO=function($,X){if($==="exit"&&X8(global.process)){if(X!==void 0)K0.exitCode=X;var Y=K3.apply(this,arguments);return l6("exit",K0.exitCode,null),l6("afterexit",K0.exitCode,null),Y}else return K3.apply(this,arguments)}}var PO,J8,xO,f9,g0,B3,l6,W3,Y8,MY,IY,SO,K3,uO});var hx=T((JFD,vO)=>{var bx=Symbol();function $FD(D,$,X){let Y=$[bx];if(Y)return $.stat(D,(Q,F)=>{if(Q)return X(Q);X(null,F.mtime,Y)});let J=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,J,J,(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($)}JFD.probe=$FD;JFD.getMtime=XFD});var lx=T((qFD,V3)=>{var FFD=p("path"),fO=S0(),ZFD=fx(),wFD=AY(),gx=hx(),Z6={};function H3(D,$){return $.lockfilePath||`${D}.lock`}function yO(D,$,X){if(!$.realpath)return X(null,FFD.resolve(D));$.fs.realpath(D,X)}function kO(D,$,X){let Y=H3(D,$);$.fs.mkdir(Y,(J)=>{if(!J)return gx.probe(Y,$.fs,(Q,F,Z)=>{if(Q)return $.fs.rmdir(Y,()=>{}),X(Q);X(null,F,Z)});if(J.code!=="EEXIST")return X(J);if($.stale<=0)return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));$.fs.stat(Y,(Q,F)=>{if(Q){if(Q.code==="ENOENT")return kO(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);kO(D,{...$,stale:0},X)})})})}function mx(D,$){return D.mtime.getTime()<Date.now()-$.stale}function cx(D,$,X){$.fs.rmdir(H3(D,$),(Y)=>{if(Y&&Y.code!=="ENOENT")return X(Y);X()})}function RY(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,(Y,J)=>{let Q=X.lastUpdate+$.stale<Date.now();if(Y){if(Y.code==="ENOENT"||Q)return _O(D,X,Object.assign(Y,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RY(D,$)}if(X.mtime.getTime()!==J.mtime.getTime())return _O(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 _O(D,X,Object.assign(w,{code:"ECOMPROMISED"}));return X.updateDelay=1000,RY(D,$)}X.mtime=Z,X.lastUpdate=Date.now(),X.updateDelay=null,RY(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function _O(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:fO,onCompromised:(Y)=>{throw Y},...$},$.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),yO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=ZFD.operation($.retries);Q.attempt(()=>{kO(J,$,(F,Z,w)=>{if(Q.retry(F))return;if(F)return X(Q.mainError());let G=Z6[J]={lockfilePath:H3(J,$),mtime:Z,mtimePrecision:w,options:$,lastUpdate:Date.now()};RY(J,$),X(null,(U)=>{if(G.released)return U&&U(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));dx(J,{...$,realpath:!1},U)})})})})}function dx(D,$,X){$={fs:fO,realpath:!0,...$},yO(D,$,(Y,J)=>{if(Y)return X(Y);let Q=Z6[J];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[J],cx(J,$,X)})}function UFD(D,$,X){$={stale:1e4,realpath:!0,fs:fO,...$},$.stale=Math.max($.stale||0,2000),yO(D,$,(Y,J)=>{if(Y)return X(Y);$.fs.stat(H3(J,$),(Q,F)=>{if(Q)return Q.code==="ENOENT"?X(null,!1):X(Q);return X(null,!mx(F,$))})})}function OFD(){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=UFD;qFD.getLocks=OFD});var ix=T((whD,nx)=>{var HFD=S0();function VFD(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((Y)=>{X[Y]=(...J)=>{let Q=J.pop(),F;try{F=D[`${Y}Sync`](...J)}catch(Z){return Q(Z)}Q(null,F)}}),X}function NFD(D){return(...$)=>new Promise((X,Y)=>{$.push((J,Q)=>{if(J)Y(J);else X(Q)}),D(...$)})}function LFD(D){return(...$)=>{let X,Y;if($.push((J,Q)=>{X=J,Y=Q}),D(...$),X)throw X;return Y}}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((GhD,n6)=>{var b9=lx(),{toPromise:jY,toSync:EY,toSyncOptions:bO}=ix();async function px(D,$){let X=await jY(b9.lock)(D,$);return jY(X)}function IFD(D,$){let X=EY(b9.lock)(D,bO($));return EY(X)}function AFD(D,$){return jY(b9.unlock)(D,$)}function RFD(D,$){return EY(b9.unlock)(D,bO($))}function jFD(D,$){return jY(b9.check)(D,$)}function EFD(D,$){return EY(b9.check)(D,bO($))}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(Y){return Y?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 Y={__proto__:null},J=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Q in D)if(Q!=="default"&&{}.hasOwnProperty.call(D,Q)){var F=J?Object.getOwnPropertyDescriptor(D,Q):null;F&&(F.get||F.set)?Object.defineProperty(Y,Q,F):Y[Q]=D[Q]}return Y.default=D,X&&X.set(D,Y),Y}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 Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,uFD(Y.key),Y)}}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 Y=X.call(D,$||"default");if(N3(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var UhD=ex.canStoreURLs=!0,OhD=ex.FileUrlStorage=function(){function D($){xFD(this,D),this.path=$}return SFD(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(Y,J){X._getItems("tus::",function(Q,F){if(Q)J(Q);else Y(F)})})}},{key:"findUploadsByFingerprint",value:function(X){var Y=this;return new Promise(function(J,Q){Y._getItems("tus::".concat(X),function(F,Z){if(F)Q(F);else J(Z)})})}},{key:"removeUpload",value:function(X){var Y=this;return new Promise(function(J,Q){Y._removeItem(X,function(F){if(F)Q(F);else J()})})}},{key:"addUpload",value:function(X,Y){var J=this,Q=Math.round(Math.random()*1000000000000),F="tus::".concat(X,"::").concat(Q);return new Promise(function(Z,w){J._setItem(F,Y,function(G){if(G)w(G);else Z(F)})})}},{key:"_setItem",value:function(X,Y,J){var Q=this;ax.lock(this.path,this._lockfileOptions()).then(function(F){J=Q._releaseAndCb(F,J),Q._getData(function(Z,w){if(Z){J(Z);return}w[X]=Y,Q._writeData(w,function(G){return J(G)})})}).catch(J)}},{key:"_getItems",value:function(X,Y){this._getData(function(J,Q){if(J){Y(J);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});Y(null,F)})}},{key:"_removeItem",value:function(X,Y){var J=this;ax.lock(this.path,this._lockfileOptions()).then(function(Q){Y=J._releaseAndCb(Q,Y),J._getData(function(F,Z){if(F){Y(F);return}delete Z[X],J._writeData(Z,function(w){return Y(w)})})}).catch(Y)}},{key:"_lockfileOptions",value:function(){return{realpath:!1,retries:{retries:5,minTimeout:20}}}},{key:"_releaseAndCb",value:function(X,Y){return function(J){if(J){X().then(function(){return Y(J)}).catch(function(Q){return Y((0,TFD.default)([J,Q]))});return}X().then(Y).catch(Y)}}},{key:"_writeData",value:function(X,Y){var J={encoding:"utf8",mode:432,flag:"w"};(0,ox.writeFile)(this.path,JSON.stringify(X),J,function(Q){return Y(Q)})}},{key:"_getData",value:function(X){(0,ox.readFile)(this.path,"utf8",function(Y,J){if(Y){if(Y.code==="ENOENT")X(null,{});else X(Y);return}try{J=!J.trim().length?{}:JSON.parse(J)}catch(Q){X(Q);return}X(null,J)})}}])}()});var CY=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(bU()),fFD=hU(),yFD=Q8(rT()),hO=Q8(TC()),bFD=Q8(pC()),hFD=Q8(sC()),QS=Q8(BP()),gFD=Q8(aU()),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 Y=$[X];if(Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y)Y.writable=!0;Object.defineProperty(D,wS(Y.key),Y)}}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 $=TY($),lFD(D,ZS()?Reflect.construct($,X||[],TY(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 TY(D){return TY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},TY(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}),$)gO(D,$)}function gO(D,$){return gO=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,J){return Y.__proto__=J,Y},gO(D,$)}function JS(D,$){var X=Object.keys(D);if(Object.getOwnPropertySymbols){var Y=Object.getOwnPropertySymbols(D);$&&(Y=Y.filter(function(J){return Object.getOwnPropertyDescriptor(D,J).enumerable})),X.push.apply(X,Y)}return X}function h9(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?JS(Object(X),!0).forEach(function(Y){pFD(D,Y,X[Y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):JS(Object(X)).forEach(function(Y){Object.defineProperty(D,Y,Object.getOwnPropertyDescriptor(X,Y))})}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 Y=X.call(D,$||"default");if(g9(Y)!="object")return Y;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var YS=i6.defaultOptions=h9(h9({},hO.default.defaultOptions),{},{httpStack:new QS.default,fileReader:new bFD.default,urlStorage:new yFD.default,fingerprint:hFD.default}),zhD=i6.Upload=function(D){function $(){var X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return mFD(this,$),Y=h9(h9({},YS),Y),dFD(this,$,[X,Y])}return iFD($,D),cFD($,null,[{key:"terminate",value:function(Y){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return J=h9(h9({},YS),J),hO.default.terminate(Y,J)}}])}(hO.default),BhD=i6.isSupported=!0});var H$;var L3=o(()=>{H$={name:"@capgo/cli",type:"module",version:"7.88.2",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 PY(D){try{let X=`https://registry.npmjs.org/${encodeURIComponent(D.toLowerCase())}`,Y=await fetch(X,{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"}});if(!Y.ok)return null;return(await Y.json())["dist-tags"]?.latest||null}catch{return null}}async function F0(){let D=await PY("@capgo/cli")??"",$=D?.split(".")[0];if(D!==H$.version)H.warning(`\uD83D\uDEA8 You are using @capgo/cli@${H$.version} it's not the latest version.
|
|
131
131
|
Please use @capgo/cli@${D}" or @capgo/cli@${$} to keep up to date with the latest features and bug fixes.`)}var O1=o(()=>{vD();L3()});async function qS(D,$,X,Y,J,Q="✅"){await AD(X,{channel:D,event:Y,icon:Q,user_id:$,...J?{tags:{"app-id":J}}:{},notify:!1})}var zS=o(()=>{vD();D6();O1();kD()});import{Buffer as BS}from"node:buffer";import{createHash as aFD}from"node:crypto";function sFD(D){let $=4294967295;for(let X=0;X<D.length;X++){let Y=D[X];$=tFD[($^Y)&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 sFD(X);let Y=aFD($);return Y.update(X),Y.digest("hex")}var tFD;var M3=o(()=>{tFD=(()=>{let D=[];for(let $=0;$<256;$++){let X=$;for(let Y=0;Y<8;Y++)X=X&1?3988292384^X>>>1:X>>>1;D[$]=X}return D})()});var KS=T((xhD,WS)=>{var m9=1000,c9=m9*60,d9=c9*60,F8=d9*24,eFD=F8*7,DZD=F8*365.25;WS.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return $ZD(D);else if(X==="number"&&isFinite(D))return $.long?JZD(D):XZD(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function $ZD(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]),Y=($[2]||"ms").toLowerCase();switch(Y){case"years":case"year":case"yrs":case"yr":case"y":return X*DZD;case"weeks":case"week":case"w":return X*eFD;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 XZD(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 xY(D,$,F8,"day");if($>=d9)return xY(D,$,d9,"hour");if($>=c9)return xY(D,$,c9,"minute");if($>=m9)return xY(D,$,m9,"second");return D+" ms"}function xY(D,$,X,Y){var J=$>=X*1.5;return Math.round(D/X)+" "+Y+(J?"s":"")}});var mO=T((ShD,HS)=>{function YZD(D){X.debug=X,X.default=X,X.coerce=w,X.disable=F,X.enable=J,X.enabled=Z,X.humanize=KS(),X.destroy=G,Object.keys(D).forEach((U)=>{X[U]=D[U]}),X.names=[],X.skips=[],X.formatters={};function $(U){let O=0;for(let q=0;q<U.length;q++)O=(O<<5)-O+U.charCodeAt(q),O|=0;return X.colors[Math.abs(O)%X.colors.length]}X.selectColor=$;function X(U){let O,q=null,z,B;function W(...L){if(!W.enabled)return;let M=W,I=Number(new Date),K=I-(O||I);if(M.diff=K,M.prev=O,M.curr=I,O=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=U,W.useColors=X.useColors(),W.color=X.selectColor(U),W.extend=Y,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(U);return B},set:(L)=>{q=L}}),typeof X.init==="function")X.init(W);return W}function Y(U,O){let q=X(this.namespace+(typeof O>"u"?":":O)+U);return q.log=this.log,q}function J(U){X.save(U),X.namespaces=U,X.names=[],X.skips=[];let O=(typeof U==="string"?U:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let q of O)if(q[0]==="-")X.skips.push(q.slice(1));else X.names.push(q)}function Q(U,O){let q=0,z=0,B=-1,W=0;while(q<U.length)if(z<O.length&&(O[z]===U[q]||O[z]==="*"))if(O[z]==="*")B=z,W=q,z++;else q++,z++;else if(B!==-1)z=B+1,W++,q=W;else return!1;while(z<O.length&&O[z]==="*")z++;return z===O.length}function F(){let U=[...X.names,...X.skips.map((O)=>"-"+O)].join(",");return X.enable(""),U}function Z(U){for(let O of X.skips)if(Q(U,O))return!1;for(let O of X.names)if(Q(U,O))return!0;return!1}function w(U){if(U instanceof Error)return U.stack||U.message;return U}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=YZD});var NS=T((VS,SY)=>{VS.formatArgs=FZD;VS.save=ZZD;VS.load=wZD;VS.useColors=QZD;VS.storage=GZD();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 QZD(){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 FZD(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+SY.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;D.splice(1,0,$,"color: inherit");let X=0,Y=0;D[0].replace(/%[a-zA-Z%]/g,(J)=>{if(J==="%%")return;if(X++,J==="%c")Y=X}),D.splice(Y,0,$)}VS.log=console.debug||console.log||(()=>{});function ZZD(D){try{if(D)VS.storage.setItem("debug",D);else VS.storage.removeItem("debug")}catch($){}}function wZD(){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 GZD(){try{return localStorage}catch(D){}}SY.exports=mO()(VS);var{formatters:UZD}=SY.exports;UZD.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var MS=T((vhD,LS)=>{LS.exports=(D,$=process.argv)=>{let X=D.startsWith("-")?"":D.length===1?"-":"--",Y=$.indexOf(X+D),J=$.indexOf("--");return Y!==-1&&(J===-1||Y<J)}});var RS=T((_hD,AS)=>{var VZD=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 cO(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function dO(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 Y=VZD.release().split(".");if(Number(Y[0])>=10&&Number(Y[2])>=10586)return Number(Y[2])>=14931?3:2;return 1}if("CI"in n0){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((Y)=>(Y 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 Y=parseInt((n0.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n0.TERM_PROGRAM){case"iTerm.app":return Y>=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 NZD(D){let $=dO(D,D&&D.isTTY);return cO($)}AS.exports={supportsColor:NZD,stdout:cO(dO(!0,IS.isatty(1))),stderr:cO(dO(!0,IS.isatty(2)))}});var CS=T((ES,vY)=>{var LZD=p("tty"),uY=p("util");ES.init=TZD;ES.log=RZD;ES.formatArgs=IZD;ES.save=jZD;ES.load=EZD;ES.useColors=MZD;ES.destroy=uY.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,(J,Q)=>{return Q.toUpperCase()}),Y=process.env[$];if(/^(yes|on|true|enabled)$/i.test(Y))Y=!0;else if(/^(no|off|false|disabled)$/i.test(Y))Y=!1;else if(Y==="null")Y=null;else Y=Number(Y);return D[X]=Y,D},{});function MZD(){return"colors"in ES.inspectOpts?Boolean(ES.inspectOpts.colors):LZD.isatty(process.stderr.fd)}function IZD(D){let{namespace:$,useColors:X}=this;if(X){let Y=this.color,J="\x1B[3"+(Y<8?Y:"8;5;"+Y),Q=` ${J};1m${$} \x1B[0m`;D[0]=Q+D[0].split(`
|
|
132
132
|
`).join(`
|
|
133
133
|
`+Q),D.push(J+"m+"+vY.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=AZD()+$+" "+D[0]}function AZD(){if(ES.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function RZD(...D){return process.stderr.write(uY.formatWithOptions(ES.inspectOpts,...D)+`
|
package/package.json
CHANGED
|
@@ -9,13 +9,14 @@ Use this skill for Capgo Cloud native iOS and Android build workflows.
|
|
|
9
9
|
|
|
10
10
|
## Onboarding (automated iOS setup)
|
|
11
11
|
|
|
12
|
-
### `build onboarding`
|
|
12
|
+
### `build init` (alias: `build onboarding`)
|
|
13
13
|
|
|
14
14
|
- Interactive command that automates iOS certificate and provisioning profile creation.
|
|
15
15
|
- Reduces iOS setup from ~10 manual steps to 1 manual step (creating an API key) + 1 command.
|
|
16
|
-
- Example: `npx @capgo/cli@latest build
|
|
16
|
+
- Example: `npx @capgo/cli@latest build init`
|
|
17
|
+
- Backward compatibility: `npx @capgo/cli@latest build onboarding` still works.
|
|
17
18
|
- Notes:
|
|
18
|
-
- Uses Ink (React for terminal) for the interactive UI
|
|
19
|
+
- Uses Ink (React for terminal) for the interactive UI, alongside the main `init` onboarding flow.
|
|
19
20
|
- Requires running inside a Capacitor project directory with an `ios/` folder.
|
|
20
21
|
- The user creates ONE App Store Connect API key (.p8 file), then the CLI handles everything else.
|
|
21
22
|
- On macOS, offers a native file picker dialog for .p8 selection.
|
package/skills/usage/SKILL.md
CHANGED
|
@@ -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.
|
|
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 offer cancellation every third failed retry.
|
|
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.
|