@capgo/cli 8.0.8 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "8.0.8",
4
+ "version": "8.1.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -111,7 +111,9 @@
111
111
  "test:app-verification": "bun test/test-app-verification.mjs",
112
112
  "test:pbxproj-parser": "bun test/test-pbxproj-parser.mjs",
113
113
  "test:manifest-path-encoding": "bun test/test-manifest-path-encoding.mjs",
114
- "test": "bun run build && bun run test:version-detection:setup && 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:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && 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 && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files",
114
+ "test:self-update": "bun test/test-self-update.mjs",
115
+ "test:update-prompt": "bun test/test-update-prompt.mjs",
116
+ "test": "bun run build && bun run test:version-detection:setup && 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:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && 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 && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt",
115
117
  "test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
116
118
  "test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
117
119
  "test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",
@@ -2,5 +2,14 @@ export interface OnboardingBuilderOptions {
2
2
  apikey?: string;
3
3
  platform?: string;
4
4
  supaHost?: string;
5
+ /**
6
+ * Offer the self-update prompt as the first wizard screen. ONLY the genuine
7
+ * `build init` / `onboarding` entrypoint sets this. Other callers that reach
8
+ * onboarding as a sub-step (`bundle upload`'s launch-onboarding,
9
+ * `build credentials manage`) must leave it false: their process.argv is the
10
+ * wrapper command (`bundle upload …`), so a re-exec would repeat THAT command
11
+ * (e.g. re-run the upload) instead of `build init`.
12
+ */
13
+ enableSelfUpdate?: boolean;
5
14
  }
6
15
  export declare function onboardingBuilderCommand(options?: OnboardingBuilderOptions): Promise<void>;
@@ -0,0 +1,101 @@
1
+ import type { PackageManagerType } from '@capgo/find-package-manager';
2
+ /**
3
+ * Set on the re-exec'd child so the freshly-launched (already-updated) process
4
+ * never re-prompts. Without this, a brief npm-registry propagation lag — where
5
+ * the new version isn't yet visible to the child's own check — could cause an
6
+ * infinite update → relaunch → update loop.
7
+ */
8
+ export declare const SKIP_UPDATE_ENV = "CAPGO_SKIP_UPDATE_PROMPT";
9
+ type DependencySection = 'dependencies' | 'devDependencies' | 'optionalDependencies';
10
+ export interface CliDependencyDeclaration {
11
+ packageJsonPath: string;
12
+ section: DependencySection;
13
+ range: string;
14
+ }
15
+ /**
16
+ * Walk up from `startDir` (inclusive) to `rootDir` (inclusive) and return the
17
+ * first package.json that declares @capgo/cli, with its section + range.
18
+ *
19
+ * In a monorepo this finds the app sub-package's declaration when present,
20
+ * otherwise the workspace root's. Returns null when nothing on that path
21
+ * declares the CLI — i.e. it was launched ephemerally (npx/bunx/dlx), so there
22
+ * is no on-disk dependency to update.
23
+ */
24
+ export declare function findCliDeclaration(startDir: string, rootDir: string): CliDependencyDeclaration | null;
25
+ /**
26
+ * Resolve the on-disk entry script of the installed @capgo/cli by walking up
27
+ * node_modules from `startDir` (hoisting-aware, so it finds the workspace-root
28
+ * install in a monorepo). Returns the absolute path to the package's bin entry,
29
+ * or null when the CLI isn't installed anywhere up the tree.
30
+ */
31
+ export declare function resolveInstalledCliEntry(startDir: string): string | null;
32
+ /**
33
+ * Bump a semver range to `latest` while preserving the caret/tilde prefix.
34
+ * Dist-tag ranges ("latest"/"next"/"*"), workspace protocols, and anything
35
+ * without a digit are returned unchanged — reinstalling already re-resolves
36
+ * those, and we must not clobber an intentional tag with a pinned version.
37
+ */
38
+ export declare function bumpRange(oldRange: string, latest: string): string;
39
+ /**
40
+ * Pure transform: set @capgo/cli in `section` to the bumped range within the
41
+ * given package.json text. Preserves 2-space indentation and the trailing
42
+ * newline. Returns null when nothing changed (already at target / a tag range).
43
+ */
44
+ export declare function applyCliBump(packageJsonText: string, section: DependencySection, latest: string): string | null;
45
+ export interface SpawnCommand {
46
+ cmd: string;
47
+ args: string[];
48
+ }
49
+ /**
50
+ * Ephemeral re-exec (Path B): fetch + run the latest CLI through the project's
51
+ * package-manager runner. npx needs `-y` to skip its "Ok to proceed?" install
52
+ * prompt (which would deadlock an automated re-exec); bunx/pnpm dlx/yarn dlx
53
+ * install non-interactively. The flag must precede the package spec so the
54
+ * runner consumes it instead of forwarding it to `capgo`.
55
+ */
56
+ export declare function buildEphemeralReexec(pm: PackageManagerType, forwardArgs: string[]): SpawnCommand;
57
+ /** `<pm> install`, run at the workspace root for Path A (reconciles the
58
+ * lockfile after the package.json bump for npm/yarn/pnpm/bun workspaces). */
59
+ export declare function buildInstallCommand(pm: PackageManagerType): SpawnCommand;
60
+ export type UpdateStrategy = {
61
+ kind: 'project';
62
+ declaration: CliDependencyDeclaration;
63
+ installRoot: string;
64
+ entry: string;
65
+ } | {
66
+ kind: 'ephemeral';
67
+ };
68
+ /**
69
+ * Decide how to update based on how the running process resolved. Path A
70
+ * (project) requires BOTH a declared dependency AND a resolvable local entry,
71
+ * so we can re-exec the exact installed binary after `<pm> install`. Anything
72
+ * else — including "declared but not installed" — falls back to Path B.
73
+ */
74
+ export declare function classifyUpdateStrategy(opts: {
75
+ installRoot: string;
76
+ declaration: CliDependencyDeclaration | null;
77
+ entry: string | null;
78
+ }): UpdateStrategy;
79
+ /**
80
+ * Check whether a newer @capgo/cli is published, capped by a timeout so a slow
81
+ * registry can't stall the wizard. Returns the version pair when an update is
82
+ * available, or null when up to date / timed out / re-exec'd (the SKIP env is
83
+ * set on the relaunched child to avoid an update→relaunch loop).
84
+ *
85
+ * The decision UI lives in the Ink wizard (ui/update-prompt.tsx) — this only
86
+ * resolves the data the prompt needs. The install + re-exec is
87
+ * runUpdateAndReexec, run AFTER Ink tears down.
88
+ */
89
+ export declare function checkForCliUpdate(): Promise<{
90
+ currentVersion: string;
91
+ latestVersion: string;
92
+ } | null>;
93
+ export declare function runUpdateAndReexec(latest: string): void;
94
+ /**
95
+ * Runner-aware "update manually" hint (e.g. `npx -y @capgo/cli@latest build
96
+ * init`, `pnpm dlx @capgo/cli@latest build init`) for the fallback shown when
97
+ * an accepted auto-update fails — so the suggested command matches the user's
98
+ * package manager rather than hardcoding npx.
99
+ */
100
+ export declare function manualUpdateHint(): string;
101
+ export {};
@@ -12,7 +12,7 @@ export interface OnboardingCompletionSummary {
12
12
  buildRequestCommand?: string;
13
13
  }
14
14
  export interface OnboardingResult {
15
- outcome: 'completed' | 'cancelled';
15
+ outcome: 'completed' | 'cancelled' | 'update-requested';
16
16
  /** Present only when outcome === 'completed'. */
17
17
  summary?: OnboardingCompletionSummary;
18
18
  }
@@ -21,6 +21,15 @@ export interface OnboardingShellProps {
21
21
  supaHost?: string;
22
22
  /** Pre-resolved platform (--platform flag or the single existing native dir); skips the picker. */
23
23
  initialPlatform?: Platform;
24
+ /**
25
+ * Set when a newer @capgo/cli is published. Drives the self-update prompt
26
+ * shown as the FIRST wizard screen (before platform selection / auto-load).
27
+ * Undefined → up to date → no prompt.
28
+ */
29
+ updateInfo?: {
30
+ currentVersion: string;
31
+ latestVersion: string;
32
+ };
24
33
  /** Called once a platform is chosen so the caller can print the completion breadcrumb. */
25
34
  onResolvePlatform?: (platform: Platform) => void;
26
35
  /** Called by the mounted app when it reaches the build-complete screen, so the
@@ -0,0 +1,21 @@
1
+ import type { FC } from 'react';
2
+ import type { PlatformPickerLayout } from './frame-fit.js';
3
+ export type UpdateChoice = 'update' | 'skip';
4
+ export type UpdateKeyAction = {
5
+ type: 'select';
6
+ choice: UpdateChoice;
7
+ } | {
8
+ type: 'confirm';
9
+ } | null;
10
+ export declare function updatePromptKeyAction(input: string, key: {
11
+ leftArrow?: boolean;
12
+ rightArrow?: boolean;
13
+ return?: boolean;
14
+ }): UpdateKeyAction;
15
+ export interface UpdatePromptProps {
16
+ layout: PlatformPickerLayout;
17
+ currentVersion: string;
18
+ latestVersion: string;
19
+ onDecide: (choice: UpdateChoice) => void;
20
+ }
21
+ export declare const UpdatePrompt: FC<UpdatePromptProps>;
package/dist/src/sdk.js CHANGED
@@ -124,7 +124,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
124
124
  `)}),$.__defineSetter__("stack",function(X){return[X].concat($.stack).join(`
125
125
 
126
126
  `)}),$}});var tx=E((ve0,rx)=>{var j4=l("constants"),jW0=process.cwd,kF=null,EW0=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!kF)kF=jW0.call(process);return kF};try{process.cwd()}catch(D){}if(typeof process.chdir==="function"){if(fF=process.chdir,process.chdir=function(D){kF=null,fF.call(process,D)},Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,fF)}var fF;rx.exports=AW0;function AW0(D){if(j4.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./))$(D);if(!D.lutimes)X(D);if(D.chown=F(D.chown),D.fchown=F(D.fchown),D.lchown=F(D.lchown),D.chmod=J(D.chmod),D.fchmod=J(D.fchmod),D.lchmod=J(D.lchmod),D.chownSync=Q(D.chownSync),D.fchownSync=Q(D.fchownSync),D.lchownSync=Q(D.lchownSync),D.chmodSync=Y(D.chmodSync),D.fchmodSync=Y(D.fchmodSync),D.lchmodSync=Y(D.lchmodSync),D.stat=U(D.stat),D.fstat=U(D.fstat),D.lstat=U(D.lstat),D.statSync=Z(D.statSync),D.fstatSync=Z(D.fstatSync),D.lstatSync=Z(D.lstatSync),D.chmod&&!D.lchmod)D.lchmod=function(O,q,w){if(w)process.nextTick(w)},D.lchmodSync=function(){};if(D.chown&&!D.lchown)D.lchown=function(O,q,w,W){if(W)process.nextTick(W)},D.lchownSync=function(){};if(EW0==="win32")D.rename=typeof D.rename!=="function"?D.rename:function(O){function q(w,W,K){var H=Date.now(),B=0;O(w,W,function M(I){if(I&&(I.code==="EACCES"||I.code==="EPERM"||I.code==="EBUSY")&&Date.now()-H<60000){if(setTimeout(function(){D.stat(W,function(z,N){if(z&&z.code==="ENOENT")O(w,W,M);else K(I)})},B),B<100)B+=10;return}if(K)K(I)})}if(Object.setPrototypeOf)Object.setPrototypeOf(q,O);return q}(D.rename);D.read=typeof D.read!=="function"?D.read:function(O){function q(w,W,K,H,B,M){var I;if(M&&typeof M==="function"){var z=0;I=function(N,V,A){if(N&&N.code==="EAGAIN"&&z<10)return z++,O.call(D,w,W,K,H,B,I);M.apply(this,arguments)}}return O.call(D,w,W,K,H,B,I)}if(Object.setPrototypeOf)Object.setPrototypeOf(q,O);return q}(D.read),D.readSync=typeof D.readSync!=="function"?D.readSync:function(O){return function(q,w,W,K,H){var B=0;while(!0)try{return O.call(D,q,w,W,K,H)}catch(M){if(M.code==="EAGAIN"&&B<10){B++;continue}throw M}}}(D.readSync);function $(O){O.lchmod=function(q,w,W){O.open(q,j4.O_WRONLY|j4.O_SYMLINK,w,function(K,H){if(K){if(W)W(K);return}O.fchmod(H,w,function(B){O.close(H,function(M){if(W)W(B||M)})})})},O.lchmodSync=function(q,w){var W=O.openSync(q,j4.O_WRONLY|j4.O_SYMLINK,w),K=!0,H;try{H=O.fchmodSync(W,w),K=!1}finally{if(K)try{O.closeSync(W)}catch(B){}else O.closeSync(W)}return H}}function X(O){if(j4.hasOwnProperty("O_SYMLINK")&&O.futimes)O.lutimes=function(q,w,W,K){O.open(q,j4.O_SYMLINK,function(H,B){if(H){if(K)K(H);return}O.futimes(B,w,W,function(M){O.close(B,function(I){if(K)K(M||I)})})})},O.lutimesSync=function(q,w,W){var K=O.openSync(q,j4.O_SYMLINK),H,B=!0;try{H=O.futimesSync(K,w,W),B=!1}finally{if(B)try{O.closeSync(K)}catch(M){}else O.closeSync(K)}return H};else if(O.futimes)O.lutimes=function(q,w,W,K){if(K)process.nextTick(K)},O.lutimesSync=function(){}}function J(O){if(!O)return O;return function(q,w,W){return O.call(D,q,w,function(K){if(G(K))K=null;if(W)W.apply(this,arguments)})}}function Y(O){if(!O)return O;return function(q,w){try{return O.call(D,q,w)}catch(W){if(!G(W))throw W}}}function F(O){if(!O)return O;return function(q,w,W,K){return O.call(D,q,w,W,function(H){if(G(H))H=null;if(K)K.apply(this,arguments)})}}function Q(O){if(!O)return O;return function(q,w,W){try{return O.call(D,q,w,W)}catch(K){if(!G(K))throw K}}}function U(O){if(!O)return O;return function(q,w,W){if(typeof w==="function")W=w,w=null;function K(H,B){if(B){if(B.uid<0)B.uid+=4294967296;if(B.gid<0)B.gid+=4294967296}if(W)W.apply(this,arguments)}return w?O.call(D,q,w,K):O.call(D,q,K)}}function Z(O){if(!O)return O;return function(q,w){var W=w?O.call(D,q,w):O.call(D,q);if(W){if(W.uid<0)W.uid+=4294967296;if(W.gid<0)W.gid+=4294967296}return W}}function G(O){if(!O)return!0;if(O.code==="ENOSYS")return!0;var q=!process.getuid||process.getuid()!==0;if(q){if(O.code==="EINVAL"||O.code==="EPERM")return!0}return!1}}});var sx=E((ue0,ax)=>{var ox=l("stream").Stream;ax.exports=RW0;function RW0(D){return{ReadStream:$,WriteStream:X};function $(J,Y){if(!(this instanceof $))return new $(J,Y);ox.call(this);var F=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 Q=Object.keys(Y);for(var U=0,Z=Q.length;U<Z;U++){var G=Q[U];this[G]=Y[G]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==void 0){if(typeof this.start!=="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!=="number")throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){F._read()});return}D.open(this.path,this.flags,this.mode,function(O,q){if(O){F.emit("error",O),F.readable=!1;return}F.fd=q,F.emit("open",q),F._read()})}function X(J,Y){if(!(this instanceof X))return new X(J,Y);ox.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 F=Object.keys(Y);for(var Q=0,U=F.length;Q<U;Q++){var Z=F[Q];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 D_=E((xe0,ex)=>{ex.exports=CW0;var TW0=Object.getPrototypeOf||function(D){return D.__proto__};function CW0(D){if(D===null||typeof D!=="object")return D;if(D instanceof Object)var $={__proto__:TW0(D)};else var $=Object.create(null);return Object.getOwnPropertyNames(D).forEach(function(X){Object.defineProperty($,X,Object.getOwnPropertyDescriptor(D,X))}),$}});var gD=E((_e0,HW)=>{var uD=l("fs"),PW0=tx(),SW0=sx(),vW0=D_(),yF=l("util"),Z1,hF;if(typeof Symbol==="function"&&typeof Symbol.for==="function")Z1=Symbol.for("graceful-fs.queue"),hF=Symbol.for("graceful-fs.previous");else Z1="___graceful-fs.queue",hF="___graceful-fs.previous";function uW0(){}function X_(D,$){Object.defineProperty(D,Z1,{get:function(){return $}})}var n8=uW0;if(yF.debuglog)n8=yF.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))n8=function(){var D=yF.format.apply(yF,arguments);D="GFS4: "+D.split(/\n/).join(`
127
- GFS4: `),console.error(D)};if(!uD[Z1]){if(wW=global[Z1]||[],X_(uD,wW),uD.close=function(D){function $(X,J){return D.call(uD,X,function(Y){if(!Y)$_();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,hF,{value:D}),$}(uD.close),uD.closeSync=function(D){function $(X){D.apply(uD,arguments),$_()}return Object.defineProperty($,hF,{value:D}),$}(uD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){n8(uD[Z1]),l("assert").equal(uD[Z1].length,0)})}var wW;if(!global[Z1])X_(global,uD[Z1]);HW.exports=WW(vW0(uD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!uD.__patched)HW.exports=WW(uD),uD.__patched=!0;function WW(D){PW0(D),D.gracefulify=WW,D.createReadStream=V,D.createWriteStream=A;var $=D.readFile;D.readFile=X;function X(j,v,P){if(typeof v==="function")P=v,v=null;return m(j,v,P);function m(h,r,f,T){return $(h,r,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))x5([m,[h,r,f],S,T||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(j,v,P,m){if(typeof P==="function")m=P,P=null;return h(j,v,P,m);function h(r,f,T,S,u){return J(r,f,T,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var F=D.appendFile;if(F)D.appendFile=Q;function Q(j,v,P,m){if(typeof P==="function")m=P,P=null;return h(j,v,P,m);function h(r,f,T,S,u){return F(r,f,T,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var U=D.copyFile;if(U)D.copyFile=Z;function Z(j,v,P,m){if(typeof P==="function")m=P,P=0;return h(j,v,P,m);function h(r,f,T,S,u){return U(r,f,T,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var G=D.readdir;D.readdir=q;var O=/^v[0-5]\./;function q(j,v,P){if(typeof v==="function")P=v,v=null;var m=O.test(process.version)?function(f,T,S,u){return G(f,h(f,T,S,u))}:function(f,T,S,u){return G(f,T,h(f,T,S,u))};return m(j,v,P);function h(r,f,T,S){return function(u,k){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))x5([m,[r,f,T],u,S||Date.now(),Date.now()]);else{if(k&&k.sort)k.sort();if(typeof T==="function")T.call(this,u,k)}}}}if(process.version.substr(0,4)==="v0.8"){var w=SW0(D);M=w.ReadStream,z=w.WriteStream}var W=D.ReadStream;if(W)M.prototype=Object.create(W.prototype),M.prototype.open=I;var K=D.WriteStream;if(K)z.prototype=Object.create(K.prototype),z.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(j){M=j},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return z},set:function(j){z=j},enumerable:!0,configurable:!0});var H=M;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(j){H=j},enumerable:!0,configurable:!0});var B=z;Object.defineProperty(D,"FileWriteStream",{get:function(){return B},set:function(j){B=j},enumerable:!0,configurable:!0});function M(j,v){if(this instanceof M)return W.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var j=this;_(j.path,j.flags,j.mode,function(v,P){if(v){if(j.autoClose)j.destroy();j.emit("error",v)}else j.fd=P,j.emit("open",P),j.read()})}function z(j,v){if(this instanceof z)return K.apply(this,arguments),this;else return z.apply(Object.create(z.prototype),arguments)}function N(){var j=this;_(j.path,j.flags,j.mode,function(v,P){if(v)j.destroy(),j.emit("error",v);else j.fd=P,j.emit("open",P)})}function V(j,v){return new D.ReadStream(j,v)}function A(j,v){return new D.WriteStream(j,v)}var x=D.open;D.open=_;function _(j,v,P,m){if(typeof P==="function")m=P,P=null;return h(j,v,P,m);function h(r,f,T,S,u){return x(r,f,T,function(k,g){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}return D}function x5(D){n8("ENQUEUE",D[0].name,D[1]),uD[Z1].push(D),KW()}var bF;function $_(){var D=Date.now();for(var $=0;$<uD[Z1].length;++$)if(uD[Z1][$].length>2)uD[Z1][$][3]=D,uD[Z1][$][4]=D;KW()}function KW(){if(clearTimeout(bF),bF=void 0,uD[Z1].length===0)return;var D=uD[Z1].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],F=D[4];if(Y===void 0)n8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){n8("TIMEOUT",$.name,X);var Q=X.pop();if(typeof Q==="function")Q.call(null,J)}else{var U=Date.now()-F,Z=Math.max(F-Y,1),G=Math.min(Z*1.2,100);if(U>=G)n8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else uD[Z1].push(D)}if(bF===void 0)bF=setTimeout(KW,0)}});var Y_=E((ke0,J_)=>{function E$(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)}J_.exports=E$;E$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};E$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};E$.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};E$.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)};E$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};E$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};E$.prototype.start=E$.prototype.try;E$.prototype.errors=function(){return this._errors};E$.prototype.attempts=function(){return this._attempts};E$.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],F=Y.message,Q=(D[F]||0)+1;if(D[F]=Q,Q>=X)$=Y,X=Q}return $}});var Q_=E((_W0)=>{var xW0=Y_();_W0.operation=function(D){var $=_W0.timeouts(D);return new xW0($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};_W0.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(F,Q){return F-Q}),J};_W0.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};_W0.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 F=X[Y],Q=D[F];D[F]=function(Z){var G=_W0.operation($),O=Array.prototype.slice.call(arguments,1),q=O.pop();O.push(function(w){if(G.retry(w))return;if(w)arguments[0]=G.mainError();q.apply(this,arguments)}),G.attempt(function(){Z.apply(D,O)})}.bind(D,Q),D[F].options=$}}});var U_=E((ye0,gF)=>{gF.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")gF.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")gF.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var dF=E((be0,k5)=>{var RD=global.process,l8=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(!l8(RD))k5.exports=function(){return function(){}};else{if(zW=l("assert"),i8=U_(),NW=/^win/i.test(RD.platform),_5=l("events"),typeof _5!=="function")_5=_5.EventEmitter;if(RD.__signal_exit_emitter__)aD=RD.__signal_exit_emitter__;else aD=RD.__signal_exit_emitter__=new _5,aD.count=0,aD.emitted={};if(!aD.infinite)aD.setMaxListeners(1/0),aD.infinite=!0;k5.exports=function(D,$){if(!l8(global.process))return function(){};if(zW.equal(typeof D,"function","a callback must be provided for exit handler"),p8===!1)mF();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(aD.removeListener(X,D),aD.listeners("exit").length===0&&aD.listeners("afterexit").length===0)S2()};return aD.on(X,D),J},S2=function(){if(!p8||!l8(global.process))return;p8=!1,i8.forEach(function($){try{RD.removeListener($,v2[$])}catch(X){}}),RD.emit=u2,RD.reallyExit=cF,aD.count-=1},k5.exports.unload=S2,E4=function($,X,J){if(aD.emitted[$])return;aD.emitted[$]=!0,aD.emit($,X,J)},v2={},i8.forEach(function(D){v2[D]=function(){if(!l8(global.process))return;var X=RD.listeners(D);if(X.length===aD.count){if(S2(),E4("exit",null,D),E4("afterexit",null,D),NW&&D==="SIGHUP")D="SIGINT";RD.kill(RD.pid,D)}}}),k5.exports.signals=function(){return i8},p8=!1,mF=function(){if(p8||!l8(global.process))return;p8=!0,aD.count+=1,i8=i8.filter(function($){try{return RD.on($,v2[$]),!0}catch(X){return!1}}),RD.emit=LW,RD.reallyExit=VW},k5.exports.load=mF,cF=RD.reallyExit,VW=function($){if(!l8(global.process))return;RD.exitCode=$||0,E4("exit",RD.exitCode,null),E4("afterexit",RD.exitCode,null),cF.call(RD,RD.exitCode)},u2=RD.emit,LW=function($,X){if($==="exit"&&l8(global.process)){if(X!==void 0)RD.exitCode=X;var J=u2.apply(this,arguments);return E4("exit",RD.exitCode,null),E4("afterexit",RD.exitCode,null),J}else return u2.apply(this,arguments)}}var zW,i8,NW,_5,aD,S2,E4,v2,p8,mF,cF,VW,u2,LW});var G_=E((gW0,BW)=>{var Z_=Symbol();function bW0(D,$,X){let J=$[Z_];if(J)return $.stat(D,(F,Q)=>{if(F)return X(F);X(null,Q.mtime,J)});let Y=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,Y,Y,(F)=>{if(F)return X(F);$.stat(D,(Q,U)=>{if(Q)return X(Q);let Z=U.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,Z_,{value:Z}),X(null,U.mtime,Z)})})}function hW0(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}gW0.probe=bW0;gW0.getMtime=hW0});var K_=E((tW0,_2)=>{var dW0=l("path"),jW=gD(),nW0=Q_(),lW0=dF(),O_=G_(),c6={};function x2(D,$){return $.lockfilePath||`${D}.lock`}function EW(D,$,X){if(!$.realpath)return X(null,dW0.resolve(D));$.fs.realpath(D,X)}function IW(D,$,X){let J=x2(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return O_.probe(J,$.fs,(F,Q,U)=>{if(F)return $.fs.rmdir(J,()=>{}),X(F);X(null,Q,U)});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,(F,Q)=>{if(F){if(F.code==="ENOENT")return IW(D,{...$,stale:0},X);return X(F)}if(!q_(Q,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));w_(D,$,(U)=>{if(U)return X(U);IW(D,{...$,stale:0},X)})})})}function q_(D,$){return D.mtime.getTime()<Date.now()-$.stale}function w_(D,$,X){$.fs.rmdir(x2(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function nF(D,$){let X=c6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(J,Y)=>{let F=X.lastUpdate+$.stale<Date.now();if(J){if(J.code==="ENOENT"||F)return MW(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,nF(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return MW(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let U=O_.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,U,U,(Z)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||G)return MW(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,nF(D,$)}X.mtime=U,X.lastUpdate=Date.now(),X.updateDelay=null,nF(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function MW(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(c6[D]===$)delete c6[D];$.options.onCompromised(X)}function iW0(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:jW,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),EW(D,$,(J,Y)=>{if(J)return X(J);let F=nW0.operation($.retries);F.attempt(()=>{IW(Y,$,(Q,U,Z)=>{if(F.retry(Q))return;if(Q)return X(F.mainError());let G=c6[Y]={lockfilePath:x2(Y,$),mtime:U,mtimePrecision:Z,options:$,lastUpdate:Date.now()};nF(Y,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));W_(Y,{...$,realpath:!1},O)})})})})}function W_(D,$,X){$={fs:jW,realpath:!0,...$},EW(D,$,(J,Y)=>{if(J)return X(J);let F=c6[Y];if(!F)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));F.updateTimeout&&clearTimeout(F.updateTimeout),F.released=!0,delete c6[Y],w_(Y,$,X)})}function pW0(D,$,X){$={stale:1e4,realpath:!0,fs:jW,...$},$.stale=Math.max($.stale||0,2000),EW(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(x2(Y,$),(F,Q)=>{if(F)return F.code==="ENOENT"?X(null,!1):X(F);return X(null,!q_(Q,$))})})}function rW0(){return c6}lW0(()=>{for(let D in c6){let $=c6[D].options;try{$.fs.rmdirSync(x2(D,$))}catch(X){}}});tW0.lock=iW0;tW0.unlock=W_;tW0.check=pW0;tW0.getLocks=rW0});var z_=E((he0,H_)=>{var DK0=gD();function $K0(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let F=Y.pop(),Q;try{Q=D[`${J}Sync`](...Y)}catch(U){return F(U)}F(null,Q)}}),X}function XK0(D){return(...$)=>new Promise((X,J)=>{$.push((Y,F)=>{if(Y)J(Y);else X(F)}),D(...$)})}function JK0(D){return(...$)=>{let X,J;if($.push((Y,F)=>{X=Y,J=F}),D(...$),X)throw X;return J}}function YK0(D){if(D={...D},D.fs=$K0(D.fs||DK0),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}H_.exports={toPromise:XK0,toSync:JK0,toSyncOptions:YK0}});var V_=E((ge0,A4)=>{var f5=K_(),{toPromise:lF,toSync:iF,toSyncOptions:AW}=z_();async function N_(D,$){let X=await lF(f5.lock)(D,$);return lF(X)}function FK0(D,$){let X=iF(f5.lock)(D,AW($));return iF(X)}function QK0(D,$){return lF(f5.unlock)(D,$)}function UK0(D,$){return iF(f5.unlock)(D,AW($))}function ZK0(D,$){return lF(f5.check)(D,$)}function GK0(D,$){return iF(f5.check)(D,AW($))}A4.exports=N_;A4.exports.lock=N_;A4.exports.unlock=QK0;A4.exports.lockSync=FK0;A4.exports.unlockSync=UK0;A4.exports.check=ZK0;A4.exports.checkSync=GK0});var A_=E((j_)=>{Object.defineProperty(j_,"__esModule",{value:!0});j_.canStoreURLs=j_.FileUrlStorage=void 0;var L_=l("fs"),OK0=wK0(px()),B_=qK0(V_());function I_(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(I_=function(J){return J?X:$})(D)}function qK0(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=I_($);if(X&&X.has(D))return X.get(D);var J={__proto__:null},Y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in D)if(F!=="default"&&{}.hasOwnProperty.call(D,F)){var Q=Y?Object.getOwnPropertyDescriptor(D,F):null;Q&&(Q.get||Q.set)?Object.defineProperty(J,F,Q):J[F]=D[F]}return J.default=D,X&&X.set(D,J),J}function wK0(D){return D&&D.__esModule?D:{default:D}}function k2(D){return k2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},k2(D)}function WK0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function M_(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,HK0(J.key),J)}}function KK0(D,$,X){if($)M_(D.prototype,$);if(X)M_(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function HK0(D){var $=zK0(D,"string");return k2($)=="symbol"?$:$+""}function zK0(D,$){if(k2(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(k2(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var me0=j_.canStoreURLs=!0,ce0=j_.FileUrlStorage=function(){function D($){WK0(this,D),this.path=$}return KK0(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(F,Q){if(F)Y(F);else J(Q)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,F){J._getItems("tus::".concat(X),function(Q,U){if(Q)F(Q);else Y(U)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,F){J._removeItem(X,function(Q){if(Q)F(Q);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,F=Math.round(Math.random()*1000000000000),Q="tus::".concat(X,"::").concat(F);return new Promise(function(U,Z){Y._setItem(Q,J,function(G){if(G)Z(G);else U(Q)})})}},{key:"_setItem",value:function(X,J,Y){var F=this;B_.lock(this.path,this._lockfileOptions()).then(function(Q){Y=F._releaseAndCb(Q,Y),F._getData(function(U,Z){if(U){Y(U);return}Z[X]=J,F._writeData(Z,function(G){return Y(G)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,F){if(Y){J(Y);return}var Q=Object.keys(F).filter(function(U){return U.startsWith(X)}).map(function(U){var Z=F[U];return Z.urlStorageKey=U,Z});J(null,Q)})}},{key:"_removeItem",value:function(X,J){var Y=this;B_.lock(this.path,this._lockfileOptions()).then(function(F){J=Y._releaseAndCb(F,J),Y._getData(function(Q,U){if(Q){J(Q);return}delete U[X],Y._writeData(U,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(F){return J((0,OK0.default)([Y,F]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,L_.writeFile)(this.path,JSON.stringify(X),Y,function(F){return J(F)})}},{key:"_getData",value:function(X){(0,L_.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(F){X(F);return}X(null,Y)})}}])}()});var rF=E((R4)=>{Object.defineProperty(R4,"__esModule",{value:!0});Object.defineProperty(R4,"DefaultHttpStack",{enumerable:!0,get:function(){return P_.default}});Object.defineProperty(R4,"DetailedError",{enumerable:!0,get:function(){return VK0.default}});Object.defineProperty(R4,"FileUrlStorage",{enumerable:!0,get:function(){return S_.FileUrlStorage}});Object.defineProperty(R4,"StreamSource",{enumerable:!0,get:function(){return jK0.default}});R4.Upload=void 0;Object.defineProperty(R4,"canStoreURLs",{enumerable:!0,get:function(){return S_.canStoreURLs}});R4.defaultOptions=void 0;Object.defineProperty(R4,"enableDebugLog",{enumerable:!0,get:function(){return LK0.enableDebugLog}});R4.isSupported=void 0;var VK0=r8(Aw()),LK0=Rw(),BK0=r8(Vv()),RW=r8(av()),MK0=r8(Nu()),IK0=r8(Iu()),P_=r8(bu()),jK0=r8(yw()),S_=A_();function r8(D){return D&&D.__esModule?D:{default:D}}function b5(D){return b5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},b5(D)}function EK0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function R_(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,u_(J.key),J)}}function AK0(D,$,X){if($)R_(D.prototype,$);if(X)R_(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function RK0(D,$,X){return $=pF($),TK0(D,v_()?Reflect.construct($,X||[],pF(D).constructor):$.apply(D,X))}function TK0(D,$){if($&&(b5($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return CK0(D)}function CK0(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 pF(D){return pF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},pF(D)}function PK0(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}),$)TW(D,$)}function TW(D,$){return TW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},TW(D,$)}function T_(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 y5(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?T_(Object(X),!0).forEach(function(J){SK0(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):T_(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function SK0(D,$,X){if($=u_($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function u_(D){var $=vK0(D,"string");return b5($)=="symbol"?$:$+""}function vK0(D,$){if(b5(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(b5(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var C_=R4.defaultOptions=y5(y5({},RW.default.defaultOptions),{},{httpStack:new P_.default,fileReader:new MK0.default,urlStorage:new BK0.default,fingerprint:IK0.default}),ne0=R4.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 EK0(this,$),J=y5(y5({},C_),J),RK0(this,$,[X,J])}return PK0($,D),AK0($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=y5(y5({},C_),Y),RW.default.terminate(J,Y)}}])}(RW.default),le0=R4.isSupported=!0});var L1;var T4=p(()=>{L1={name:"@capgo/cli",type:"module",version:"8.0.8",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test: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:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.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:macos-signing":"bun test/test-macos-signing.mjs","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs",test:"bun run build && bun run test:version-detection:setup && 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:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && 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 && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6","string-width":"^8.2.1"},devDependencies:{"@antfu/eslint-config":"^9.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});async function tF(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 xK0(){let D=await tF("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:L1.version,latestVersion:D,isOutdated:!!D&&D!==L1.version,majorVersion:$}}async function WD(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await xK0();if(D)L.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
127
+ GFS4: `),console.error(D)};if(!uD[Z1]){if(wW=global[Z1]||[],X_(uD,wW),uD.close=function(D){function $(X,J){return D.call(uD,X,function(Y){if(!Y)$_();if(typeof J==="function")J.apply(this,arguments)})}return Object.defineProperty($,hF,{value:D}),$}(uD.close),uD.closeSync=function(D){function $(X){D.apply(uD,arguments),$_()}return Object.defineProperty($,hF,{value:D}),$}(uD.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))process.on("exit",function(){n8(uD[Z1]),l("assert").equal(uD[Z1].length,0)})}var wW;if(!global[Z1])X_(global,uD[Z1]);HW.exports=WW(vW0(uD));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!uD.__patched)HW.exports=WW(uD),uD.__patched=!0;function WW(D){PW0(D),D.gracefulify=WW,D.createReadStream=V,D.createWriteStream=A;var $=D.readFile;D.readFile=X;function X(j,v,P){if(typeof v==="function")P=v,v=null;return m(j,v,P);function m(h,r,f,T){return $(h,r,function(S){if(S&&(S.code==="EMFILE"||S.code==="ENFILE"))x5([m,[h,r,f],S,T||Date.now(),Date.now()]);else if(typeof f==="function")f.apply(this,arguments)})}}var J=D.writeFile;D.writeFile=Y;function Y(j,v,P,m){if(typeof P==="function")m=P,P=null;return h(j,v,P,m);function h(r,f,T,S,u){return J(r,f,T,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var F=D.appendFile;if(F)D.appendFile=Q;function Q(j,v,P,m){if(typeof P==="function")m=P,P=null;return h(j,v,P,m);function h(r,f,T,S,u){return F(r,f,T,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var U=D.copyFile;if(U)D.copyFile=Z;function Z(j,v,P,m){if(typeof P==="function")m=P,P=0;return h(j,v,P,m);function h(r,f,T,S,u){return U(r,f,T,function(k){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}var G=D.readdir;D.readdir=q;var O=/^v[0-5]\./;function q(j,v,P){if(typeof v==="function")P=v,v=null;var m=O.test(process.version)?function(f,T,S,u){return G(f,h(f,T,S,u))}:function(f,T,S,u){return G(f,T,h(f,T,S,u))};return m(j,v,P);function h(r,f,T,S){return function(u,k){if(u&&(u.code==="EMFILE"||u.code==="ENFILE"))x5([m,[r,f,T],u,S||Date.now(),Date.now()]);else{if(k&&k.sort)k.sort();if(typeof T==="function")T.call(this,u,k)}}}}if(process.version.substr(0,4)==="v0.8"){var w=SW0(D);M=w.ReadStream,z=w.WriteStream}var W=D.ReadStream;if(W)M.prototype=Object.create(W.prototype),M.prototype.open=I;var K=D.WriteStream;if(K)z.prototype=Object.create(K.prototype),z.prototype.open=N;Object.defineProperty(D,"ReadStream",{get:function(){return M},set:function(j){M=j},enumerable:!0,configurable:!0}),Object.defineProperty(D,"WriteStream",{get:function(){return z},set:function(j){z=j},enumerable:!0,configurable:!0});var H=M;Object.defineProperty(D,"FileReadStream",{get:function(){return H},set:function(j){H=j},enumerable:!0,configurable:!0});var B=z;Object.defineProperty(D,"FileWriteStream",{get:function(){return B},set:function(j){B=j},enumerable:!0,configurable:!0});function M(j,v){if(this instanceof M)return W.apply(this,arguments),this;else return M.apply(Object.create(M.prototype),arguments)}function I(){var j=this;_(j.path,j.flags,j.mode,function(v,P){if(v){if(j.autoClose)j.destroy();j.emit("error",v)}else j.fd=P,j.emit("open",P),j.read()})}function z(j,v){if(this instanceof z)return K.apply(this,arguments),this;else return z.apply(Object.create(z.prototype),arguments)}function N(){var j=this;_(j.path,j.flags,j.mode,function(v,P){if(v)j.destroy(),j.emit("error",v);else j.fd=P,j.emit("open",P)})}function V(j,v){return new D.ReadStream(j,v)}function A(j,v){return new D.WriteStream(j,v)}var x=D.open;D.open=_;function _(j,v,P,m){if(typeof P==="function")m=P,P=null;return h(j,v,P,m);function h(r,f,T,S,u){return x(r,f,T,function(k,g){if(k&&(k.code==="EMFILE"||k.code==="ENFILE"))x5([h,[r,f,T,S],k,u||Date.now(),Date.now()]);else if(typeof S==="function")S.apply(this,arguments)})}}return D}function x5(D){n8("ENQUEUE",D[0].name,D[1]),uD[Z1].push(D),KW()}var bF;function $_(){var D=Date.now();for(var $=0;$<uD[Z1].length;++$)if(uD[Z1][$].length>2)uD[Z1][$][3]=D,uD[Z1][$][4]=D;KW()}function KW(){if(clearTimeout(bF),bF=void 0,uD[Z1].length===0)return;var D=uD[Z1].shift(),$=D[0],X=D[1],J=D[2],Y=D[3],F=D[4];if(Y===void 0)n8("RETRY",$.name,X),$.apply(null,X);else if(Date.now()-Y>=60000){n8("TIMEOUT",$.name,X);var Q=X.pop();if(typeof Q==="function")Q.call(null,J)}else{var U=Date.now()-F,Z=Math.max(F-Y,1),G=Math.min(Z*1.2,100);if(U>=G)n8("RETRY",$.name,X),$.apply(null,X.concat([Y]));else uD[Z1].push(D)}if(bF===void 0)bF=setTimeout(KW,0)}});var Y_=E((ke0,J_)=>{function E$(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)}J_.exports=E$;E$.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts};E$.prototype.stop=function(){if(this._timeout)clearTimeout(this._timeout);this._timeouts=[],this._cachedTimeouts=null};E$.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};E$.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)};E$.prototype.try=function(D){console.log("Using RetryOperation.try() is deprecated"),this.attempt(D)};E$.prototype.start=function(D){console.log("Using RetryOperation.start() is deprecated"),this.attempt(D)};E$.prototype.start=E$.prototype.try;E$.prototype.errors=function(){return this._errors};E$.prototype.attempts=function(){return this._attempts};E$.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],F=Y.message,Q=(D[F]||0)+1;if(D[F]=Q,Q>=X)$=Y,X=Q}return $}});var Q_=E((_W0)=>{var xW0=Y_();_W0.operation=function(D){var $=_W0.timeouts(D);return new xW0($,{forever:D&&D.forever,unref:D&&D.unref,maxRetryTime:D&&D.maxRetryTime})};_W0.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(F,Q){return F-Q}),J};_W0.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};_W0.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 F=X[Y],Q=D[F];D[F]=function(Z){var G=_W0.operation($),O=Array.prototype.slice.call(arguments,1),q=O.pop();O.push(function(w){if(G.retry(w))return;if(w)arguments[0]=G.mainError();q.apply(this,arguments)}),G.attempt(function(){Z.apply(D,O)})}.bind(D,Q),D[F].options=$}}});var U_=E((ye0,gF)=>{gF.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32")gF.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")gF.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var dF=E((be0,k5)=>{var RD=global.process,l8=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(!l8(RD))k5.exports=function(){return function(){}};else{if(zW=l("assert"),i8=U_(),NW=/^win/i.test(RD.platform),_5=l("events"),typeof _5!=="function")_5=_5.EventEmitter;if(RD.__signal_exit_emitter__)aD=RD.__signal_exit_emitter__;else aD=RD.__signal_exit_emitter__=new _5,aD.count=0,aD.emitted={};if(!aD.infinite)aD.setMaxListeners(1/0),aD.infinite=!0;k5.exports=function(D,$){if(!l8(global.process))return function(){};if(zW.equal(typeof D,"function","a callback must be provided for exit handler"),p8===!1)mF();var X="exit";if($&&$.alwaysLast)X="afterexit";var J=function(){if(aD.removeListener(X,D),aD.listeners("exit").length===0&&aD.listeners("afterexit").length===0)S2()};return aD.on(X,D),J},S2=function(){if(!p8||!l8(global.process))return;p8=!1,i8.forEach(function($){try{RD.removeListener($,v2[$])}catch(X){}}),RD.emit=u2,RD.reallyExit=cF,aD.count-=1},k5.exports.unload=S2,E4=function($,X,J){if(aD.emitted[$])return;aD.emitted[$]=!0,aD.emit($,X,J)},v2={},i8.forEach(function(D){v2[D]=function(){if(!l8(global.process))return;var X=RD.listeners(D);if(X.length===aD.count){if(S2(),E4("exit",null,D),E4("afterexit",null,D),NW&&D==="SIGHUP")D="SIGINT";RD.kill(RD.pid,D)}}}),k5.exports.signals=function(){return i8},p8=!1,mF=function(){if(p8||!l8(global.process))return;p8=!0,aD.count+=1,i8=i8.filter(function($){try{return RD.on($,v2[$]),!0}catch(X){return!1}}),RD.emit=LW,RD.reallyExit=VW},k5.exports.load=mF,cF=RD.reallyExit,VW=function($){if(!l8(global.process))return;RD.exitCode=$||0,E4("exit",RD.exitCode,null),E4("afterexit",RD.exitCode,null),cF.call(RD,RD.exitCode)},u2=RD.emit,LW=function($,X){if($==="exit"&&l8(global.process)){if(X!==void 0)RD.exitCode=X;var J=u2.apply(this,arguments);return E4("exit",RD.exitCode,null),E4("afterexit",RD.exitCode,null),J}else return u2.apply(this,arguments)}}var zW,i8,NW,_5,aD,S2,E4,v2,p8,mF,cF,VW,u2,LW});var G_=E((gW0,BW)=>{var Z_=Symbol();function bW0(D,$,X){let J=$[Z_];if(J)return $.stat(D,(F,Q)=>{if(F)return X(F);X(null,Q.mtime,J)});let Y=new Date(Math.ceil(Date.now()/1000)*1000+5);$.utimes(D,Y,Y,(F)=>{if(F)return X(F);$.stat(D,(Q,U)=>{if(Q)return X(Q);let Z=U.mtime.getTime()%1000===0?"s":"ms";Object.defineProperty($,Z_,{value:Z}),X(null,U.mtime,Z)})})}function hW0(D){let $=Date.now();if(D==="s")$=Math.ceil($/1000)*1000;return new Date($)}gW0.probe=bW0;gW0.getMtime=hW0});var K_=E((tW0,_2)=>{var dW0=l("path"),jW=gD(),nW0=Q_(),lW0=dF(),O_=G_(),c6={};function x2(D,$){return $.lockfilePath||`${D}.lock`}function EW(D,$,X){if(!$.realpath)return X(null,dW0.resolve(D));$.fs.realpath(D,X)}function IW(D,$,X){let J=x2(D,$);$.fs.mkdir(J,(Y)=>{if(!Y)return O_.probe(J,$.fs,(F,Q,U)=>{if(F)return $.fs.rmdir(J,()=>{}),X(F);X(null,Q,U)});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,(F,Q)=>{if(F){if(F.code==="ENOENT")return IW(D,{...$,stale:0},X);return X(F)}if(!q_(Q,$))return X(Object.assign(Error("Lock file is already being held"),{code:"ELOCKED",file:D}));w_(D,$,(U)=>{if(U)return X(U);IW(D,{...$,stale:0},X)})})})}function q_(D,$){return D.mtime.getTime()<Date.now()-$.stale}function w_(D,$,X){$.fs.rmdir(x2(D,$),(J)=>{if(J&&J.code!=="ENOENT")return X(J);X()})}function nF(D,$){let X=c6[D];if(X.updateTimeout)return;if(X.updateDelay=X.updateDelay||$.update,X.updateTimeout=setTimeout(()=>{X.updateTimeout=null,$.fs.stat(X.lockfilePath,(J,Y)=>{let F=X.lastUpdate+$.stale<Date.now();if(J){if(J.code==="ENOENT"||F)return MW(D,X,Object.assign(J,{code:"ECOMPROMISED"}));return X.updateDelay=1000,nF(D,$)}if(X.mtime.getTime()!==Y.mtime.getTime())return MW(D,X,Object.assign(Error("Unable to update lock within the stale threshold"),{code:"ECOMPROMISED"}));let U=O_.getMtime(X.mtimePrecision);$.fs.utimes(X.lockfilePath,U,U,(Z)=>{let G=X.lastUpdate+$.stale<Date.now();if(X.released)return;if(Z){if(Z.code==="ENOENT"||G)return MW(D,X,Object.assign(Z,{code:"ECOMPROMISED"}));return X.updateDelay=1000,nF(D,$)}X.mtime=U,X.lastUpdate=Date.now(),X.updateDelay=null,nF(D,$)})})},X.updateDelay),X.updateTimeout.unref)X.updateTimeout.unref()}function MW(D,$,X){if($.released=!0,$.updateTimeout)clearTimeout($.updateTimeout);if(c6[D]===$)delete c6[D];$.options.onCompromised(X)}function iW0(D,$,X){$={stale:1e4,update:null,realpath:!0,retries:0,fs:jW,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),EW(D,$,(J,Y)=>{if(J)return X(J);let F=nW0.operation($.retries);F.attempt(()=>{IW(Y,$,(Q,U,Z)=>{if(F.retry(Q))return;if(Q)return X(F.mainError());let G=c6[Y]={lockfilePath:x2(Y,$),mtime:U,mtimePrecision:Z,options:$,lastUpdate:Date.now()};nF(Y,$),X(null,(O)=>{if(G.released)return O&&O(Object.assign(Error("Lock is already released"),{code:"ERELEASED"}));W_(Y,{...$,realpath:!1},O)})})})})}function W_(D,$,X){$={fs:jW,realpath:!0,...$},EW(D,$,(J,Y)=>{if(J)return X(J);let F=c6[Y];if(!F)return X(Object.assign(Error("Lock is not acquired/owned by you"),{code:"ENOTACQUIRED"}));F.updateTimeout&&clearTimeout(F.updateTimeout),F.released=!0,delete c6[Y],w_(Y,$,X)})}function pW0(D,$,X){$={stale:1e4,realpath:!0,fs:jW,...$},$.stale=Math.max($.stale||0,2000),EW(D,$,(J,Y)=>{if(J)return X(J);$.fs.stat(x2(Y,$),(F,Q)=>{if(F)return F.code==="ENOENT"?X(null,!1):X(F);return X(null,!q_(Q,$))})})}function rW0(){return c6}lW0(()=>{for(let D in c6){let $=c6[D].options;try{$.fs.rmdirSync(x2(D,$))}catch(X){}}});tW0.lock=iW0;tW0.unlock=W_;tW0.check=pW0;tW0.getLocks=rW0});var z_=E((he0,H_)=>{var DK0=gD();function $K0(D){let $=["mkdir","realpath","stat","rmdir","utimes"],X={...D};return $.forEach((J)=>{X[J]=(...Y)=>{let F=Y.pop(),Q;try{Q=D[`${J}Sync`](...Y)}catch(U){return F(U)}F(null,Q)}}),X}function XK0(D){return(...$)=>new Promise((X,J)=>{$.push((Y,F)=>{if(Y)J(Y);else X(F)}),D(...$)})}function JK0(D){return(...$)=>{let X,J;if($.push((Y,F)=>{X=Y,J=F}),D(...$),X)throw X;return J}}function YK0(D){if(D={...D},D.fs=$K0(D.fs||DK0),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}H_.exports={toPromise:XK0,toSync:JK0,toSyncOptions:YK0}});var V_=E((ge0,A4)=>{var f5=K_(),{toPromise:lF,toSync:iF,toSyncOptions:AW}=z_();async function N_(D,$){let X=await lF(f5.lock)(D,$);return lF(X)}function FK0(D,$){let X=iF(f5.lock)(D,AW($));return iF(X)}function QK0(D,$){return lF(f5.unlock)(D,$)}function UK0(D,$){return iF(f5.unlock)(D,AW($))}function ZK0(D,$){return lF(f5.check)(D,$)}function GK0(D,$){return iF(f5.check)(D,AW($))}A4.exports=N_;A4.exports.lock=N_;A4.exports.unlock=QK0;A4.exports.lockSync=FK0;A4.exports.unlockSync=UK0;A4.exports.check=ZK0;A4.exports.checkSync=GK0});var A_=E((j_)=>{Object.defineProperty(j_,"__esModule",{value:!0});j_.canStoreURLs=j_.FileUrlStorage=void 0;var L_=l("fs"),OK0=wK0(px()),B_=qK0(V_());function I_(D){if(typeof WeakMap!="function")return null;var $=new WeakMap,X=new WeakMap;return(I_=function(J){return J?X:$})(D)}function qK0(D,$){if(!$&&D&&D.__esModule)return D;if(D===null||typeof D!="object"&&typeof D!="function")return{default:D};var X=I_($);if(X&&X.has(D))return X.get(D);var J={__proto__:null},Y=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var F in D)if(F!=="default"&&{}.hasOwnProperty.call(D,F)){var Q=Y?Object.getOwnPropertyDescriptor(D,F):null;Q&&(Q.get||Q.set)?Object.defineProperty(J,F,Q):J[F]=D[F]}return J.default=D,X&&X.set(D,J),J}function wK0(D){return D&&D.__esModule?D:{default:D}}function k2(D){return k2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},k2(D)}function WK0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function M_(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,HK0(J.key),J)}}function KK0(D,$,X){if($)M_(D.prototype,$);if(X)M_(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function HK0(D){var $=zK0(D,"string");return k2($)=="symbol"?$:$+""}function zK0(D,$){if(k2(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(k2(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var me0=j_.canStoreURLs=!0,ce0=j_.FileUrlStorage=function(){function D($){WK0(this,D),this.path=$}return KK0(D,[{key:"findAllUploads",value:function(){var X=this;return new Promise(function(J,Y){X._getItems("tus::",function(F,Q){if(F)Y(F);else J(Q)})})}},{key:"findUploadsByFingerprint",value:function(X){var J=this;return new Promise(function(Y,F){J._getItems("tus::".concat(X),function(Q,U){if(Q)F(Q);else Y(U)})})}},{key:"removeUpload",value:function(X){var J=this;return new Promise(function(Y,F){J._removeItem(X,function(Q){if(Q)F(Q);else Y()})})}},{key:"addUpload",value:function(X,J){var Y=this,F=Math.round(Math.random()*1000000000000),Q="tus::".concat(X,"::").concat(F);return new Promise(function(U,Z){Y._setItem(Q,J,function(G){if(G)Z(G);else U(Q)})})}},{key:"_setItem",value:function(X,J,Y){var F=this;B_.lock(this.path,this._lockfileOptions()).then(function(Q){Y=F._releaseAndCb(Q,Y),F._getData(function(U,Z){if(U){Y(U);return}Z[X]=J,F._writeData(Z,function(G){return Y(G)})})}).catch(Y)}},{key:"_getItems",value:function(X,J){this._getData(function(Y,F){if(Y){J(Y);return}var Q=Object.keys(F).filter(function(U){return U.startsWith(X)}).map(function(U){var Z=F[U];return Z.urlStorageKey=U,Z});J(null,Q)})}},{key:"_removeItem",value:function(X,J){var Y=this;B_.lock(this.path,this._lockfileOptions()).then(function(F){J=Y._releaseAndCb(F,J),Y._getData(function(Q,U){if(Q){J(Q);return}delete U[X],Y._writeData(U,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(F){return J((0,OK0.default)([Y,F]))});return}X().then(J).catch(J)}}},{key:"_writeData",value:function(X,J){var Y={encoding:"utf8",mode:432,flag:"w"};(0,L_.writeFile)(this.path,JSON.stringify(X),Y,function(F){return J(F)})}},{key:"_getData",value:function(X){(0,L_.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(F){X(F);return}X(null,Y)})}}])}()});var rF=E((R4)=>{Object.defineProperty(R4,"__esModule",{value:!0});Object.defineProperty(R4,"DefaultHttpStack",{enumerable:!0,get:function(){return P_.default}});Object.defineProperty(R4,"DetailedError",{enumerable:!0,get:function(){return VK0.default}});Object.defineProperty(R4,"FileUrlStorage",{enumerable:!0,get:function(){return S_.FileUrlStorage}});Object.defineProperty(R4,"StreamSource",{enumerable:!0,get:function(){return jK0.default}});R4.Upload=void 0;Object.defineProperty(R4,"canStoreURLs",{enumerable:!0,get:function(){return S_.canStoreURLs}});R4.defaultOptions=void 0;Object.defineProperty(R4,"enableDebugLog",{enumerable:!0,get:function(){return LK0.enableDebugLog}});R4.isSupported=void 0;var VK0=r8(Aw()),LK0=Rw(),BK0=r8(Vv()),RW=r8(av()),MK0=r8(Nu()),IK0=r8(Iu()),P_=r8(bu()),jK0=r8(yw()),S_=A_();function r8(D){return D&&D.__esModule?D:{default:D}}function b5(D){return b5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},b5(D)}function EK0(D,$){if(!(D instanceof $))throw TypeError("Cannot call a class as a function")}function R_(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,u_(J.key),J)}}function AK0(D,$,X){if($)R_(D.prototype,$);if(X)R_(D,X);return Object.defineProperty(D,"prototype",{writable:!1}),D}function RK0(D,$,X){return $=pF($),TK0(D,v_()?Reflect.construct($,X||[],pF(D).constructor):$.apply(D,X))}function TK0(D,$){if($&&(b5($)==="object"||typeof $==="function"))return $;else if($!==void 0)throw TypeError("Derived constructors may only return object or undefined");return CK0(D)}function CK0(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 pF(D){return pF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(X){return X.__proto__||Object.getPrototypeOf(X)},pF(D)}function PK0(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}),$)TW(D,$)}function TW(D,$){return TW=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(J,Y){return J.__proto__=Y,J},TW(D,$)}function T_(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 y5(D){for(var $=1;$<arguments.length;$++){var X=arguments[$]!=null?arguments[$]:{};$%2?T_(Object(X),!0).forEach(function(J){SK0(D,J,X[J])}):Object.getOwnPropertyDescriptors?Object.defineProperties(D,Object.getOwnPropertyDescriptors(X)):T_(Object(X)).forEach(function(J){Object.defineProperty(D,J,Object.getOwnPropertyDescriptor(X,J))})}return D}function SK0(D,$,X){if($=u_($),$ in D)Object.defineProperty(D,$,{value:X,enumerable:!0,configurable:!0,writable:!0});else D[$]=X;return D}function u_(D){var $=vK0(D,"string");return b5($)=="symbol"?$:$+""}function vK0(D,$){if(b5(D)!="object"||!D)return D;var X=D[Symbol.toPrimitive];if(X!==void 0){var J=X.call(D,$||"default");if(b5(J)!="object")return J;throw TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(D)}var C_=R4.defaultOptions=y5(y5({},RW.default.defaultOptions),{},{httpStack:new P_.default,fileReader:new MK0.default,urlStorage:new BK0.default,fingerprint:IK0.default}),ne0=R4.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 EK0(this,$),J=y5(y5({},C_),J),RK0(this,$,[X,J])}return PK0($,D),AK0($,null,[{key:"terminate",value:function(J){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Y=y5(y5({},C_),Y),RW.default.terminate(J,Y)}}])}(RW.default),le0=R4.isSupported=!0});var L1;var T4=p(()=>{L1={name:"@capgo/cli",type:"module",version:"8.1.0",description:"A CLI to upload to capgo servers",author:"Martin martin@capgo.app",license:"Apache 2.0",homepage:"https://github.com/Cap-go/capgo/tree/main/cli#readme",repository:{type:"git",url:"git+https://github.com/Cap-go/capgo.git",directory:"cli"},bugs:{url:"https://github.com/Cap-go/capgo/issues"},keywords:["appflow alternative","ionic","capacitor","auto update","live update","capgo","cli","upload","capgo-cli","sdk","tanstack-intent"],exports:{".":{import:"./dist/index.js",require:"./dist/index.js"},"./sdk":{types:"./dist/src/sdk.d.ts",import:"./dist/src/sdk.js"}},main:"dist/index.js",types:"dist/src/index.d.ts",bin:{capgo:"dist/index.js"},files:["!skills/_artifacts","dist","skills"],engines:{npm:">=8.0.0",node:">=20.0.0"},scripts:{build:"tsc && bun build.mjs",dev:"NODE_ENV=development ncc build","no-debug":"node dist/index.js","dev-build":"SUPA_DB=development ncc build",pack:"pkg",types:"bunx --bun supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",typecheck:"tsgo --project tsconfig.tsgo.json --noEmit",lint:"bun run lint:ox","lint:ox":"oxlint --config ../.oxlintrc.json src","lint:fix":"oxlint --config ../.oxlintrc.json --fix src","check-posix-paths":"node test/check-posix-paths.js","generate-docs":"node dist/index.js generate-docs README.md","test: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:fail-on-incompatible":"bun test/test-fail-on-incompatible.mjs","test:credentials":"bun test/test-credentials.mjs","test:credentials-validation":"bun test/test-credentials-validation.mjs","test:android-service-account-validation":"bun test/test-android-service-account-validation.mjs","test:build-zip-filter":"bun test/test-build-zip-filter.mjs","test:checksum":"bun test/test-checksum-algorithm.mjs","test:build-needed":"bun test/test-build-needed.mjs","test:ci-prompts":"bun test/test-ci-prompts.mjs","test:ci-secrets":"bun test/test-ci-secrets.mjs","test:android-onboarding-progress":"bun test/test-android-onboarding-progress.mjs","test:onboarding-telemetry":"bun test/test-onboarding-telemetry.mjs","test:v2-event-migration":"bun test/test-v2-event-migration.mjs","test:analytics":"bun test/test-analytics.mjs","test:analytics-error-category":"bun test/test-analytics-error-category.mjs","test:analytics-org-resolver":"bun test/test-analytics-org-resolver.mjs","test:supabase-perf":"bun test/test-supabase-perf.mjs","test:preview-qr":"bun test/test-preview-qr.mjs","test:mcp-analytics":"bun test/test-mcp-analytics.mjs","test:app-created-source":"bun test/test-app-created-source.mjs","test:doctor-analytics":"bun test/test-doctor-analytics.mjs","test:posthog-exception":"bun test/test-posthog-exception.mjs","test:onboarding-recovery":"bun test/test-onboarding-recovery.mjs","test:onboarding-progress":"bun test/test-onboarding-progress.mjs","test:onboarding-run-targets":"bun test/test-onboarding-run-targets.mjs","test:run-device-command":"bun test/test-run-device-command.mjs","test:init-app-conflict":"bun test/test-init-app-conflict.mjs","test:init-guardrails":"bun test/test-init-guardrails.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:macos-signing":"bun test/test-macos-signing.mjs","test:apple-api-import-helpers":"bun test/test-apple-api-import-helpers.mjs","test:bundle-id-detector":"bun test/test-bundle-id-detector.mjs","test:apple-api-app-list":"bun test/test-apple-api-app-list.mjs","test:app-verification":"bun test/test-app-verification.mjs","test:pbxproj-parser":"bun test/test-pbxproj-parser.mjs","test:manifest-path-encoding":"bun test/test-manifest-path-encoding.mjs","test:self-update":"bun test/test-self-update.mjs","test:update-prompt":"bun test/test-update-prompt.mjs",test:"bun run build && bun run test:version-detection:setup && 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:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && 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 && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt","test:build-platform-selection":"bun test/test-build-platform-selection.mjs","test:ai-log-capture":"bun test/test-ai-log-capture.mjs","test:ai-analyze-flow":"bun test/test-ai-analyze-flow.mjs","test:ai-analyze-stream":"bun test/test-ai-analyze-stream.mjs","test:ai-sse-parser":"bun test/test-ai-sse-parser.mjs","test:ai-render-markdown":"bun test/test-ai-render-markdown.mjs","test:ai-onboarding-mode":"bun test/test-ai-onboarding-mode.mjs","test:ai-fit":"bun test/test-ai-fit.mjs","test:platform-layout":"bun test/test-platform-layout.mjs","test:frame-fit":"bun test/run-frame-fit.mjs","test:onboarding-min-size":"bun test/test-onboarding-min-size.mjs","test:min-size-gate":"bun test/test-min-size-gate.mjs","test:shell-size-gate":"bun test/test-shell-size-gate.mjs","test:build-log-sanitize":"bun test/test-build-log-sanitize.mjs","test:build-output-viewport":"bun test/test-build-output-viewport.mjs","test:diff-viewer-viewport":"bun test/test-diff-viewer-viewport.mjs","test:build-complete-exit":"bun test/test-build-complete-exit.mjs","test:ai-stream-markdown":"bun test/test-ai-stream-markdown.mjs","test:support-mailto":"bun test/test-support-mailto.mjs","test:support-redact":"bun test/test-support-redact.mjs","test:support-internal-log":"bun test/test-support-internal-log.mjs","test:support-help-menu":"bun test/test-support-help-menu.mjs","test:support-contact":"bun test/test-support-contact.mjs","test:support-bundle-files":"bun test/test-support-bundle-files.mjs"},dependencies:{"@inkjs/ui":"^2.0.0",ink:"^7.0.4","ink-spinner":"^5.0.0",jsonwebtoken:"^9.0.3","node-forge":"^1.4.0",qrcode:"^1.5.4",react:"^19.2.6","string-width":"^8.2.1"},devDependencies:{"@antfu/eslint-config":"^9.0.0","@bradenmacdonald/s3-lite-client":"npm:@jsr/bradenmacdonald__s3-lite-client@0.9.6","@capacitor/cli":"^8.3.4","@capgo/find-package-manager":"^0.0.18","@clack/prompts":"^1.4.0","@modelcontextprotocol/sdk":"^1.29.0","@sauber/table":"npm:@jsr/sauber__table","@std/semver":"npm:@jsr/std__semver@1.0.8","@supabase/supabase-js":"^2.106.2","@tanstack/intent":"^0.0.41","@types/adm-zip":"^0.5.8","@types/jsonwebtoken":"^9.0.10","@types/node":"^25.9.1","@types/node-forge":"^1.3.14","@types/prettyjson":"^0.0.33","@types/qrcode":"^1.5.6","@types/react":"^19.2.15","@types/tmp":"^0.2.6","@types/ws":"^8.18.1","@typescript/native-preview":"7.0.0-dev.20260526.1","@vercel/ncc":"^0.38.4","@xterm/headless":"^6.0.0","adm-zip":"^0.5.17","ci-info":"^4.4.0",commander:"^14.0.3",eslint:"^10.4.0","git-format-staged":"4.0.1",husky:"^9.1.7","is-wsl":"^3.1.1",micromatch:"^4.0.8",open:"^11.0.0",oxlint:"^1.67.0",partysocket:"^1.1.19",prettyjson:"^1.2.5",tmp:"^0.2.6","tus-js-client":"^4.3.1",typescript:"^6.0.3",ws:"^8.21.0",zod:"^4.4.3"}}});async function tF(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 xK0(){let D=await tF("@capgo/cli")??"",$=D?.split(".")[0]??"";return{currentVersion:L1.version,latestVersion:D,isOutdated:!!D&&D!==L1.version,majorVersion:$}}async function WD(){let{isOutdated:D,currentVersion:$,latestVersion:X,majorVersion:J}=await xK0();if(D)L.warning(`\uD83D\uDEA8 You are using @capgo/cli@${$} it's not the latest version.
128
128
  Please use @capgo/cli@${X}" or @capgo/cli@${J} to keep up to date with the latest features and bug fixes.`)}var u1=p(()=>{k0();T4()});async function f_(D,$,X,J,Y,F="✅"){await M0(X,{channel:D,event:J,icon:F,org_id:$,tracking_version:2,...Y?{tags:{"app-id":Y}}:{},notify:!1})}var y_=p(()=>{k0();i9();u1();v0()});var h_=E((Y0D,b_)=>{var h5=1000,g5=h5*60,m5=g5*60,t8=m5*24,_K0=t8*7,kK0=t8*365.25;b_.exports=function(D,$){$=$||{};var X=typeof D;if(X==="string"&&D.length>0)return fK0(D);else if(X==="number"&&isFinite(D))return $.long?bK0(D):yK0(D);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(D))};function fK0(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*kK0;case"weeks":case"week":case"w":return X*_K0;case"days":case"day":case"d":return X*t8;case"hours":case"hour":case"hrs":case"hr":case"h":return X*m5;case"minutes":case"minute":case"mins":case"min":case"m":return X*g5;case"seconds":case"second":case"secs":case"sec":case"s":return X*h5;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return X;default:return}}function yK0(D){var $=Math.abs(D);if($>=t8)return Math.round(D/t8)+"d";if($>=m5)return Math.round(D/m5)+"h";if($>=g5)return Math.round(D/g5)+"m";if($>=h5)return Math.round(D/h5)+"s";return D+"ms"}function bK0(D){var $=Math.abs(D);if($>=t8)return oF(D,$,t8,"day");if($>=m5)return oF(D,$,m5,"hour");if($>=g5)return oF(D,$,g5,"minute");if($>=h5)return oF(D,$,h5,"second");return D+" ms"}function oF(D,$,X,J){var Y=$>=X*1.5;return Math.round(D/X)+" "+J+(Y?"s":"")}});var CW=E((F0D,g_)=>{function hK0(D){X.debug=X,X.default=X,X.coerce=Z,X.disable=Q,X.enable=Y,X.enabled=U,X.humanize=h_(),X.destroy=G,Object.keys(D).forEach((O)=>{X[O]=D[O]}),X.names=[],X.skips=[],X.formatters={};function $(O){let q=0;for(let w=0;w<O.length;w++)q=(q<<5)-q+O.charCodeAt(w),q|=0;return X.colors[Math.abs(q)%X.colors.length]}X.selectColor=$;function X(O){let q,w=null,W,K;function H(...B){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,B[0]=X.coerce(B[0]),typeof B[0]!=="string")B.unshift("%O");let N=0;B[0]=B[0].replace(/%([a-zA-Z%])/g,(A,x)=>{if(A==="%%")return"%";N++;let _=X.formatters[x];if(typeof _==="function"){let j=B[N];A=_.call(M,j),B.splice(N,1),N--}return A}),X.formatArgs.call(M,B),(M.log||X.log).apply(M,B)}if(H.namespace=O,H.useColors=X.useColors(),H.color=X.selectColor(O),H.extend=J,H.destroy=X.destroy,Object.defineProperty(H,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(w!==null)return w;if(W!==X.namespaces)W=X.namespaces,K=X.enabled(O);return K},set:(B)=>{w=B}}),typeof X.init==="function")X.init(H);return H}function J(O,q){let w=X(this.namespace+(typeof q>"u"?":":q)+O);return w.log=this.log,w}function Y(O){X.save(O),X.namespaces=O,X.names=[],X.skips=[];let q=(typeof O==="string"?O:"").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 F(O,q){let w=0,W=0,K=-1,H=0;while(w<O.length)if(W<q.length&&(q[W]===O[w]||q[W]==="*"))if(q[W]==="*")K=W,H=w,W++;else w++,W++;else if(K!==-1)W=K+1,H++,w=H;else return!1;while(W<q.length&&q[W]==="*")W++;return W===q.length}function Q(){let O=[...X.names,...X.skips.map((q)=>"-"+q)].join(",");return X.enable(""),O}function U(O){for(let q of X.skips)if(F(O,q))return!1;for(let q of X.names)if(F(O,q))return!0;return!1}function Z(O){if(O instanceof Error)return O.stack||O.message;return O}function G(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return X.enable(X.load()),X}g_.exports=hK0});var c_=E((m_,aF)=>{m_.formatArgs=mK0;m_.save=cK0;m_.load=dK0;m_.useColors=gK0;m_.storage=nK0();m_.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`.")}})();m_.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 gK0(){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 mK0(D){if(D[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+D[0]+(this.useColors?"%c ":" ")+"+"+aF.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,$)}m_.log=console.debug||console.log||(()=>{});function cK0(D){try{if(D)m_.storage.setItem("debug",D);else m_.storage.removeItem("debug")}catch($){}}function dK0(){let D;try{D=m_.storage.getItem("debug")||m_.storage.getItem("DEBUG")}catch($){}if(!D&&typeof process<"u"&&"env"in process)D=process.env.DEBUG;return D}function nK0(){try{return localStorage}catch(D){}}aF.exports=CW()(m_);var{formatters:lK0}=aF.exports;lK0.j=function(D){try{return JSON.stringify(D)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var n_=E((U0D,d_)=>{d_.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 p_=E((Z0D,i_)=>{var eK0=l("os"),l_=l("tty"),A$=n_(),{env:$1}=process,C4;if(A$("no-color")||A$("no-colors")||A$("color=false")||A$("color=never"))C4=0;else if(A$("color")||A$("colors")||A$("color=true")||A$("color=always"))C4=1;if("FORCE_COLOR"in $1)if($1.FORCE_COLOR==="true")C4=1;else if($1.FORCE_COLOR==="false")C4=0;else C4=$1.FORCE_COLOR.length===0?1:Math.min(parseInt($1.FORCE_COLOR,10),3);function PW(D){if(D===0)return!1;return{level:D,hasBasic:!0,has256:D>=2,has16m:D>=3}}function SW(D,$){if(C4===0)return 0;if(A$("color=16m")||A$("color=full")||A$("color=truecolor"))return 3;if(A$("color=256"))return 2;if(D&&!$&&C4===void 0)return 0;let X=C4||0;if($1.TERM==="dumb")return X;if(process.platform==="win32"){let J=eK0.release().split(".");if(Number(J[0])>=10&&Number(J[2])>=10586)return Number(J[2])>=14931?3:2;return 1}if("CI"in $1){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((J)=>(J in $1))||$1.CI_NAME==="codeship")return 1;return X}if("TEAMCITY_VERSION"in $1)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test($1.TEAMCITY_VERSION)?1:0;if($1.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in $1){let J=parseInt(($1.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch($1.TERM_PROGRAM){case"iTerm.app":return J>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test($1.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test($1.TERM))return 1;if("COLORTERM"in $1)return 1;return X}function DH0(D){let $=SW(D,D&&D.isTTY);return PW($)}i_.exports={supportsColor:DH0,stdout:PW(SW(!0,l_.isatty(1))),stderr:PW(SW(!0,l_.isatty(2)))}});var a_=E((t_,eF)=>{var $H0=l("tty"),sF=l("util");t_.init=ZH0;t_.log=FH0;t_.formatArgs=JH0;t_.save=QH0;t_.load=UH0;t_.useColors=XH0;t_.destroy=sF.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t_.colors=[6,2,3,4,5,1];try{let D=p_();if(D&&(D.stderr||D).level>=2)t_.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){}t_.inspectOpts=Object.keys(process.env).filter((D)=>{return/^debug_/i.test(D)}).reduce((D,$)=>{let X=$.substring(6).toLowerCase().replace(/_([a-z])/g,(Y,F)=>{return F.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 XH0(){return"colors"in t_.inspectOpts?Boolean(t_.inspectOpts.colors):$H0.isatty(process.stderr.fd)}function JH0(D){let{namespace:$,useColors:X}=this;if(X){let J=this.color,Y="\x1B[3"+(J<8?J:"8;5;"+J),F=` ${Y};1m${$} \x1B[0m`;D[0]=F+D[0].split(`
129
129
  `).join(`
130
130
  `+F),D.push(Y+"m+"+eF.exports.humanize(this.diff)+"\x1B[0m")}else D[0]=YH0()+$+" "+D[0]}function YH0(){if(t_.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function FH0(...D){return process.stderr.write(sF.formatWithOptions(t_.inspectOpts,...D)+`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
3
  "type": "module",
4
- "version": "8.0.8",
4
+ "version": "8.1.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -111,7 +111,9 @@
111
111
  "test:app-verification": "bun test/test-app-verification.mjs",
112
112
  "test:pbxproj-parser": "bun test/test-pbxproj-parser.mjs",
113
113
  "test:manifest-path-encoding": "bun test/test-manifest-path-encoding.mjs",
114
- "test": "bun run build && bun run test:version-detection:setup && 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:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && 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 && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files",
114
+ "test:self-update": "bun test/test-self-update.mjs",
115
+ "test:update-prompt": "bun test/test-update-prompt.mjs",
116
+ "test": "bun run build && bun run test:version-detection:setup && 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:fail-on-incompatible && bun run test:credentials && bun run test:credentials-validation && bun run test:android-service-account-validation && bun run test:build-zip-filter && bun run test:checksum && bun run test:build-needed && bun run test:ci-prompts && bun run test:ci-secrets && bun run test:android-onboarding-progress && bun run test:onboarding-telemetry && bun run test:v2-event-migration && bun run test:analytics && bun run test:analytics-error-category && bun run test:analytics-org-resolver && bun run test:supabase-perf && bun run test:preview-qr && bun run test:mcp-analytics && bun run test:app-created-source && bun run test:doctor-analytics && bun run test:posthog-exception && bun run test:build-platform-selection && bun run test:onboarding-recovery && bun run test:onboarding-progress && bun run test:onboarding-run-targets && bun run test:run-device-command && bun run test:init-app-conflict && bun run test:init-guardrails && 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 && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:apple-api-import-helpers && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt",
115
117
  "test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
116
118
  "test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
117
119
  "test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",