@capgo/cli 7.108.4 → 7.109.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": "7.108.4",
4
+ "version": "7.109.0",
5
5
  "description": "A CLI to upload to capgo servers",
6
6
  "author": "Martin martin@capgo.app",
7
7
  "license": "Apache 2.0",
@@ -0,0 +1,37 @@
1
+ export type AiAnalysisChoice = 'capgo_ai' | 'local_ai' | 'skip' | 'auto_upload';
2
+ export type AiAnalysisTriggeredBy = 'menu' | 'ci_flag';
3
+ export type AiAnalysisResult = 'success' | 'already_analyzed' | 'too_big' | 'error';
4
+ export interface TrackAiAnalysisChoiceInput {
5
+ apikey: string;
6
+ orgId: string;
7
+ appId: string;
8
+ platform: 'ios' | 'android';
9
+ jobId: string;
10
+ choice: AiAnalysisChoice;
11
+ triggeredBy: AiAnalysisTriggeredBy;
12
+ }
13
+ export interface TrackAiAnalysisResultInput {
14
+ apikey: string;
15
+ orgId: string;
16
+ appId: string;
17
+ platform: 'ios' | 'android';
18
+ jobId: string;
19
+ result: AiAnalysisResult;
20
+ errorStatus?: number;
21
+ }
22
+ /**
23
+ * Emit `CLI AI Build Analysis Choice` for every branch the user (or CI flag) selected.
24
+ *
25
+ * Privacy boundary: only closed-enum choice + triggered_by metadata is sent. The
26
+ * AI diagnosis text is never observed at this stage.
27
+ */
28
+ export declare function trackAiAnalysisChoice(input: TrackAiAnalysisChoiceInput): Promise<void>;
29
+ /**
30
+ * Emit `CLI AI Build Analysis Result` only for paths that actually hit the server
31
+ * (capgo_ai or auto_upload).
32
+ *
33
+ * Privacy boundary: the AI analysis text (`result.analysis` in PostAnalyzeResult)
34
+ * MUST NEVER appear in any tag here. Only the closed-enum `result` and optional
35
+ * `error_status` cross the boundary.
36
+ */
37
+ export declare function trackAiAnalysisResult(input: TrackAiAnalysisResultInput): Promise<void>;
@@ -1,4 +1,5 @@
1
1
  export type AndroidOnboardingStep = 'welcome' | 'credentials-exist' | 'backing-up' | 'no-platform' | 'keystore-method-select' | 'keystore-explainer' | 'keystore-existing-path' | 'keystore-existing-picker' | 'keystore-existing-store-password' | 'keystore-existing-detecting-alias' | 'keystore-existing-alias-select' | 'keystore-existing-alias' | 'keystore-existing-key-password' | 'keystore-new-alias' | 'keystore-new-password-method' | 'keystore-new-store-password' | 'keystore-new-key-password' | 'keystore-new-cn' | 'keystore-generating' | 'google-sign-in' | 'google-sign-in-running' | 'play-developer-id-input' | 'gcp-projects-loading' | 'gcp-projects-select' | 'gcp-project-create-name' | 'android-package-select' | 'gcp-setup-running' | 'saving-credentials' | 'detecting-ci-secrets' | 'ci-secrets-setup' | 'ci-secrets-target-select' | 'ask-ci-secrets' | 'checking-ci-secrets' | 'confirm-ci-secret-overwrite' | 'uploading-ci-secrets' | 'ci-secrets-failed' | 'ask-build' | 'requesting-build' | 'build-complete' | 'error';
2
+ export type AndroidOnboardingErrorCategory = 'keystore_invalid' | 'google_oauth_failed' | 'play_account_id_invalid' | 'unknown';
2
3
  export type KeystoreMethod = 'existing' | 'generate';
3
4
  export interface KeystoreReady {
4
5
  keystorePath: string;
@@ -0,0 +1,4 @@
1
+ import type { AndroidOnboardingErrorCategory } from './android/types.js';
2
+ import type { OnboardingErrorCategory, OnboardingStep } from './types.js';
3
+ export declare function mapIosOnboardingError(error: unknown, failedStep?: OnboardingStep): OnboardingErrorCategory;
4
+ export declare function mapAndroidOnboardingError(error: unknown): AndroidOnboardingErrorCategory;
@@ -0,0 +1,15 @@
1
+ import type { AndroidOnboardingErrorCategory, AndroidOnboardingStep } from './android/types.js';
2
+ import type { OnboardingErrorCategory, OnboardingStep, Platform } from './types.js';
3
+ export interface TrackBuilderOnboardingStepInput {
4
+ apikey: string;
5
+ appId: string;
6
+ orgId: string;
7
+ platform: Platform;
8
+ step: OnboardingStep | AndroidOnboardingStep;
9
+ durationMs?: number;
10
+ /** Raw caught error — mapped via the platform's category mapper. Use this OR errorCategory, not both. */
11
+ error?: unknown;
12
+ /** Pre-computed category. Takes precedence over `error` if both are present. */
13
+ errorCategory?: OnboardingErrorCategory | AndroidOnboardingErrorCategory;
14
+ }
15
+ export declare function trackBuilderOnboardingStep(input: TrackBuilderOnboardingStepInput): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  export type Platform = 'ios' | 'android';
2
2
  export type OnboardingStep = 'welcome' | 'platform-select' | 'adding-platform' | 'credentials-exist' | 'backing-up' | 'setup-method-select' | 'import-scanning' | 'import-distribution-mode' | 'import-pick-identity' | 'import-pick-profile' | 'import-no-match-recovery' | 'import-fetching-profile' | 'import-create-profile-only' | 'import-export-warning' | 'import-compiling-helper' | 'import-exporting' | 'api-key-instructions' | 'p8-method-select' | 'input-p8-path' | 'input-key-id' | 'input-issuer-id' | 'verifying-key' | 'creating-certificate' | 'cert-limit-prompt' | 'revoking-certificate' | 'creating-profile' | 'duplicate-profile-prompt' | 'deleting-duplicate-profiles' | 'saving-credentials' | 'detecting-ci-secrets' | 'ci-secrets-setup' | 'ci-secrets-target-select' | 'ask-ci-secrets' | 'checking-ci-secrets' | 'confirm-ci-secret-overwrite' | 'uploading-ci-secrets' | 'ci-secrets-failed' | 'ask-build' | 'requesting-build' | 'build-complete' | 'no-platform' | 'error';
3
+ export type OnboardingErrorCategory = 'apple_api_unauthorized' | 'apple_api_rate_limited' | 'cert_limit_reached' | 'profile_creation_failed' | 'p8_invalid' | 'keychain_no_identities' | 'keychain_export_failed' | 'keychain_helper_compile_failed' | 'profile_no_match' | 'profile_read_failed' | 'unknown';
3
4
  export interface ApiKeyData {
4
5
  keyId: string;
5
6
  issuerId: string;
@@ -0,0 +1,17 @@
1
+ export type BuilderUploadFailureCategory = 'network_error' | 'unauthorized' | 'payload_too_large' | 'storage_failure' | 'unknown';
2
+ type BuilderUploadPhase = 'started' | 'succeeded' | 'failed';
3
+ export interface TrackBuilderUploadInput {
4
+ apikey: string;
5
+ appId: string;
6
+ orgId: string;
7
+ platform: 'ios' | 'android';
8
+ buildMode: string;
9
+ jobId: string;
10
+ sizeBytes: number;
11
+ phase: BuilderUploadPhase;
12
+ durationSeconds?: number;
13
+ error?: unknown;
14
+ }
15
+ export declare function mapBuilderUploadError(error: unknown): BuilderUploadFailureCategory;
16
+ export declare function trackBuilderUpload(input: TrackBuilderUploadInput): Promise<void>;
17
+ export {};