import type { ChatMessageBase } from '../../components'; /** A record as a tool returned it, before any display-time annotation. */ export type ChatRecord = Record & { objectID: string; }; export type ChatRecords = Record; /** * The records the conversation holds, keyed by `objectID`: what the chat's * tools fetched plus what the shopper selected for a comparison — the shared * lookup between the tools that search and the tools handed only identifiers. */ export type ChatRecordsStore = { get: (objectID: string) => ChatRecord | undefined; has: (objectID: string) => boolean; /** The current map, not a copy — read-only, and replaced by `clear()`. */ getAll: () => ChatRecords; /** Last write wins per `objectID`; records without one are skipped. */ merge: (records: Array) => void; clear: () => void; }; export declare function createChatRecordsStore(): ChatRecordsStore; /** * Collects into `store` the records of every completed tool call in `messages` * whose output holds `hits`, plus the records a user message carries as a * comparison selection. Matching on the output rather than on a tool name * means any tool that fetches records contributes them by returning them; the * selection counts because the compare flow already hands the agent the very * records it is asked to compare, so the table can be built from them without * a search round-trip. * * Idempotent, so it can re-run over the whole conversation on every update: * streaming deltas and a conversation restored from storage are one code path. * Later messages win per `objectID`, so a record the agent re-fetched after the * selection replaces the selected copy. */ export declare function collectChatRecords(messages: ChatMessageBase[] | undefined, store?: ChatRecordsStore): ChatRecordsStore;