/**
 * NomicEmbeddingClient - TypeScript bridge to python/embedding_worker.py (Daemon Mode)
 *
 * Spawns python/embedding_worker.py in daemon mode (--daemon).
 * Model is loaded ONCE on first use and reused across all documents.
 * Call destroy() after batch processing to free GPU VRAM.
 *
 * CP-004: Local GPU inference ONLY - throws EmbeddingError on GPU unavailable.
 * NO cloud fallback, NO CPU fallback. FAIL FAST with robust error logging.
 *
 * @module services/embedding/nomic
 */
type EmbeddingErrorCode = 'GPU_NOT_AVAILABLE' | 'EMBEDDING_FAILED' | 'PARSE_ERROR' | 'WORKER_ERROR' | 'MODEL_NOT_FOUND';
export declare class EmbeddingError extends Error {
    readonly code: EmbeddingErrorCode;
    readonly details?: Record<string, unknown> | undefined;
    constructor(message: string, code: EmbeddingErrorCode, details?: Record<string, unknown> | undefined);
}
export declare const EMBEDDING_DIM = 768;
export declare const MODEL_NAME = "nomic-embed-text-v1.5";
export declare const MODEL_VERSION = "1.5.0";
export declare const DEFAULT_BATCH_SIZE = 64;
/** Kill all active embedding worker processes. */
export declare function killAllEmbeddingWorkers(): void;
export declare class NomicEmbeddingClient {
    private readonly workerPath;
    private readonly pythonPath;
    /** Daemon process state */
    private _daemonProcess;
    private _daemonReadline;
    private _daemonReady;
    private _daemonStarting;
    private _pendingResolve;
    private _pendingReject;
    /** Simple promise-based lock for serial access to daemon */
    private _lockPromise;
    private _lastDevice;
    constructor(options?: {
        workerPath?: string;
        pythonPath?: string;
    });
    /**
     * Maximum chunks per daemon request to prevent memory issues.
     */
    private static readonly MAX_CHUNKS_PER_CALL;
    private getEffectiveBatchSize;
    private getEffectiveDevice;
    /** Acquire exclusive access to the daemon for one request. */
    private withLock;
    /** Ensure daemon is running and ready. Spawns on first call, restarts on crash. */
    private ensureDaemon;
    /** Spawn the Python daemon process and wait for the ready signal. */
    private _spawnDaemon;
    /** Send a JSON request to daemon and wait for JSON response. */
    private sendRequest;
    private _cleanupDaemon;
    embedChunks(chunks: string[], batchSize?: number): Promise<Float32Array[]>;
    private embedChunksInBatches;
    private embedChunksSingle;
    getLastDevice(): string;
    embedQuery(query: string): Promise<Float32Array>;
    /**
     * Destroy the daemon process, freeing GPU VRAM.
     * Call this after batch processing is complete.
     */
    destroy(): void;
    /**
     * Async destroy — waits for daemon to acknowledge shutdown and free VRAM.
     * Use this when loading another GPU model after embedding.
     */
    destroyAndWait(timeoutMs?: number): Promise<void>;
    private classifyError;
}
export declare function getEmbeddingClient(): NomicEmbeddingClient;
export {};
//# sourceMappingURL=nomic.d.ts.map