import type { CodeSymbol, SearchResult } from "../types.js";
/**
 * `mode` lets local instruction-tuned models (Nomic, E5) prepend the right task
 * prefix. Remote APIs (Voyage/OpenAI/Ollama) accept the parameter and ignore it.
 */
export type EmbeddingMode = "document" | "query";
export interface EmbeddingProvider {
    embed(texts: string[], mode?: EmbeddingMode): Promise<number[][]>;
    readonly dimensions: number;
    readonly model: string;
}
/**
 * Build a searchable text string from a symbol for embedding.
 * Format: "{kind} {name}\n{signature}\n{docstring first line}\n{body first N chars}"
 */
export declare function buildSymbolText(symbol: CodeSymbol): string;
export declare function cosineSimilarity(a: Float32Array, b: Float32Array): number;
/**
 * Search embeddings by cosine similarity (linear scan).
 * Returns top-k results sorted by similarity descending.
 */
export declare function searchSemantic(queryEmbedding: Float32Array, embeddings: Map<string, Float32Array>, symbols: Map<string, CodeSymbol>, topK: number): SearchResult[];
export declare class VoyageProvider implements EmbeddingProvider {
    readonly model = "voyage-code-3";
    readonly dimensions = 1024;
    private apiKey;
    constructor(apiKey: string);
    embed(texts: string[], mode?: EmbeddingMode): Promise<number[][]>;
}
export declare class OpenAIProvider implements EmbeddingProvider {
    readonly model = "text-embedding-3-small";
    readonly dimensions = 1536;
    private apiKey;
    constructor(apiKey: string);
    embed(texts: string[], _mode?: EmbeddingMode): Promise<number[][]>;
}
export declare class OllamaProvider implements EmbeddingProvider {
    readonly model = "nomic-embed-text";
    readonly dimensions = 768;
    private baseUrl;
    constructor(baseUrl: string);
    embed(texts: string[], _mode?: EmbeddingMode): Promise<number[][]>;
}
/** Exported for unit tests. Returns "" when the model needs no task prefix. */
export declare function getPrefix(model: string, mode: EmbeddingMode): string;
export declare class LocalProvider implements EmbeddingProvider {
    readonly model: string;
    readonly dimensions: number;
    constructor(model?: string, dimensions?: number);
    embed(texts: string[], mode?: EmbeddingMode): Promise<number[][]>;
}
/** Reset local pipeline caches — for testing only. */
export declare function _resetLocalProvider(): void;
export declare function createEmbeddingProvider(provider: "voyage" | "openai" | "ollama" | "local", config: {
    voyageApiKey?: string | null;
    openaiApiKey?: string | null;
    ollamaUrl?: string | null;
    localModel?: string | null;
}): EmbeddingProvider;
//# sourceMappingURL=semantic.d.ts.map