import type { EmbedProvider } from '../providers/embed-provider.js'; /** * Ensure the fastembed model cache dir (and any missing parents) exists, then * return it. fastembed's own `retrieveModel` does a NON-recursive * `mkdirSync(cacheDir)`, so on a fresh machine where `${dataDir}` (e.g. * `~/.wigolo`) does not exist yet the download throws * `ENOENT: mkdir '...\.wigolo\fastembed'` (seen on Windows). Pre-creating the * dir recursively makes fastembed's own `existsSync` check pass and skips its * broken mkdir. */ export declare function ensureFastembedCacheDir(dataDir: string): string; /** * Remove the fastembed cache dir and recreate it empty — used to clear a * partial/corrupt model download (a leftover `.tar.gz` that fastembed will not * re-fetch) before retrying. */ export declare function resetFastembedCacheDir(dataDir: string): string; /** * True when an error looks like a truncated/corrupt model archive — the field * `TAR_BAD_ARCHIVE: Unrecognized archive format` and its decompress cousins. * These recover by wiping the partial file and re-downloading; unrelated errors * (e.g. a missing native tokenizer binary) do NOT, so they must not match. */ export declare function isCorruptArchiveError(err: unknown): boolean; /** * Run a model init; on a corrupt-archive failure ONLY, reset the cache and try * exactly once more. Any other error propagates immediately (a re-download would * not fix it). Pure over its injected `init`/`resetCache`, so the retry is tested * without touching the network or the native runtime. */ export declare function initModelWithArchiveRetry(init: () => Promise, resetCache: () => void): Promise; /** * Native ONNX embedding provider using fastembed-rs Node bindings. * * Model: BGE-small-en-v1.5 (384-dim). First call to `warmup()` downloads * the ONNX model to `${dataDir}/fastembed`. Subsequent runs reuse the cache. * Replaces the legacy sentence-transformers Python subprocess. */ export declare class FastembedEmbedProvider implements EmbedProvider { private model; private modelPromise; readonly modelId: string; readonly dim: number; constructor(); warmup(): Promise; private getModel; embed(texts: string[]): Promise; } //# sourceMappingURL=fastembed-provider.d.ts.map