import type { TailProgress } from '../tail-types.js';
export type AndroidOnboardingStep = 'welcome' | 'resume-prompt' | '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' | 'service-account-method-select' | 'sa-json-existing-path' | 'sa-json-existing-picker' | 'sa-json-validating' | 'sa-json-validation-failed' | '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-github-actions-setup' | 'confirm-secrets-push' | 'ask-export-env' | 'exporting-env' | 'confirm-env-export-overwrite' | 'overwrite-and-export-env' | 'pick-package-manager' | 'pick-build-script' | 'pick-build-script-custom' | 'preview-workflow-file' | 'view-workflow-diff' | 'writing-workflow-file' | 'ask-build' | 'requesting-build' | 'ai-analysis-prompt' | 'ai-analysis-running' | 'ai-analysis-result' | 'ai-analysis-result-scroll' | 'build-complete' | 'error' | 'support-confirm' | 'support-log-view' | 'support-uploading';
export type AndroidOnboardingErrorCategory = 'keystore_invalid' | 'google_oauth_failed' | 'play_account_id_invalid' | 'sa_json_shape_invalid' | 'sa_json_token_rejected' | 'sa_json_no_app_access' | 'sa_json_network_error' | 'unknown';
export type KeystoreMethod = 'existing' | 'generate';
export type ServiceAccountMethod = 'existing' | 'generate';
export interface KeystoreReady {
    keystorePath: string;
    alias: string;
    isGenerated: boolean;
}
export interface GoogleSignInComplete {
    email: string;
    googleSubject: string;
    scope: string;
}
export interface PlayDeveloperAccountChoice {
    developerId: string;
    displayName?: string;
}
export interface GcpProjectChoice {
    projectId: string;
    projectNumber?: string;
    displayName: string;
    /** Whether this onboarding run created the project (vs. reusing an existing one). */
    createdByOnboarding: boolean;
}
export interface ServiceAccountProvisioned {
    email: string;
    projectId: string;
    uniqueId?: string;
}
export interface PlayInviteProvisioned {
    developerId: string;
    serviceAccountEmail: string;
}
export interface AndroidPackageChoice {
    /** The Android applicationId that Play Console uses for this app. */
    packageName: string;
    /** How we picked it — useful for telemetry / resume clarity. */
    source: 'gradle' | 'capacitor-config' | 'user-input';
}
export interface CredentialsSaved {
    /** ISO timestamp credentials.json was written — purely informational. */
    savedAt: string;
}
export interface BuildRequested {
    /** The build dashboard URL surfaced after the queue request succeeded. */
    buildUrl: string;
}
export interface CiSecretsUploaded {
    /** Provider the secrets were pushed to (matches the chosen ciSecretTarget). */
    provider: 'github' | 'gitlab';
    /** How many env vars were pushed — informational. */
    count: number;
}
export interface AndroidOnboardingProgress extends TailProgress {
    platform: 'android';
    appId: string;
    startedAt: string;
    keystoreMethod?: KeystoreMethod;
    keystoreExistingPath?: string;
    keystoreAlias?: string;
    keystoreStorePassword?: string;
    keystoreKeyPassword?: string;
    keystoreCommonName?: string;
    serviceAccountForkSeen?: true;
    serviceAccountMethod?: ServiceAccountMethod;
    serviceAccountJsonPath?: string;
    serviceAccountValidationSkipped?: boolean;
    pendingNewProjectId?: string;
    pendingNewProjectDisplayName?: string;
    completedSteps: {
        keystoreReady?: KeystoreReady;
        googleSignInComplete?: GoogleSignInComplete;
        playAccountChosen?: PlayDeveloperAccountChoice;
        gcpProjectChosen?: GcpProjectChoice;
        androidPackageChosen?: AndroidPackageChoice;
        serviceAccountProvisioned?: ServiceAccountProvisioned;
        playInviteProvisioned?: PlayInviteProvisioned;
        /** Set once `saving-credentials` wrote credentials.json. Gates tail entry. */
        credentialsSaved?: CredentialsSaved;
        /** Set once `requesting-build` queued a build. Guards a double build-request. */
        buildRequested?: BuildRequested;
        /** Set once `uploading-ci-secrets` pushed the secrets. Guards a re-upload. */
        ciSecretsUploaded?: CiSecretsUploaded;
    };
    _oauthRefreshToken?: string;
    _keystoreBase64?: string;
    /** Base64 of the downloaded SA JSON key — saved as PLAY_CONFIG_JSON at end. */
    _serviceAccountKeyBase64?: string;
    /** Platform whose onboarding is currently in-flight. */
    activePlatform?: 'android';
    /** True when the new-keystore password was auto-generated (random). Never logged. */
    keystorePasswordGenerated?: boolean;
    /** True once the user chose the MANUAL password method (lets the stateless MCP advance). */
    keystorePasswordManual?: boolean;
    /**
     * Data-safety gate state for the shared engine (mirrors main's ink TUI
     * `credentials-exist` → `backing-up` flow). The Ink driver does not read this
     * field — it gates the same situation via React state — so it is harmless to
     * the TUI. Lifecycle:
     *   - undefined → gate not yet evaluated (or no saved credentials exist)
     *   - 'pending' → saved android credentials exist; awaiting the user's
     *                 backup-or-cancel choice (the `credentials-exist` step)
     *   - 'backup'  → user chose backup; the `backing-up` effect must still run
     *   - 'done'    → backup performed (or source absent); proceed to keystore
     *   - 'cancel'  → user chose to stop; onboarding halts to protect the
     *                 existing credentials (mirrors main's exitOnboarding())
     */
    _credentialsExistGate?: 'pending' | 'backup' | 'done' | 'cancel';
}
export declare const ANDROID_STEP_PROGRESS: Record<AndroidOnboardingStep, number>;
export declare function getAndroidPhaseLabel(step: AndroidOnboardingStep): string;
