import type { AuthMode, TerminationReason } from './telemetry-types.js'; export declare class Analytics { private tags; private sessionId; private sessionStartTime; private distinctId?; private mode?; private authMode; private totalInputTokens; private totalOutputTokens; private agentIterations; constructor(); setDistinctId(distinctId: string): void; setAccessToken(token: string): void; setApiKeyAuth(apiKey: string): void; setClaimTokenAuth(clientId: string, claimToken: string): void; /** * Set the auth mode explicitly for special cases. Normal CLI flows should use * `configureAuthFromAvailableSources()` so transport and auth.mode stay aligned. */ setAuthMode(mode: AuthMode): void; setGatewayUrl(url: string): void; private isEnabled; /** * Configure telemetry transport and auth.mode from all available CLI auth * sources. Priority: stored JWT, unclaimed-environment claim token, active * environment API key, then WORKOS_API_KEY. */ configureAuthFromAvailableSources(): AuthMode; /** * Initialize telemetry for non-installer commands. * Sets telemetry URL from default config and loads auth credentials. */ initForNonInstaller(): void; setTag(key: string, value: string | boolean | number | null | undefined): void; capture(eventName: string, properties?: Record): void; captureException(error: Error, properties?: Record): void; getFeatureFlag(_flagKey: string): Promise; /** All capture methods that record error details MUST go through this. */ private extractErrorFields; private detectCiProvider; private getEnvFingerprint; sessionStart(mode: 'cli' | 'tui' | 'headless', version: string): void; stepCompleted(name: string, durationMs: number, success: boolean, error?: Error): void; toolCalled(toolName: string, durationMs: number, success: boolean): void; llmRequest(model: string, inputTokens: number, outputTokens: number): void; incrementAgentIterations(): void; emitCommandEvent(name: string, durationMs: number, success: boolean, options?: { error?: Error; flags?: string[]; reason?: TerminationReason; errorCode?: string; apiContext?: { status?: number; code?: string; resource?: string; }; }): void; captureUnhandledCrash(error: Error, options?: { command?: string; version?: string; }): void; shutdown(status: 'success' | 'error' | 'cancelled'): Promise; } export declare const analytics: Analytics;