/** * Auto-download the AFT binary from GitHub releases. * * Resolution order (in resolver.ts): * 1. Cached binary in ~/.cache/aft/bin/ * 2. npm platform package (@cortexkit/aft-darwin-arm64, etc.) * 3. PATH lookup (which aft) * 4. ~/.cargo/bin/aft * 5. Auto-download from GitHub releases (this module) * * Cache dir respects XDG_CACHE_HOME on Linux/macOS and LOCALAPPDATA on Windows. */ /** * Read the version string from an `aft` binary by invoking it with * `--version`. Returns the bare version (e.g. `"0.22.1"`) without the * leading `v` or the `aft` prefix, or `null` if the invocation fails. * * Shared by the downloader and resolver so both cache hot-paths validate the * binary itself instead of trusting directory names. */ export declare function readBinaryVersion(binaryPath: string): string | null; /** Keep getCacheDir as an alias for getAftBinaryCacheDir so existing callers using the older name continue to work. */ export { getAftBinaryCacheDir as getCacheDir } from "./cache-paths.js"; /** Binary name for the current platform. */ export declare function getBinaryName(): string; /** Return the cached binary path if it exists, otherwise null. * Checks the version-specific cache directory only. * The legacy flat cache (~/.cache/aft/bin/aft) is intentionally NOT checked * because it can be overwritten by other instances, corrupting running processes. */ export declare function getCachedBinaryPath(version?: string): string | null; /** * Download the AFT binary for the current platform from GitHub releases. * * @param version - Git tag to download from. Accepts either `"v0.1.0"` or * `"0.1.0"`; the `v` prefix is normalized internally. If omitted, fetches * the latest release tag via the GitHub API. * @returns Absolute path to the downloaded binary, or null on failure. */ export declare function downloadBinary(version?: string): Promise; /** * Ensure the AFT binary is available: check cache, then download if needed. * This is the main entry point called by the resolver and by plugin startup * warmups. Sharing the promise keeps those two paths on one download while the * filesystem lock still coordinates separate host processes. * * @param version - Git tag (e.g. `"v0.25.1"` or `"0.25.1"` — both accepted). * Normalized to a `v`-prefixed tag internally so the on-disk cache layout * stays consistent regardless of caller convention. */ export declare function ensureBinary(version?: string): Promise; type DownloadLockTiming = { timeoutMs?: number; staleMs?: number; pollIntervalMs?: number; }; declare function acquireDownloadLock(lockPath: string, timing?: DownloadLockTiming): Promise<() => void>; export declare const __test__: { acquireDownloadLock: typeof acquireDownloadLock; }; //# sourceMappingURL=downloader.d.ts.map