/** * @module memory/tool-call-store * @description Store for recording and searching tool call history. * * All methods are synchronous (better-sqlite3 is synchronous). FTS5 search * returns relevance-ranked results using the inverted index. */ import type { ToolCallRecord, ToolCallOutcome, MemorySearchResult, MemoryQueryOptions } from './types.js'; /** * @name ToolCallStore * @description Records and queries tool call execution history. * * Every tool call (paid or free) is recorded with its input, output, outcome, * cost, and latency. The FTS5 index enables full-text search across all * recorded calls for pattern detection and failure analysis. */ export declare class ToolCallStore { /** * @name record * @description Records a tool call execution in the memory database. * @param record - Tool call data to record. * @returns The auto-incremented ID of the inserted record, or -1 if degraded. */ record(record: Omit): number; /** * @name search * @description Full-text search across tool call history using FTS5. * @param options - Search options including query, filters, and pagination. * @returns Search results with relevance ranking. */ search(options: MemoryQueryOptions): MemorySearchResult; /** * @name count * @description Returns the total number of tool call records. */ count(): number; /** * @name outcomeBreakdown * @description Returns counts grouped by outcome. */ outcomeBreakdown(): Record; /** * @name lastToolCallAt * @description Returns the timestamp of the most recent tool call. */ lastToolCallAt(): string | null; /** * @name archive * @description Archives tool call records older than the retention period. * @param retentionDays - Number of days to keep records. Default 90. * @returns Number of records archived. */ archive(retentionDays?: number): number; /** * @name buildFtsQuery * @description Converts a natural language query into a FTS5 MATCH expression. * Handles multi-word queries by quoting phrases and prefixing with OR for * broader recall. * @internal */ private buildFtsQuery; } /** * @name toolCallStore * @description Singleton instance of the tool call store. */ export declare const toolCallStore: ToolCallStore; //# sourceMappingURL=tool-call-store.d.ts.map