export interface ContextCallRecord { ts: number; role: string; /** The session key: a task id under task scope, `_role` for a role-wide session. */ task_key: string; /** The SDK session id, when the runner has reported one yet. */ session_id?: string; /** This session resumed an earlier SDK session. */ resumed: boolean; /** 0 for the first model call of the session. */ call_index: number; /** Milliseconds since the session started. */ session_age_ms: number; /** The first call of its session: its cache split is the session's prefix cost. */ first_call: boolean; /** A subagent's call rather than the role's own. */ parent: boolean; response_id?: string; /** Everything the model read: uncached input plus cache reads plus cache writes. */ context_tokens: number; input: number; cache_read: number; cache_creation: number; /** Output tokens as first reported; early messages of a response can carry a placeholder. */ output: number; /** cache_read / context_tokens. */ cache_hit_ratio: number; } export declare const contextLogPath: (runDir: string) => string; /** Append one record. Never throws. */ export declare function appendContextCall(runDir: string, rec: ContextCallRecord): void; /** The records of a run, oldest first; a missing or partly written file reads as what it holds. */ export declare function readContextLog(runDir: string): ContextCallRecord[]; export interface RoleContextSummary { role: string; calls: number; /** Session starts: the number of first calls. */ sessions: number; max_context_tokens: number; mean_context_tokens: number; /** cache_read / context over all calls. */ cache_hit_ratio: number; /** Prefix cache tokens read and written on session-start calls. */ start_cache_read_tokens: number; start_cache_write_tokens: number; /** write / (write + read) over session starts; null with no starts or no cache tokens. */ start_write_share: number | null; } /** Per-role figures, in order of first appearance. */ export declare function summarizeContextLog(records: ContextCallRecord[]): RoleContextSummary[]; //# sourceMappingURL=context-log.d.ts.map