/** * Anonymized telemetry for the vlt CLI. * * - Sends anonymous, non-PII events to PostHog. * - Generates a random UUID on first run, stored in XDG data dir. * - Respects opt-out via `DO_NOT_TRACK=1`, `VLT_TELEMETRY=0`, * or the `--telemetry=false` config flag. * - Flush is awaited with a timeout cap so it never blocks CLI exit for long. * - Fails silently on any network or runtime error. * @module */ /** * Check whether telemetry is disabled via environment variables. * * - `DO_NOT_TRACK=1` — https://consoledonottrack.com/ * - `VLT_TELEMETRY=0` */ export declare const isOptedOut: () => boolean; export interface CommandEvent { command: string; duration_ms: number; success: boolean; node_version: string; vlt_version: string; os: string; arch: string; ci: boolean; } export interface InstallEvent { dependency_count: number; duration_ms: number; } export interface ErrorEvent { command: string; error_code?: string; } /** * Capture a `cli_command` event. */ export declare const trackCommand: (ev: CommandEvent, telemetryFlag?: boolean) => void; /** * Capture a `cli_install` event. */ export declare const trackInstall: (ev: InstallEvent, telemetryFlag?: boolean) => void; /** * Capture a `cli_error` event. */ export declare const trackError: (ev: ErrorEvent, telemetryFlag?: boolean) => void; /** * Flush pending events. Returns a promise that resolves once flushing * completes **or** when `SHUTDOWN_TIMEOUT_MS` elapses — whichever * comes first. Never rejects. * * The safety-net timer is unreffed so it cannot keep the process alive * on its own — if the caller does not `await` this, Node will still * exit promptly once all other handles are drained. */ export declare const flush: () => Promise;