/** * Multilingual sentence encoder — the one optional, local model (no model API). * * Pure-TS SGNS hit a wall on the Korean long tail (프리다/후킹 are too rare to * learn from this corpus alone). A pretrained multilingual encoder brings * EXTERNAL knowledge — it already knows 후킹 ≈ hooking — so cross-lingual * retrieval works at the sentence level without any per-corpus training. * * It runs entirely on-device via transformers.js (onnxruntime under the hood): * zero model API calls, zero cloud account. The dependency is an OPTIONAL peer — it is lazy-imported * here, so the core framework still installs and runs without it; only the dense * encoder paths require it. Model weights download once to ~/.nexus/models/hf. */ /** Small, strong multilingual sentence-embedding model (384-dim, good Korean). */ export declare const ENCODER_MODEL = "Xenova/paraphrase-multilingual-MiniLM-L12-v2"; export declare const ENCODER_DIM = 384; export declare function isEncoderInstalled(): boolean; /** Lazily load the feature-extraction pipeline (downloads the model on first use). */ export declare function getEncoder(dataDir: string): Promise; /** * Embed texts into L2-normalized sentence vectors (mean-pooled). Returns a flat * row-major N×dim Float32Array. Batched to bound memory. */ export declare function embedTexts(dataDir: string, texts: string[], batchSize?: number, onProgress?: (done: number, total: number) => void): Promise<{ vectors: Float32Array; dim: number; }>; /** Embed a single text → its sentence vector. */ export declare function embedOne(dataDir: string, text: string): Promise;