/** * Leaper Agent – Session Search Tool * Search across conversation history with fuzzy matching and relevance scoring. */ import type { ToolDefinition } from './registry.js'; export interface SessionRecord { session_id: string; title?: string; summary?: string; created_at: string; updated_at: string; message_count: number; tags?: string[]; } export interface SearchHit { session_id: string; title?: string; snippet: string; score: number; created_at: string; } export interface SessionSearchOptions { query: string; limit?: number; offset?: number; date_from?: string; date_to?: string; recent_only?: boolean; } export interface SessionSearchResult { success: boolean; hits?: SearchHit[]; total?: number; query?: string; error?: string; } export interface SessionBackend { search(query: string, limit: number): SessionRecord[]; getRecent(limit: number): SessionRecord[]; } export declare function setSessionBackend(backend: SessionBackend): void; export declare function getSessionBackend(): SessionBackend; export declare function extractSnippet(text: string, query: string, maxLen?: number): string; export declare function scoreHit(record: SessionRecord, query: string): number; export declare function searchSessions(opts: SessionSearchOptions): SessionSearchResult; export declare const sessionSearchTool: ToolDefinition; //# sourceMappingURL=session-search.d.ts.map