import type { ChatMessageBase } from '../../components'; import type { ChatToolMessage, ClientSideTool, ClientSideTools, SearchToolInput } from '../../components/chat/types'; import type { RecordWithObjectID } from '../../types'; export declare const getTextContent: (message: ChatMessageBase) => string; export declare const hasTextContent: (message: ChatMessageBase) => boolean; export declare const isPartText: (part: ChatMessageBase["parts"][number]) => part is Extract; export declare const isPartTool: (part: ChatMessageBase["parts"][number]) => part is ChatToolMessage; export declare const findTool: (partType: string, tools: ClientSideTools) => ClientSideTool | undefined; /** * Extracts the `facetFilters` from a search tool input. * * The default search tool provides a ready-to-use `facet_filters` array. The * Algolia MCP Server search tool instead expresses refinements as individual * `facet_` keys (e.g. `facet_categories: ['Books', 'Toys']`), which * are converted here into the `[['attribute:value']]` shape `applyFilters` * expects. */ export declare const getFacetFiltersFromToolInput: (input: SearchToolInput | undefined) => string[][] | undefined; /** * Builds a map of `objectID` -> full record by collecting the hits from search * tool outputs across the conversation. * * The display results tool only receives object IDs from the backend, so it * relies on this map to hydrate each result with the full record that the * preceding search tool already fetched. * * Pass `untilToolCallId` (the display tool's own `toolCallId`) to scope * collection to the turn that produced it: hits are only gathered up to and * including the message that contains that tool call. This prevents a later * turn's search from overwriting an earlier display tool's records (and their * per-query metadata like `__queryID`). */ export declare const getHitsByObjectID: (messages: ChatMessageBase[], untilToolCallId?: string) => Record;