/** * Rate-limit notifier — ADR-312 Phase 0 out-of-band signal path. * * Structural mirror of credit-notifier.ts. This is NOT automatic detection * — ADR-312 established that Claude Code does not currently expose any way * to detect its own usage-limit state from outside its process (verified * against the actual installed CLI source, not assumed). This module is the * MANUAL, self-reported alternative: the user tells ruflo they've hit a * limit, ruflo remembers it, and the funnel promo row can react. * * State is cheap and durable: * ~/.ruflo/rate-limit-status.json = { limited: bool, since: ISO, cleared: ISO|null } * * A TTL (default 6h) auto-expires a forgotten flag so a stale manual mark * doesn't linger indefinitely if the user forgets to clear it — Claude * usage limits reset on hours-to-days cadences (five_hour / seven_day per * ADR-312's grounded research), so 6h is a reasonable "the user probably * forgot to clear this" bound without requiring per-type precision we * don't have. */ export declare const RATE_LIMIT_STATUS_FILE = "rate-limit-status.json"; /** Auto-expire a forgotten manual flag after 6h (see module doc). */ export declare const RATE_LIMIT_TTL_MS: number; export interface RateLimitStatus { limited: boolean; since: string | null; cleared: string | null; /** ADR-314 §D1 — last time `limited` actually changed value; gates the toggle cooldown. */ lastToggleAt: string | null; } /** Read the current rate-limit status. Never throws. Applies the TTL. */ export declare function readRateLimitStatus(now?: Date): RateLimitStatus; /** * Mark as rate-limited — idempotent. Sets `since` on the first mark, leaves * it alone on subsequent marks so the user sees a stable "since" timestamp * until they clear it or the TTL expires. Refuses to flip false→true inside * the ADR-314 §D1 cooldown window (returns false; a no-op re-mark of an * already-true flag is unaffected — that's not a state change). */ export declare function markRateLimited(now?: Date): boolean; /** * Clear rate-limited status. Called via `ruflo settings notices * rate-limited --clear`, automatically by the TTL, or once a real Phase 1/2 * signal (ADR-312) confirms the limit has reset. Refuses to flip true→false * inside the cooldown window (returns false); clearing an already-clear * flag is always allowed (not a state change, and TTL auto-clear must never * be blocked by a cooldown it didn't itself trigger). */ export declare function clearRateLimitStatus(now?: Date): boolean; /** * User-facing single-line summary — plain text, no ANSI. Callers style it * themselves. Returns null when not rate-limited (no surface). */ export declare function rateLimitNotice(now?: Date): string | null; //# sourceMappingURL=rate-limit-notifier.d.ts.map