import { type MlxModelRecord } from "./mlxModelRecord.js"; import { type Chunk, type HubOptions, type HubSnapshot } from "./hubClient.js"; export { DEFAULT_HUB_URL, GATED_MESSAGE, fetchHubSnapshot, type Chunk, type HubFile, type HubOptions, type HubSnapshot, } from "./hubClient.js"; /** Downloads a Hugging Face model repo as parallel byte ranges into a * directory that mlx-lm can load as it is. The repo's files land under * their own names; `.agency-model.json` beside them records which * chunks are on disk, so a second run fetches only what is missing. */ export declare const CHUNK_BYTES: number; export declare const DEFAULT_CONCURRENCY = 8; /** Attempts per chunk before the run fails. The waits between them * double from `retryDelayMs`. */ export declare const RETRIES = 5; export type DownloadEvent = { kind: "file-start"; path: string; size: number; resumedBytes: number; } | { kind: "bytes"; done: number; total: number; } | { kind: "file-done"; path: string; } | { kind: "verify"; path: string; ok: boolean; } | { kind: "adopt"; path: string; }; export type DownloadOptions = HubOptions & { concurrency?: number; chunkBytes?: number; /** Base of the 1s, 2s, 4s… retry waits. Tests shorten it. */ retryDelayMs?: number; onEvent?: (e: DownloadEvent) => void; }; /** Which chunks still need fetching: none for a complete file of the * right size, only the unrecorded ones for a partial file, and none for * an empty file, which the ledger creates without a request. */ export declare function planChunks(snapshot: HubSnapshot, record: MlxModelRecord | null, chunkBytes?: number): Chunk[]; /** Downloads every chunk the record says is missing into `dir`, verifies * each file as it completes, and returns `dir`. Running it again after * an interruption fetches only what is missing. */ export declare function downloadHubSnapshot(snapshot: HubSnapshot, dir: string, options?: DownloadOptions): Promise;