/** * Reading facts back out of a Codex rollout transcript. * * The headless `--json` stream carries neither the context total nor the * account's rate limits, but codex writes both into every `token_count` event of * the rollout it is already keeping on disk. That file is the only structured * source we have for either, so this module is the one place that knows how to * find a thread's rollout and walk it. */ import type { EngineResult } from "../shared/types.js"; export declare const CODEX_SESSIONS_DIR: string; export declare function forEachCodexTokenCount(sessionId: string, root: string, visit: (payload: any) => void): void; /** When codex last said its rate-limit window reopens, in Unix seconds. */ export declare function lastCodexTranscriptResetsAt(sessionId: string, root?: string): number | undefined; /** * The rate-limit reading for a failed turn, or nothing at all. * * Codex states its reset in the `rate_limits` snapshot it writes to the rollout * for every `token_count`; the error prose is the fallback for a turn that died * before one landed. When neither source names a time, `resetsAt` is left absent * so the retry machinery uses its own backoff — a made-up reset would be worse * than no reset, because it would be believed. */ export declare function codexRateLimitFor(error: string | undefined, threadId: string, sessionsDir: string): Pick; //# sourceMappingURL=codex-transcript.d.ts.map