export interface TelemetryEvent { event: string; properties?: Record; } export interface TestExecutionMetrics { suiteUuid: string; duration: number; filesChanged: number; testsGenerated: number; success: boolean; error?: string; executionType: 'working' | 'commit' | 'pr' | 'pr-sequence'; } export interface CommandMetrics { command: string; options: Record; duration: number; success: boolean; error?: string; } /** * Telemetry service for tracking CLI usage and performance metrics */ export declare class TelemetryService { private static instance; private posthog; private userId; private sessionId; private enabled; private initialized; private commandStartTime; private testStartTime; private constructor(); /** * Get singleton instance of TelemetryService */ static getInstance(): TelemetryService; /** * Initialize PostHog client (lazy initialization) */ private initializePostHog; /** * Get or create a persistent user ID */ private getOrCreateUserId; /** * Generate a session ID for this CLI invocation */ private generateSessionId; /** * Get CLI version from package.json */ private getCliVersion; /** * Ensure PostHog is initialized before use */ private ensureInitialized; /** * Identify the user with properties */ identify(properties: Record): void; /** * Track a custom event */ track(event: string, properties?: Record): void; /** * Track command start */ trackCommandStart(command: string, options: Record): void; /** * Track command completion */ trackCommandComplete(command: string, success: boolean, error?: string): void; /** * Track test execution start */ trackTestStart(executionType: string, metadata?: Record): void; /** * Track test execution completion */ trackTestComplete(metrics: TestExecutionMetrics): void; /** * Track API errors */ trackApiError(endpoint: string, statusCode: number, error: string): void; /** * Track feature usage */ trackFeatureUsage(feature: string, metadata?: Record): void; /** * Track tunnel creation */ trackTunnelCreation(success: boolean, port?: number, error?: string): void; /** * Track artifact download */ trackArtifactDownload(type: string, success: boolean, count?: number): void; /** * Detect execution environment */ private detectEnvironment; /** * Sanitize command options to remove sensitive data */ private sanitizeOptions; /** * Sanitize error messages to remove sensitive data */ private sanitizeError; /** * Flush pending events and shutdown */ shutdown(): Promise; } export declare const telemetry: { trackCommandStart: (command: string, options: Record) => void; trackCommandComplete: (command: string, success: boolean, error?: string) => void; trackTestStart: (executionType: string, metadata?: Record) => void; trackTestComplete: (metrics: TestExecutionMetrics) => void; trackApiError: (endpoint: string, statusCode: number, error: string) => void; trackFeatureUsage: (feature: string, metadata?: Record) => void; trackTunnelCreation: (success: boolean, port?: number, error?: string) => void; trackArtifactDownload: (type: string, success: boolean, count?: number) => void; shutdown: () => Promise; }; //# sourceMappingURL=telemetry.d.ts.map