import { type LLMHistoryContextEntry, type LLMHistoryEntry, type LLMHistoryToolCallEntry, type LLMHistoryToolResultEntry, type LLMAssistanceMessage, type LLMToolResult } from '../../LLMService.typedefs'; /** * The history invariants every provider mapping relies on, established once * here instead of in each provider: a tool call is answered exactly once, a * result answers a call that was actually made, and an assistant round that * called nothing is not a tool round at all. */ export declare class LLMHistoryEntries { static isToolCall(entry: LLMHistoryEntry): entry is LLMHistoryToolCallEntry; static isToolResult(entry: LLMHistoryEntry): entry is LLMHistoryToolResultEntry; static isContext(entry: LLMHistoryEntry): entry is LLMHistoryContextEntry; static isMessage(entry: LLMHistoryEntry): entry is LLMAssistanceMessage; /** * Repairs a restored history into one every provider accepts: an empty tool * round is dropped, a result answering no preceding call is dropped, a * second result for an already-answered call is dropped, and a call left * unanswered gets `LLM_UNANSWERED_TOOL_CALL_RESULT` as a real tool result. * Order is preserved; a synthesized result lands directly after the round * that needed it. */ static normalize(entries: LLMHistoryEntry[]): LLMHistoryEntry[]; /** * Indexes the repaired history by call id, so a provider mapping emits each * call together with its result instead of walking the array twice. */ static indexResultsByCallId(entries: LLMHistoryEntry[]): Map; /** * A result answers a call only when it comes after it: a result standing * before the call it names is as unusable to a provider as one naming no * call at all, so the call still counts as unanswered. */ private static collectAnsweredCallIds; private static buildUnansweredResult; }