/** Provider slug this reading is attributed to; matches the gateway route and profile provider. */ export declare const CODEX_PROVIDER = "openai-codex"; export interface QuotaWindow { /** `seven_day` / `five_hour`, else `window_m` for a length Codex has not used before. */ type: string; /** Fraction in [0,1] — Codex reports whole percents, the throttle compares against 0.95. */ utilization: number; /** Epoch seconds, matching the persisted provider-state shape. */ resetsAt: number; } export interface CodexQuotaReading { provider: typeof CODEX_PROVIDER; planType: string | null; windows: QuotaWindow[]; } export interface ParseQuotaOpts { /** Injected clock: reset-after-seconds is relative, so the caller pins the reference point. */ nowMs: number; } /** * Extract the quota state Codex broadcasts on every response. Returns null when the response * carries no usable window — a non-Codex response, a fully disabled bucket, or a malformed * reading. Null means "learned nothing", never "quota is fine". */ export declare function parseCodexQuotaHeaders(headers: Record, opts: ParseQuotaOpts): CodexQuotaReading | null; export declare function encodeQuotaNotice(reading: CodexQuotaReading): string; /** Returns null for anything that is not a well-formed quota notice — an ordinary notification, * a truncated payload, or a reading with no window. Callers treat null as "not for us". */ export declare function decodeQuotaNotice(message: unknown): CodexQuotaReading | null;