/**
 * Embedder implementations for the semantic search subsystem.
 *
 * Exports:
 *   - `NomicEmbedder` — production embedder backed by
 *     `nomic-ai/nomic-embed-text-v1.5` via `@huggingface/transformers`
 *     (ONNX runtime, Apache-2.0). Lazy model load; offline-first once
 *     cached under `.bobbit/state/models/`.
 *   - `createFakeEmbedder()` — deterministic, hash-based 768-dim embedder
 *     for tests. No downloads, no dependencies.
 *
 * Design reference: docs/design/semantic-search.md §3 (interface),
 * §4 (dependencies), §6 (tokenizer reuse), §11 (graceful degradation),
 * Appendix A (prefix convention).
 */
import type { Embedder } from "./types.js";
export declare const NOMIC_EMBEDDER_ID = "nomic-embed-text-v1.5";
export declare const NOMIC_DIM = 768;
/**
 * Thrown when the embedding model cannot be loaded — either the download
 * failed (offline, firewall) or the cached files are corrupt. The caller
 * (`SearchService`) maps this to `index:error { recoverable: true }`.
 */
export declare class EmbedderLoadError extends Error {
    readonly recoverable: boolean;
    constructor(message: string, opts?: {
        cause?: unknown;
        recoverable?: boolean;
    });
}
export interface NomicEmbedderOptions {
    /**
     * Directory under which `@huggingface/transformers` caches ONNX
     * model + tokenizer files. Shared across projects to avoid repeat
     * downloads. Typically `<root>/.bobbit/state/models`.
     */
    modelCacheDir?: string;
    /**
     * When true, never reach out to the network. Defaults to false on
     * first load; the embedder will flip this to true after a successful
     * load so subsequent opens are fully offline.
     */
    offline?: boolean;
    /** Override the pinned model revision (tests / future migrations). */
    modelRevision?: string;
}
export declare class NomicEmbedder implements Embedder {
    readonly id = "nomic-embed-text-v1.5";
    readonly dim = 768;
    private readonly options;
    private loaded;
    /** Shared across concurrent `ready()` callers to coalesce downloads. */
    private loadPromise;
    constructor(options?: NomicEmbedderOptions);
    ready(): Promise<void>;
    embed(texts: string[], kind: "document" | "query"): Promise<Float32Array[]>;
    countTokens(text: string): number;
    private load;
    private doLoad;
}
export interface FakeEmbedder extends Embedder {
    /** Records every batch embedded, for assertions in tests. */
    readonly calls: Array<{
        kind: "document" | "query";
        texts: string[];
    }>;
}
/**
 * Deterministic 768-dim embedder: hashes `(kind, text)` into a seed,
 * expands it with a cheap PRNG, then L2-normalizes. Outputs are stable
 * across processes and machines — perfect for fixture tests.
 *
 * `kind` is folded into the hash so "document" and "query" for the same
 * text yield different vectors (matches the real nomic prefix behaviour
 * and lets tests verify the kind is threaded through).
 */
export declare function createFakeEmbedder(opts?: {
    id?: string;
    dim?: number;
}): FakeEmbedder;
//# sourceMappingURL=embedder.d.ts.map