import { type OnnxDType } from '../providers/embed/onnx.js'; export interface ModelFetchPlanFile { /** Snapshot-relative file (posix separators — doubles as the URL tail). */ file: string; url: string; dest: string; } export interface ModelFetchPlan { modelLabel: string; hfRepo: string; revision: string; dtype: OnnxDType; snapshotDir: string; files: ModelFetchPlanFile[]; } export interface ModelFetchPlanOpts { /** Registry label (NOT the HF repo id). Defaults to config.embedding.model * when that names a registered ONNX model, else DEFAULT_MODEL_LABEL. */ model?: string; /** Unvalidated CLI input — checked against VALID_DTYPES here (loud throw * on a typo like `--dtype q4`; an unknown key would otherwise flow into * DTYPE_FILE_SUFFIX and silently build a `model undefined.onnx` URL). */ dtype?: string; /** Cache ROOT override (snapshot lands at ///). */ dest?: string; /** From config: embedding.model / onnxEmbed overrides / resolved cache dir. */ configModel?: string; configDtype?: OnnxDType; configRevision?: string; /** config.onnxEmbed.modelPath — when set (and no --dest), it is BOTH the * seed target and the only place the daemon will look (see * resolveLocalSnapshotDir: modelPath is exclusive). */ configModelPath?: string; cacheDir?: string; } /** Pure plan builder — everything `fetch`/`status`/`--print-urls` needs, * with no I/O, so tests can pin URL shape and precedence without touching * the network or a real config. */ export declare function buildModelFetchPlan(opts: ModelFetchPlanOpts): ModelFetchPlan; /** The copy-pastable fallback recipe. Uses `curl -L --fail --create-dirs` * so it works verbatim in both PowerShell (curl.exe ships with Windows * 10+) and any POSIX shell, with no separate mkdir step. */ export declare function curlRecipe(plan: ModelFetchPlan): string[]; /** DI seam for tests — real impl streams the response body to `dest` via a * tmp-file + rename so an aborted download can never leave a truncated file * that `resolveLocalSnapshotDir` would count as a complete snapshot. */ export type FileDownloader = (url: string, dest: string) => Promise; export declare function modelCommand(args: string[], downloader?: FileDownloader): Promise;