/**
 * @fileoverview Pure parsing + formatting of Claude Code statusline telemetry.
 *
 * Claude Code (v2.1.80+) pipes a JSON blob to a configured `statusLine.command`
 * on each render. On Pro/Max subscriptions that blob carries a `rate_limits`
 * object with the 5-hour rolling and 7-day weekly plan windows. The
 * Codeman-managed statusLine exporter (see `hooks-config.generateStatusLineCommand`)
 * POSTs that blob to `/api/status-telemetry`; these helpers normalize the subset
 * Codeman displays and format the compact in-terminal footer string.
 *
 * Confirmed schema (empirically captured, CC 2.1.177, Claude Max — see
 * `docs/usage-limits-display-plan.md`):
 *   rate_limits.{five_hour,seven_day}.{used_percentage: number 0-100,
 *                                      resets_at: number EPOCH-SECONDS}
 * Only those two windows exist (no Opus-weekly field). `rate_limits` is absent
 * before the first API response and for non-subscriber auth — both yield null.
 *
 * All functions are pure for testability. See `test/usage-telemetry.test.ts`.
 *
 * @module usage-telemetry
 */
/** A single normalized plan-usage window. */
export interface UsageWindow {
    /** Percent of the window consumed, 0–100. */
    usedPercentage: number;
    /** Epoch MILLISECONDS when the window resets (statusline reports seconds). */
    resetAt: number;
}
/** Normalized telemetry Codeman broadcasts to the UI. */
export interface StatusTelemetry {
    fiveHour?: UsageWindow;
    sevenDay?: UsageWindow;
    /** Context-window percent used, 0–100 (bonus field from the same payload). */
    contextUsedPercentage?: number;
    /** Session cost in USD (bonus field). */
    costUsd?: number;
    /** Model display name, e.g. "Opus 4.8 (1M context)" (bonus field). */
    modelDisplayName?: string;
}
/** Raw subset of the statusline stdin JSON (snake_case, as Claude emits it). */
export interface RawStatuslinePayload {
    rate_limits?: {
        five_hour?: {
            used_percentage?: number;
            resets_at?: number;
        };
        seven_day?: {
            used_percentage?: number;
            resets_at?: number;
        };
    };
    context_window?: {
        used_percentage?: number;
        total_input_tokens?: number;
        total_output_tokens?: number;
    };
    cost?: {
        total_cost_usd?: number;
    };
    model?: {
        display_name?: string;
    };
}
/**
 * Normalize a raw statusline payload to the telemetry Codeman displays. Returns
 * null when there is no plan-limit data to show (pre-first-response or a
 * non-subscriber account) so the caller can skip broadcasting.
 */
export declare function parseStatusTelemetry(data: RawStatuslinePayload | undefined): StatusTelemetry | null;
/**
 * Current-session status for the in-terminal statusline footer. This is the
 * "status of the current session" the user sees in Claude's footer — distinct
 * from the account-wide plan limits, which live ONLY in the Codeman header chip.
 */
export interface SessionStatus {
    modelDisplayName?: string;
    inputTokens?: number;
    outputTokens?: number;
    contextUsedPercentage?: number;
}
/** Extract current-session status (footer) from the raw payload. */
export declare function parseSessionStatus(data: RawStatuslinePayload | undefined): SessionStatus | null;
/**
 * Format the in-terminal statusline footer: the CURRENT SESSION's status —
 * `Opus 4.8 (1M context)  in:562,411 out:1,188  ctx:56%` — NOT the plan limits,
 * which live in the Codeman header chip. Claude requires a statusLine command to
 * emit the rate_limits JSON at all, so this is what that command prints back.
 */
export declare function formatSessionStatusText(s: SessionStatus | null): string;
/**
 * Stable signature for change-detection — the statusline fires on every
 * assistant message, so the route only rebroadcasts when this value changes.
 *
 * Keys on EXACTLY the values the header chip displays: the two windows' ROUNDED
 * percentages (the chip renders `Math.round`) + their reset times. Deliberately
 * excludes contextUsedPercentage / costUsd / modelDisplayName — none are shown
 * in the chip, and contextUsedPercentage in particular drifts on every assistant
 * message, which would defeat the dedup and fan out a redundant SSE broadcast +
 * localStorage write + identical chip re-render each time.
 */
export declare function telemetrySignature(t: StatusTelemetry): string;
//# sourceMappingURL=usage-telemetry.d.ts.map