/**
 * KiroGraph Typesense Index
 *
 * ANN vector search backed by Typesense running in embedded mode.
 * The engine downloads the Typesense binary on first use (cached at
 * ~/.kirograph/bin/), then spawns it as a managed child process persisting
 * data to .kirograph/typesense/.
 *
 * Opt-in: set config.semanticEngine = 'typesense'
 * Required optional dependency (not installed by default):
 *   npm install typesense
 *
 * Key characteristics:
 *   - HNSW ANN vector search with cosine distance
 *   - Binary auto-downloaded on first use (~37MB, cached globally)
 *   - No separate server setup required
 *   - Async startup check via /health
 *   - Node IDs used directly as Typesense document IDs (colon sanitised)
 */
import type { Node } from '../types';
export declare class TypesenseIndex {
    private readonly kirographDir;
    private readonly dim;
    private client;
    private child;
    private _available;
    private _ownedProcess;
    private _failReason;
    private storagePath;
    private stateFile;
    constructor(kirographDir: string, dim?: number);
    private readState;
    private writeState;
    private clearState;
    private isProcessAlive;
    isAvailable(): boolean;
    getFailReason(): string | null;
    /**
     * Download the Typesense binary if needed, spawn it with a project-scoped
     * data directory, wait until /health responds, then ensure the collection
     * exists. Silent no-op when `typesense` npm package is not installed.
     */
    initialize(): Promise<void>;
    private ensureCollection;
    /**
     * Insert or update a node's embedding. Typesense's upsert overwrites the
     * document if the `id` already exists.
     */
    upsert(node: Node, embedding: Float32Array): Promise<void>;
    /**
     * Bulk upsert a batch of nodes. Uses Typesense's import endpoint (single
     * HTTP request per batch) to avoid connection churn on large codebases.
     */
    bulkUpsert(nodes: Node[], embeddings: Float32Array[]): Promise<void>;
    /**
     * Remove a document from the collection.
     */
    delete(nodeId: string): Promise<void>;
    /**
     * ANN vector search. Returns node IDs ordered by cosine similarity (descending).
     */
    search(queryVec: Float32Array, topN?: number): Promise<string[]>;
    /**
     * Return all node IDs currently stored in the collection via paginated export.
     */
    getEmbeddedNodeIds(): Promise<string[]>;
    /** Number of documents currently in the collection. */
    count(): Promise<number>;
    /**
     * Disconnect the client. The Typesense server keeps running as a background
     * daemon so the next command can reconnect instantly via the state file.
     */
    close(): void;
}
//# sourceMappingURL=typesense-index.d.ts.map