/** * Opt-in download of the semantic-routing embedding model. * * The semantic router (`routing/embedder.ts`) needs the weights of * Snowflake/snowflake-arctic-embed-xs (~88 MB) cached on disk by * `@huggingface/transformers`. On a fresh install they are absent, so the * router silently falls back to keyword + hash routing. Nothing may download * them implicitly — this module exists so `monomind init` can ASK first, and * so users can fetch the model later via `monomind download-embeddings` (or * `scripts/download-embedding-model.mjs` on a source checkout). * * Kept dependency-light and free of CLI I/O so it is unit-testable: the * prompt/TTY decisions live in `embeddingDownloadDecision()`, the actual * download in `downloadEmbeddingModel()`. */ /** HuggingFace model id — kept in sync with `routing/embedder.ts`. */ export declare const EMBEDDING_MODEL_ID = "Snowflake/snowflake-arctic-embed-xs"; /** Approximate download size, used only for prompt/UX copy. */ export declare const EMBEDDING_MODEL_SIZE_LABEL = "~88 MB"; /** * Locate the cache directory `@huggingface/transformers` writes model weights * into (`/.cache`), or null when the optionalDependency is not * installed. Resolution mirrors the guard in * `__tests__/route-layer-source-worker.test.ts`. */ export declare function findTransformersCacheDir(): string | null; /** True when the embedding model weights are already cached on disk. */ export declare function isEmbeddingModelCached(): boolean; export type EmbeddingDownloadReason = 'already-cached' | 'non-interactive' | 'prompt'; /** * Pure decision for the init-time download prompt, kept separate from I/O so * tests can drive it with stubbed TTY/CI values. */ export declare function embeddingDownloadDecision(input: { cached: boolean; stdinTTY: boolean; stdoutTTY: boolean; ci: boolean; }): EmbeddingDownloadReason; /** * Download the embedding model by loading the feature-extraction pipeline * once, which populates the transformers.js cache. Progress is reported via * the optional `onProgress` callback (human-readable lines). * * Throws when `@huggingface/transformers` is not installed or the download * fails — callers decide how to present that. */ export declare function downloadEmbeddingModel(onProgress?: (line: string) => void): Promise; //# sourceMappingURL=model-download.d.ts.map