import { type CliUsageLimitState } from './cli-usage-limit.js'; /** * Per-turn usage-limit state machine. Owns the turn counter, the * "did this turn hit a limit" flag, the stale retry-ready banner suppression, * and the stickiness of authoritative STRUCTURED limits — so classify()'s * state writes are explicit method calls rather than hidden mutations of * module globals. * * Generic over the runtime status union so the worker can plug in its * RuntimeScreenStatus while tests drive it with plain strings. */ export interface UsageLimitTracker { currentTurn(): number; beginTurn(snapshot: string): number; classify(content: string, status: S): { status: S | 'limited'; usageLimit?: CliUsageLimitState; }; detectedThisTurn(seq: number): boolean; noteStructuredLimit(state: CliUsageLimitState): void; /** * A turn completed successfully (a harvested bridge final_output is being * emitted). Clears the structured-limit latch so a stale limit is not * re-emitted on the next classify(). Mirrors the daemon's final_output * self-heal (worker-pool clears ds.usageLimit on a real harvested answer): * in an adopted session the user can recover from a structured rate limit * in their own terminal without triggering beginTurn(), so without this the * latch would re-pin the card / Dashboard after the daemon already cleared. */ noteTurnCompleted(): void; } export declare function createUsageLimitTracker(opts: { isRateKindSuppressed: () => boolean; /** * Whether the CLI is demonstrably producing output (PTY activity within the * caller's freshness window). The screen-scan active-work gate only * suppresses the verdict while this returns true: a `working` status alone * does not prove output is progressing (it is the default projection * whenever promptReady === false), so a non-structured CLI blocked at a * rate-limit error screen that never renders its ready prompt would * otherwise be suppressed forever. Omit to keep the conservative * suppress-on-working behavior (used by pure unit tests). */ isOutputActive?: () => boolean; }): UsageLimitTracker; //# sourceMappingURL=usage-limit-tracker.d.ts.map