import { type EngineAdapter } from "./engine-adapter.js"; import { type ProgressCallback } from "./progress.js"; export interface DownloadServerOptions { /** The engine adapter (supplies the install-dir layout + server name). */ adapter: EngineAdapter; /** The project root the server installs into. */ projectDir: string; /** The pinned server version to download (REQUIRED — the pin lives in each CLI, not cli-core). */ version: string; /** Offline/CI escape hatch: a local `.zip`, extracted dir, bare binary, or `http(s)://` zip URL. */ source?: string; /** Re-download even when a matching cached binary is present. */ force?: boolean; /** Injectable `fetch` (tests). */ fetchImpl?: typeof fetch; /** Platform/arch overrides (tests / cross-RID). */ os?: NodeJS.Platform; arch?: string; onProgress?: ProgressCallback; } export type DownloadServerResult = { kind: "success"; serverPath: string; source: "download" | "cache" | "source"; version: string; verified: boolean; warnings: string[]; } | { kind: "failure"; error: Error; url?: string; warnings: string[]; }; /** The version recorded in the install dir's `version` marker, or null. */ export declare function readVersionMarker(installDir: string): string | null; /** Locate the extracted binary under `stagingDir`, preferring the SHALLOWEST match. Null when absent. */ export declare function findExtractedBinary(stagingDir: string, executableName: string): string | null; /** * Download + install the pinned server. Resolution order: * 1. `--server-source` escape hatch → installed WITHOUT the SHA256SUMS gate (trusted user artifact). * 2. Cached binary whose `version` marker equals the pin → reused (unless `force`). * 3. Download the release zip, VERIFY against `SHA256SUMS` (fail-closed), staging-extract + install. * Never throws past the boundary. */ export declare function downloadServer(opts: DownloadServerOptions): Promise; //# sourceMappingURL=server-download.d.ts.map