interface TurnEntry { id: string; ts: number; threadId: string | null; role: 'user' | 'assistant'; text: string; /** Short summary of tools fired during this turn (assistant only) */ tools?: string; } /** Append a turn to the log. Fire-and-forget safe; idempotent on duplicate id. */ declare function appendTurn(entry: Omit & Partial>): Promise; /** Read recent turns, optionally filtered by thread or limit. */ declare function readTurns(opts?: { limit?: number; threadId?: string | null; since?: number; }): Promise; /** Synchronous read from cache (for system-prompt hot path). Returns [] if not yet loaded. */ declare function readTurnsSync(limit?: number): TurnEntry[]; /** Force-load cache (call once on app boot so readTurnsSync works on first render). */ declare function primeTurnLog(): Promise; /** Format turns as a continuous flow for system-prompt injection. */ declare function formatTurnsForPrompt(turns: TurnEntry[], opts?: { maxChars?: number; activeThreadId?: string | null; }): string; /** Clear the log (exposed for /clear slash-command integration). */ declare function clearTurnLog(): Promise; /** Stats for debugging. */ declare function turnLogStats(): Promise<{ count: number; oldestTs: number | null; newestTs: number | null; threads: string[]; }>; export { type TurnEntry, appendTurn, clearTurnLog, formatTurnsForPrompt, primeTurnLog, readTurns, readTurnsSync, turnLogStats };