export interface TelemetryConfigV1 { schemaVersion: 1; enabled: boolean; noticeShown: boolean; installId: string | null; initializedEventSent: boolean; } export declare const DEFAULT_TELEMETRY_CONFIG: TelemetryConfigV1; export declare function readTelemetryConfig(): Promise; export declare function writeTelemetryConfig(config: TelemetryConfigV1): Promise; export declare function telemetryEnvironmentDisabled(env?: NodeJS.ProcessEnv): boolean; export declare function isTelemetrySendingEnabled(config: TelemetryConfigV1, env?: NodeJS.ProcessEnv): boolean; export declare function shouldShowTelemetryNotice(input: { config: TelemetryConfigV1; interactiveTty: boolean; humanOutput: boolean; env?: NodeJS.ProcessEnv; }): boolean; export declare const TELEMETRY_NOTICE: string; export declare function renderTelemetryNotice(config: TelemetryConfigV1, output?: NodeJS.WriteStream, inputStream?: NodeJS.ReadStream): Promise; export declare function currentTelemetrySessionId(): string; export declare function ensureTelemetryInstallId(config: TelemetryConfigV1): Promise; export type ProductEventName = "install_initialized" | "run_started" | "run_completed" | "run_failed" | "telemetry_changed" | "control_plane_connected" | "remote_experience_clicked"; export interface ProductEventEnvelopeV1 { eventId: string; schemaVersion: 1; installId: string; sessionId: string; event: ProductEventName; cliVersion: string; nodeVersion: string; platform: NodeJS.Platform; arch: string; emittedAt: string; payload: Readonly>; } export declare function assertAllowedTelemetryPayload(event: ProductEventName, payload: Readonly>): void; export declare function resolveProductEventsEndpoint(env?: NodeJS.ProcessEnv): string; export declare function sendProductEvent(input: { endpoint: string; config: TelemetryConfigV1; event: ProductEventName; payload: Readonly>; cliVersion: string; fetchImpl?: typeof fetch; env?: NodeJS.ProcessEnv; timeoutMs?: number; }): Promise; export declare function initializeTelemetryIfNeeded(input: { config: TelemetryConfigV1; endpoint: string; cliVersion: string; }): Promise; export type TelemetryFailureReason = "provider_unavailable" | "verification_failed" | "budget_exit" | "policy_blocked" | "persistence_failed" | "unknown"; export declare function toTelemetryFailureReason(reasonCode: string | undefined): TelemetryFailureReason; export declare function executeTelemetryCommand(action: "status" | "explain" | "on" | "off"): Promise;