import type { TreeEntry } from './tree_entry.ts'; /** * The one flat directory a repository's cache lives under. * * Upstream's own spelling (`file_download.repo_folder_name`): the plural kind * and the two halves of the id joined by `--`, so `julien-c/EsperBERTo-small` * as a model is `models--julien-c--EsperBERTo-small`. Flattening is the point: * a namespace holding a slash would otherwise nest, and two repos could * collide across kinds. */ export declare function repoFolderName(repoId: string, repoType: string): string; /** * The name a file's bytes are cached under. * * Upstream keys a blob by the ETag the resolve endpoint answered, which is the * LFS sha256 for a pointer-backed file and the git blob oid for an ordinary * one. Both are content addresses, which is what makes the blob shareable * between revisions: two snapshots of an unchanged file link to one blob. */ export declare function etagOf(entry: TreeEntry): string; /** Where one file's bytes live, shared across every snapshot. */ export declare function blobPath(cacheDir: string, folder: string, etag: string): string; /** The directory one commit's tree is rendered under. */ export declare function snapshotDir(cacheDir: string, folder: string, sha: string): string; /** Where one file appears within a commit's rendered tree. */ export declare function snapshotPath(cacheDir: string, folder: string, sha: string, repoPath: string): string; /** The file recording which commit a branch or tag points at. */ export declare function refPath(cacheDir: string, folder: string, revision: string): string; /** * The relative target a snapshot entry points at. * * Relative, not absolute, because upstream's cache is relocatable: a whole * cache directory can be moved or copied and every link still resolves. * Derived from the entry's own depth rather than counted out, so a nested path * cannot get the number of `..` hops wrong. */ export declare function linkTarget(repoPath: string, etag: string): string; /** * The cache root the session names, in upstream's own order. * * Upstream reads `HF_HUB_CACHE` first and falls back to `HF_HOME/hub`, then to * `~/.cache/huggingface/hub`. A workspace has no home directory, so the last * step is the one that cannot be taken and the caller reports that rather than * inventing a path. */ export declare function cacheRoot(env: Readonly>): string | null; //# sourceMappingURL=cache.d.ts.map