@capgo/cli 8.33.0 → 8.33.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/index.js +690 -701
- package/dist/package.json +5 -3
- package/dist/src/analytics/cli-headers.d.ts +9 -0
- package/dist/src/analytics/org-resolver.d.ts +3 -1
- package/dist/src/api/app.d.ts +16 -4
- package/dist/src/api/channels.d.ts +31 -46
- package/dist/src/api/versions.d.ts +13 -4
- package/dist/src/app/list.d.ts +1 -1
- package/dist/src/build/onboarding/android/ui/app.d.ts +2 -0
- package/dist/src/build/onboarding/command.d.ts +2 -0
- package/dist/src/build/onboarding/ui/app.d.ts +2 -0
- package/dist/src/build/onboarding/ui/shell.d.ts +2 -0
- package/dist/src/bundle/auto-bump-ai.d.ts +50 -0
- package/dist/src/bundle/upload.d.ts +14 -0
- package/dist/src/capacitor-cli.d.ts +1 -0
- package/dist/src/channel/add.d.ts +0 -36
- package/dist/src/mcp/tool-schemas.d.ts +1 -0
- package/dist/src/posthog.d.ts +8 -0
- package/dist/src/preview/qr.d.ts +13 -9
- package/dist/src/schemas/auth.d.ts +2 -2
- package/dist/src/schemas/bundle.d.ts +2 -0
- package/dist/src/schemas/sdk.d.ts +1 -0
- package/dist/src/sdk.js +384 -395
- package/dist/src/shared/cli-user-error.d.ts +20 -0
- package/dist/src/types/supabase.types.d.ts +3 -0
- package/dist/src/utils.d.ts +23 -1
- package/dist/src/versionHelpers.d.ts +9 -1
- package/package.json +5 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marker for *expected* CLI failures that represent a legitimate user-facing
|
|
3
|
+
* state — missing input, a channel with no bundle linked, insufficient
|
|
4
|
+
* permissions — rather than a crash. The CLI still prints a clear message and
|
|
5
|
+
* exits non-zero, but `shouldCapturePosthogException` skips these so they never
|
|
6
|
+
* open an error tracking `$exception` issue. They are still counted via
|
|
7
|
+
* `trackCommandFailed` / `categorizeCliError`, so failure analytics stay intact.
|
|
8
|
+
*
|
|
9
|
+
* Keep any dynamic identifier (e.g. a channel name) OUT of the message and pass
|
|
10
|
+
* it via `context` instead: interpolating it into the message makes error
|
|
11
|
+
* tracking fingerprint a separate issue per value, which is exactly the noise
|
|
12
|
+
* this class exists to avoid.
|
|
13
|
+
*
|
|
14
|
+
* Precedent for domain-specific error markers already exists in the CLI with
|
|
15
|
+
* `MacOSSigningError` and `BuildRecordReadError`.
|
|
16
|
+
*/
|
|
17
|
+
export declare class CliUserError extends Error {
|
|
18
|
+
readonly context?: Record<string, unknown>;
|
|
19
|
+
constructor(message: string, context?: Record<string, unknown>);
|
|
20
|
+
}
|
|
@@ -1514,6 +1514,7 @@ export type Database = {
|
|
|
1514
1514
|
versions_created: number;
|
|
1515
1515
|
apps_with_cli_onboarding_builds_24h: number;
|
|
1516
1516
|
apps_with_manual_builds_24h: number;
|
|
1517
|
+
apps_with_preview: number;
|
|
1517
1518
|
apps_active: number | null;
|
|
1518
1519
|
average_ltv: number;
|
|
1519
1520
|
build_avg_seconds_day_android: number;
|
|
@@ -1607,6 +1608,7 @@ export type Database = {
|
|
|
1607
1608
|
versions_created?: number;
|
|
1608
1609
|
apps_with_cli_onboarding_builds_24h?: number;
|
|
1609
1610
|
apps_with_manual_builds_24h?: number;
|
|
1611
|
+
apps_with_preview?: number;
|
|
1610
1612
|
apps_active?: number | null;
|
|
1611
1613
|
average_ltv?: number;
|
|
1612
1614
|
build_avg_seconds_day_android?: number;
|
|
@@ -1700,6 +1702,7 @@ export type Database = {
|
|
|
1700
1702
|
versions_created?: number;
|
|
1701
1703
|
apps_with_cli_onboarding_builds_24h?: number;
|
|
1702
1704
|
apps_with_manual_builds_24h?: number;
|
|
1705
|
+
apps_with_preview?: number;
|
|
1703
1706
|
apps_active?: number | null;
|
|
1704
1707
|
average_ltv?: number;
|
|
1705
1708
|
build_avg_seconds_day_android?: number;
|
package/dist/src/utils.d.ts
CHANGED
|
@@ -24,6 +24,14 @@ export declare const TUS_UPLOAD_RETRY_DELAYS: number[];
|
|
|
24
24
|
export declare const MAX_MANIFEST_ENTRIES = 10000;
|
|
25
25
|
/** User-facing error when a delta/manifest upload exceeds MAX_MANIFEST_ENTRIES. */
|
|
26
26
|
export declare function deltaManifestTooLargeMessage(fileCount: number): string;
|
|
27
|
+
/**
|
|
28
|
+
* Stable `name` for the error thrown when the standard (non-TUS) upload hits its
|
|
29
|
+
* wall-clock timeout. Kept typed and constant so error tracking groups every
|
|
30
|
+
* occurrence into a single issue instead of one duplicate per CLI version.
|
|
31
|
+
*/
|
|
32
|
+
export declare const UPLOAD_TIMEOUT_ERROR_NAME = "BundleUploadTimeoutError";
|
|
33
|
+
/** User-facing error when the standard HTTP PUT upload exceeds its wall-clock timeout. */
|
|
34
|
+
export declare function uploadTimeoutMessage(timeoutMs: number): string;
|
|
27
35
|
export declare const PACKNAME = "package.json";
|
|
28
36
|
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
29
37
|
export type Organization = ArrayElement<Database['public']['Functions']['get_orgs_v7']['Returns']>;
|
|
@@ -176,7 +184,13 @@ export interface CapgoCliInvokeOptions {
|
|
|
176
184
|
useFilesHost?: boolean;
|
|
177
185
|
supaHost?: string;
|
|
178
186
|
supaAnon?: string;
|
|
187
|
+
signal?: AbortSignal;
|
|
179
188
|
}
|
|
189
|
+
export declare function getCapgoCliHttpStatus(error: unknown): number | undefined;
|
|
190
|
+
export declare function readCapgoCliApiErrorPayload(error: unknown): Promise<{
|
|
191
|
+
error?: string;
|
|
192
|
+
message?: string;
|
|
193
|
+
} | null>;
|
|
180
194
|
/**
|
|
181
195
|
* Invoke Capgo HTTP APIs formerly reached via supabase.functions.invoke.
|
|
182
196
|
* Capgo cloud -> hostApi / hostFilesApi. Self-host -> /functions/v1.
|
|
@@ -1620,6 +1634,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
1620
1634
|
versions_created: number;
|
|
1621
1635
|
apps_with_cli_onboarding_builds_24h: number;
|
|
1622
1636
|
apps_with_manual_builds_24h: number;
|
|
1637
|
+
apps_with_preview: number;
|
|
1623
1638
|
apps_active: number | null;
|
|
1624
1639
|
average_ltv: number;
|
|
1625
1640
|
build_avg_seconds_day_android: number;
|
|
@@ -1713,6 +1728,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
1713
1728
|
versions_created?: number;
|
|
1714
1729
|
apps_with_cli_onboarding_builds_24h?: number;
|
|
1715
1730
|
apps_with_manual_builds_24h?: number;
|
|
1731
|
+
apps_with_preview?: number;
|
|
1716
1732
|
apps_active?: number | null;
|
|
1717
1733
|
average_ltv?: number;
|
|
1718
1734
|
build_avg_seconds_day_android?: number;
|
|
@@ -1806,6 +1822,7 @@ export declare function createSupabaseClient(apikey: string, supaHost?: string,
|
|
|
1806
1822
|
versions_created?: number;
|
|
1807
1823
|
apps_with_cli_onboarding_builds_24h?: number;
|
|
1808
1824
|
apps_with_manual_builds_24h?: number;
|
|
1825
|
+
apps_with_preview?: number;
|
|
1809
1826
|
apps_active?: number | null;
|
|
1810
1827
|
average_ltv?: number;
|
|
1811
1828
|
build_avg_seconds_day_android?: number;
|
|
@@ -5711,6 +5728,8 @@ export type manifestType = Awaited<ReturnType<typeof generateManifest>>;
|
|
|
5711
5728
|
export declare function zipFile(filePath: string): Promise<Buffer>;
|
|
5712
5729
|
export declare function zipFileUnix(filePath: string): Buffer<ArrayBufferLike>;
|
|
5713
5730
|
export declare function zipFileWindows(filePath: string): Promise<Buffer>;
|
|
5731
|
+
export declare function appAddHintMessage(appId: string): string;
|
|
5732
|
+
export declare function isAppNotFoundError(error: unknown): boolean;
|
|
5714
5733
|
export declare function uploadTUS(apikey: string, data: Buffer, orgId: string, appId: string, name: string, spinner: UploadSpinner, localConfig: CapgoConfig, chunkSize: number): Promise<boolean>;
|
|
5715
5734
|
export declare function deletedFailedVersion(apikey: string, appId: string, name: string, options?: {
|
|
5716
5735
|
supaHost?: string;
|
|
@@ -5791,7 +5810,10 @@ export declare function assertCliPermission(supabase: SupabaseClient<Database>,
|
|
|
5791
5810
|
silent?: boolean;
|
|
5792
5811
|
}): Promise<void>;
|
|
5793
5812
|
export declare function assertOrgPermission(supabase: SupabaseClient<Database>, apikey: string, permissionKey: string, orgId: string, message: string, silent: boolean): Promise<void>;
|
|
5794
|
-
export declare function getOrganizationId(
|
|
5813
|
+
export declare function getOrganizationId(apikey: string, appId: string, options?: {
|
|
5814
|
+
supaHost?: string;
|
|
5815
|
+
supaAnon?: string;
|
|
5816
|
+
}): Promise<string>;
|
|
5795
5817
|
export declare function getHumanDate(createdA: string | null): string;
|
|
5796
5818
|
export declare function getPMAndCommand(): {
|
|
5797
5819
|
pm: PackageManagerType;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
/** CLI / API auto-bump levels (fix is normalized to patch at parse time) */
|
|
2
2
|
export type AutoBumpLevel = 'major' | 'minor' | 'patch' | 'metadata';
|
|
3
|
+
/** Resolver input including AI-backed classification */
|
|
4
|
+
export type AutoBumpInput = AutoBumpLevel | 'ai';
|
|
3
5
|
/** @std/semver increment release types used by auto-bump */
|
|
4
6
|
export type AutoBumpRelease = 'major' | 'minor' | 'patch' | 'prerelease';
|
|
5
7
|
/**
|
|
6
|
-
* Normalize CLI/SDK auto-bump values
|
|
8
|
+
* Normalize CLI/SDK auto-bump values including `ai`.
|
|
7
9
|
* - bare flag / true → minor
|
|
8
10
|
* - fix → patch
|
|
11
|
+
* - ai → ai (resolved later via Workers AI)
|
|
9
12
|
* - metadata stays metadata (mapped to prerelease increment later)
|
|
10
13
|
*/
|
|
14
|
+
export declare function normalizeAutoBumpInput(level: string | boolean | undefined | null): AutoBumpInput | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Normalize CLI/SDK auto-bump values to concrete bump levels (excludes `ai`).
|
|
17
|
+
* Prefer `normalizeAutoBumpInput` when `ai` is allowed.
|
|
18
|
+
*/
|
|
11
19
|
export declare function normalizeAutoBumpLevel(level: string | boolean | undefined | null): AutoBumpLevel | undefined;
|
|
12
20
|
export declare function autoBumpLevelToRelease(level: AutoBumpLevel | AutoBumpRelease): AutoBumpRelease;
|
|
13
21
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.33.
|
|
4
|
+
"version": "8.33.1",
|
|
5
5
|
"description": "A CLI to upload to capgo servers",
|
|
6
6
|
"author": "Martin martin@capgo.app",
|
|
7
7
|
"license": "Apache 2.0",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"test:upload": "bun test/test-upload-validation.mjs",
|
|
74
74
|
"test:fail-on-incompatible": "bun test/test-fail-on-incompatible.mjs",
|
|
75
75
|
"test:native-dependencies": "bun test/test-native-dependencies.mjs",
|
|
76
|
+
"test:package-json-guard": "bun test/test-package-json-guard.mjs",
|
|
76
77
|
"test:credentials": "bun test/test-credentials.mjs",
|
|
77
78
|
"test:asc-key-protocol": "bun test/test-asc-key-protocol.mjs",
|
|
78
79
|
"test:credentials-validation": "bun test/test-credentials-validation.mjs",
|
|
@@ -160,7 +161,7 @@
|
|
|
160
161
|
"test:ios-marketing-version": "bun test/test-ios-marketing-version.mjs",
|
|
161
162
|
"test:platform-flow-contract": "bun test/test-platform-flow-contract.mjs",
|
|
162
163
|
"test:tail-engine-shared": "bun test/test-tail-engine-shared.mjs",
|
|
163
|
-
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && 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:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test: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-monorepo-targeting && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation",
|
|
164
|
+
"test": "bun run build && bun run test:helper-dce && bun run test:version-detection:setup && bun run test:bundle && bun run test:functional && bun run test:semver && bun run test:auto-bump-version && bun run test:auto-bump-ai-diff && bun run test:version-edge-cases && bun run test:regex && bun run test:upload && bun run test:fail-on-incompatible && bun run test:native-dependencies && bun run test:package-json-guard && 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:app-set-options && bun run test:mcp-analytics && bun run test:mcp-instructions && bun run test:mcp-live-update-onboarding && bun run test:mcp-stdout-guard && bun run test:mcp-platform-select && bun run test:mcp-explain-scopes && bun run test:mcp-oauth-reopen && bun run test:mcp-broker-oauth && bun run test:mcp-broker-session && bun run test:mcp-credentials-manage && bun run test:mcp-resume-prompt && bun run test:mcp-build-job && bun run test:mcp-build-tools && bun run test:app-created-source && bun run test: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-monorepo-targeting && bun run test:init-app-conflict && bun run test:init-guardrails && bun run test:init-replay && bun run test:prompt-preferences && bun run test:esm-sdk && bun run test:mcp && bun run test:mcp-no-key-handshake && bun run test:auth-session && bun run test:version-detection && bun run test:platform-paths && bun run test:project-type-detection && bun run test:payload-split && bun run test:manifest-path-encoding && bun run test:macos-signing && bun run test:asc-key-protocol && bun run test:apple-api-import-helpers && bun run test:apple-api-verify-key && bun run test:bundle-id-detector && bun run test:apple-api-app-list && bun run test:app-verification && bun run test:pbxproj-parser && bun run test:ai-log-capture && bun run test:ai-analyze-flow && bun run test:cicd-failure-help && bun run test:ai-sse-parser && bun run test:ai-render-markdown && bun run test:ai-stream-markdown && bun run test:ai-onboarding-mode && bun run test:ai-fit && bun run test:platform-layout && bun run test:frame-fit && bun run test:onboarding-min-size && bun run test:min-size-gate && bun run test:shell-size-gate && bun run test:build-log-sanitize && bun run test:build-output-viewport && bun run test:diff-viewer-viewport && bun run test:build-complete-exit && bun run test:ai-analyze-stream && bun run test:support-mailto && bun run test:support-redact && bun run test:support-internal-log && bun run test:support-help-menu && bun run test:support-contact && bun run test:support-upload-prompt && bun run test:support-bundle-files && bun run test:self-update && bun run test:update-prompt && bun run test:apple-api-cert-create && bun run test:android-tail-engine && bun run test:android-tail-render && bun run test:android-tail-routing && bun run test:dev-gate-stripped && bun run test:frame-fit-ios-shared && bun run test:ios-confirm-app-id && bun run test:ios-create-new && bun run test:ios-e2e && bun run test:ios-flow-contract && bun run test:ios-import-discovery && bun run test:ios-import-export && bun run test:ios-import-pickers && bun run test:ios-import-recovery && bun run test:ios-recovery && bun run test:ios-resume && bun run test:ios-tail-handoff && bun run test:ios-tui-render && bun run test:p8-error && bun run test:ios-tui-routing && bun run test:ios-updater-sync-validation && bun run test:ios-verify-app && bun run test:ios-marketing-version && bun run test:platform-flow-contract && bun run test:tail-engine-shared && bun run test:prescan && bun run test:android-reporting-api && bun run test:android-app-verification && bun run test:android-rename && bun run test:appflow-auth && bun run test:appflow-api-map && bun run test:appflow-validate && bun run test:appflow-flow && bun run test:appflow-gapfill && bun run test:appflow-engine && bun run test:appflow-tail && bun run test:appflow-fetch && bun run test:appflow-sa-decode && bun run test:app-permission-helper && bun run test:organization-set-api-host && bun run test:trial-warning && bun run test:plan-validation",
|
|
164
165
|
"test:build-platform-selection": "bun test/test-build-platform-selection.mjs",
|
|
165
166
|
"test:ai-log-capture": "bun test/test-ai-log-capture.mjs",
|
|
166
167
|
"test:ai-analyze-flow": "bun test/test-ai-analyze-flow.mjs",
|
|
@@ -205,7 +206,8 @@
|
|
|
205
206
|
"test:organization-set-api-host": "bun test/test-organization-set-api-host.mjs",
|
|
206
207
|
"test:trial-warning": "bun test/test-trial-warning.mjs",
|
|
207
208
|
"test:plan-validation": "bun test/test-plan-validation.mjs",
|
|
208
|
-
"test:auto-bump-version": "bun test/test-auto-bump-version.mjs"
|
|
209
|
+
"test:auto-bump-version": "bun test/test-auto-bump-version.mjs",
|
|
210
|
+
"test:auto-bump-ai-diff": "bun test/test-auto-bump-ai-diff.mjs"
|
|
209
211
|
},
|
|
210
212
|
"dependencies": {
|
|
211
213
|
"@inkjs/ui": "^2.0.0",
|