import type { Environment } from '../config/environments.js'; import { type ApiDeps } from '../http/client.js'; export interface EngineManifest { version: string; tarballUrl: string; sha256: string; } export declare function fetchEngineManifest(environment: Environment, accessToken: string, deps: ApiDeps): Promise; export interface DownloadDeps { fetch: typeof globalThis.fetch; } /** * Downloads the tarball and verifies its digest before it is written. A signed URL is a * credential, so it never appears in an error message. */ export declare function downloadAndVerify(tarballUrl: string, expectedSha256: string, targetPath: string, deps: DownloadDeps): Promise; /** * The tarball stores three prefixes at different depths — game/src/, game/agent-docs (plus * the sibling game/sw-cache-buster.js, which shares its strip depth) and templates — so it takes * three passes. A single pass cannot express them: `strip` is a fixed depth, and stripping 2 would * turn game/agent-docs/x.md into a bare x.md. * * Result: /{engine,types,bundle,debug,editor,genres}, /agent-docs, * /sw-cache-buster.js, and templates unpacked separately so the scaffolder can read * templates/index.json. * * `game/docs` is deliberately absent: those are engine-CONTRIBUTOR docs (how to edit the engine), * which is noise in a project where engine/ is read-only. Tarballs published before the corpus * moved still carry it, and the second pass simply does not match it — an old tarball produces a * project without agent-docs rather than a failure. See OPTIONAL_VENDORED_DIRS in project.ts. */ export declare function extractEngine(tarballPath: string, engineDir: string, templatesDir: string): Promise; /** * The line about engine drift, or null when there is nothing to say. * * A game is frozen against the engine it was last built with; the project it becomes vendors * whatever the manifest served it. Usually that is a handful of builds and nothing breaks, but the * CLI has no migration lane of its own — `bitmagic check` is where the difference shows up, so it * is worth naming the two versions before the creator sees a compile error and assumes the command * that just ran produced it. * * Shared by `import` (an export against the engine the Creator last edited it with) and `promote` * (a project against the engine ANOTHER environment serves, where the two genuinely differ most of * the time because prod's engine manifest lags dev's). */ export declare function engineDriftNotice(exported: string | null, vendored: string): string | null;