import type { EventType, Outcome } from "./types.js"; /** * Is telemetry enabled on this machine? * * Disabled file always wins — even if both files exist (race condition or * leftover from a corrupted disable command), we treat the user as opted out. * No network call, no other side effect. */ export declare function isEnabled(): boolean; /** * Has the first-init nudge been shown? Used by sverklo init to print a * one-line "telemetry is OFF — enable with..." message exactly once per machine. */ export declare function hasBeenNudged(): boolean; export declare function markNudged(): void; /** * Read the install-id from disk. Returns null if not opted in. * The install-id is the only stable identifier the binary ever generates. */ export declare function getInstallId(): string | null; /** * Enable telemetry: write enabled sentinel + install-id, send opt_in event. * Idempotent — calling twice on an already-enabled machine returns the existing id. */ export declare function enable(): Promise; /** * Disable telemetry: send opt_out event (best-effort), remove enabled sentinel * and install-id, write disabled sentinel. Disabled state is persistent — * the user has to explicitly call enable() again to re-opt-in. */ export declare function disable(): Promise; interface TrackOptions { tool?: string | null; outcome?: Outcome; duration_ms?: number; /** Bucketed response size: xs/s/m/l/xl. Lets us compare the impact * of compact-format defaults without recording any content. */ size_bucket?: "xs" | "s" | "m" | "l" | "xl"; } /** * Record an event. Hard short-circuits if telemetry is disabled — no fs read, * no network call, no log write. Safe to call from hot paths. * * Events are mirrored to ~/.sverklo/telemetry.log BEFORE the network call. * Network call has a hard 800ms timeout and never throws upstream. */ export declare function track(event: EventType, opts?: TrackOptions): Promise; /** * Status snapshot for `sverklo telemetry status`. Reads the local state only; * never touches the network. */ export declare function status(): { enabled: boolean; installId: string | null; endpoint: string; logPath: string; enabledPath: string; disabledPath: string; }; /** * Local log path — exposed so the CLI `telemetry log` subcommand can tail it. */ export declare const logPath: string; export {};