/** * Main search API. * * Orchestrates: check/build index → compute all 6 metrics → classify query * → duplicate columns → POEM rank → assemble results. */ import type { IndexProgressCallback, SearchResult } from "./types.js"; export interface SearchOptions { /** Maximum number of results to return. Default: 20. */ limit?: number; /** Restrict search to files under this path (relative to project root). */ pathFilter?: string; /** Progress callback for indexing operations. */ onProgress?: IndexProgressCallback; } export interface SearchEngineOptions { /** Absolute path to the index database directory. Default: `/.search-index` */ indexDir?: string; /** Absolute path to a global memory directory to include in the index. */ globalMemoryDir?: string; /** Absolute path to the model cache directory. Default: `~/.cache/semantic-search/models` */ modelCacheDir?: string; /** Provider of additional directories to include in scans (bypasses gitignore). */ visibleDirs?: (projectRoot: string) => string[]; } export declare class SearchEngine { private readonly projectRoot; private readonly options; private indexManager; private embedderPromise; private searchQueue; constructor(projectRoot: string, options?: SearchEngineOptions); /** Check if semantic search is available (requires node:sqlite). */ static isAvailable(): boolean; /** * Search the codebase with a natural language or identifier query. * * On first call, builds the index (scans, chunks, embeds). Subsequent calls * incrementally update changed files before searching. */ search(query: string, options?: SearchOptions): Promise; /** Get index stats without opening a new connection. */ getStats(): { files: number; chunks: number; } | null; /** * Reset the search index — delete the DB and close the IndexManager. * * Preserves the embedder (expensive ONNX model, unrelated to index state). * The next `search()` call will lazily re-create the IndexManager and build * a fresh index from scratch. */ resetIndex(): Promise; /** Dispose resources. */ close(): Promise; private enqueue; private getIndexManager; private getIndexConfig; private getOrCreateEmbedder; private computeVectorScores; } //# sourceMappingURL=search.d.ts.map