export declare const TEXT_EXTENSIONS: Set<string>;
export declare const SKIPPED_DIR_NAMES: Set<string>;
export interface RagBackend {
    /** "ollama" or "hash". Pinned in the index so a later query can't mix encoders. */
    name: string;
    /** Model id (Ollama) or pseudo-id ("feature-hash-256"). */
    model: string;
    dim: number;
}
export interface RagChunk {
    id: string;
    source: string;
    chunkNo: number;
    content: string;
    /** Quantized to int16 to keep the JSON file an order of magnitude smaller. */
    embedding: number[];
    sha1: string;
}
export interface RagIndexFile {
    version: 1;
    name: string;
    createdAt: string;
    updatedAt: string;
    backend: RagBackend;
    chunks: RagChunk[];
}
export interface RagIndexSummary {
    name: string;
    path: string;
    chunks: number;
    files: number;
    backend: string;
    model: string;
    dim: number;
    updatedAt: string;
    /** Saved picker preferences from the last build, when present. */
    prefs?: RagIndexPrefs;
}
export interface RagSearchResult {
    source: string;
    chunkNo: number;
    content: string;
    /** Cosine similarity in [0, 1]. */
    score: number;
}
export interface RagPathDiagnostic {
    /** Original input path as given by the caller. */
    input: string;
    /** Resolved absolute path. */
    resolved: string;
    /** Outcome category for the path. */
    status: 'missing' | 'outside-project' | 'unsupported-extension' | 'empty-directory' | 'matched';
    /** Whether the resolved path is a file or directory (when known). */
    kind: 'file' | 'directory' | 'none';
    /** Number of indexable text files found under this path. */
    fileCount: number;
    /** Sample of matched files (project-relative), capped to keep payloads small. */
    sampleFiles: string[];
    /** Human-readable explanation suitable for direct display. */
    message: string;
}
export interface RagBuildPreview {
    paths: RagPathDiagnostic[];
    totalFiles: number;
    supportedExtensions: string[];
    skippedDirectories: string[];
}
export interface RagIndexPrefs {
    /** Last set of paths the user picked when (re)building this index. */
    paths: string[];
    /** Backend the user explicitly chose, or undefined for auto. */
    backend?: 'ollama' | 'hash';
    updatedAt: string;
}
export declare function readIndexPrefs(projectDir: string, name: string): Promise<RagIndexPrefs | null>;
export declare function writeIndexPrefs(projectDir: string, name: string, prefs: Omit<RagIndexPrefs, 'updatedAt'>): Promise<void>;
export declare function selectBackend(host: string, prefer?: 'ollama' | 'hash'): Promise<RagBackend>;
export declare function listIndexes(projectDir: string): Promise<RagIndexSummary[]>;
export declare function previewBuild(projectDir: string, paths: string[]): Promise<RagBuildPreview>;
export interface RagBuildProgressEvent {
    stage: 'preview' | 'backend' | 'file' | 'done' | 'error';
    fileIndex?: number;
    totalFiles?: number;
    source?: string;
    chunks?: number;
    backend?: RagBackend;
    preview?: RagBuildPreview;
    files?: number;
    totalChunks?: number;
    message?: string;
}
export declare function iterateBuild(projectDir: string, name: string, paths: string[], options?: {
    backend?: 'ollama' | 'hash';
    ollamaHost: string;
    chunkChars?: number;
    overlap?: number;
}): AsyncGenerator<RagBuildProgressEvent>;
export declare function build(projectDir: string, name: string, paths: string[], options?: {
    backend?: 'ollama' | 'hash';
    ollamaHost: string;
    chunkChars?: number;
    overlap?: number;
}): Promise<{
    files: number;
    chunks: number;
    backend: RagBackend;
    preview: RagBuildPreview;
}>;
export declare function search(projectDir: string, name: string, query: string, options: {
    k?: number;
    ollamaHost: string;
}): Promise<RagSearchResult[]>;
export declare function dropIndex(projectDir: string, name: string): Promise<boolean>;
//# sourceMappingURL=ragIndex.d.ts.map