export interface DockerResult { code: number; stdout: string; stderr: string; /** The docker binary was not found. */ missing?: boolean; } /** Runs `docker`; replaced by a fake in tests. */ export interface DockerRunner { /** Run and capture output. */ run(args: readonly string[]): Promise; /** Run with the terminal attached (progress, logs); resolves to the exit code. */ stream(args: readonly string[]): Promise; } export declare function spawnDocker(env: Readonly>, binary?: string): DockerRunner; export type Check = { ok: true; version: string; } | { ok: false; problem: string; }; export interface DockerChecks { docker: Check; /** Absent when Docker itself failed (Compose was not asked). */ compose?: Check; } /** Check the Docker engine and Compose v2; never throws. */ export declare function checkDocker(docker: DockerRunner): Promise; /** Fail with a clear message when Docker or Compose v2 is unavailable. */ export declare function dockerPreflight(docker: DockerRunner): Promise; export interface ComposeService { service: string; state: string; health: string; } /** Parse `docker compose ps --format json` (a JSON array, or one object per line). */ export declare function parseComposePs(stdout: string): ComposeService[]; /** `123.4MiB` (from `docker stats` MemUsage) in bytes; undefined when unreadable. */ export declare function parseByteSize(text: string): number | undefined; /** `812 MB`, `2.1 GB`. */ export declare function formatBytes(bytes: number): string; /** * Memory in use per Tenant: the sum over its running containers, found by the label * `dev.nylorun.tenant`, from one `docker stats --no-stream`. Undefined when Docker does not * answer; a Tenant with no running container is absent. */ export declare function tenantMemory(docker: DockerRunner): Promise | undefined>;