import type { StorageClient } from "../storage/client.js"; export interface IndexedSearchResult { name: string; title: string; summary: string; updated: string; matchedOn: string[]; /** * Set to "or" when this result came from the OR-token fallback (AND query * found nothing) rather than a real AND match — callers can use this to * distinguish weak fallback matches from confident hits. */ fallback?: "or"; /** * Relevance signal for the calling LLM to judge results by (GH #614): * matching fragment (matched terms bold-marked) and a weighted score based * on which fields matched. Always populated on this (SQLite) and the * plain Postgres backend — never omitted, even when the match is * title/summary only rather than body content. Exception: the Postgres * hybrid path (`HybridSearchResult`, postgresIndex.ts) populates `score` * but not `snippet` — the `search_pages_hybrid` RPC doesn't return page * content, so there's nothing to build a snippet from without a migration. */ snippet?: string; score?: number; } export interface SearchIndexSyncStats { indexedFiles: number; changedFiles: number; deletedFiles: number; skipped: boolean; durationMs: number; } export interface IndexedSearchResponse { results: IndexedSearchResult[]; totalMatches: number; candidateCount: number; queryMs: number; } interface SearchQueryInput { query: string; tag?: string; maxCandidates: number; maxResults: number; } export declare function getSqliteSearchIndex(storageLocation: string): SqliteSearchIndex; export declare class SqliteSearchIndex { private readonly db; private readonly selectExistingStmt; private readonly deletePageStmt; private readonly upsertPageStmt; private readonly selectSearchRowsStmt; private readonly countIndexedStmt; private lastSyncAt; private readonly minSyncIntervalMs; private syncInFlight; constructor(storageLocation: string); ensureSynced(drive: StorageClient): Promise; startBackgroundSync(drive: StorageClient): void; /** * Force a sync regardless of the throttle window. Used by the filesystem * watcher, where an event already proves the on-disk state changed, so the * minSyncIntervalMs debounce would only delay reconciliation. Still dedupes * against an in-flight sync so concurrent events collapse into one pass. */ syncNow(drive: StorageClient): Promise; private performSync; search(input: SearchQueryInput): IndexedSearchResponse; private resolveDbPath; private initializeSchema; private countIndexedFiles; } /** Lowercase, strip punctuation, split into tokens — matches postgresIndex.ts's tokenizeQuery. */ export declare function tokenizeQuery(query: string): string[]; /** Drop stopwords — but never return empty (keep originals if all were stopwords). */ export declare function stripStopwords(tokens: string[]): string[]; export {}; //# sourceMappingURL=sqliteIndex.d.ts.map