import type { ContainerRuntime, ServiceSpec } from "./services.js"; /** A synchronous docker CLI call — the injected real-IO seam. */ export type DockerExec = (args: readonly string[]) => { readonly stdout: string; readonly stderr: string; readonly code: number; }; /** A TCP readiness probe against a published host port — the second IO seam. */ export type NetProbe = (port: number) => Promise; /** * A docker-safe, collision-free container name for a declared service. Sanitises * the service name to docker's `[a-zA-Z0-9_.-]` charset and appends the process * id + a monotonic counter so parallel/repeated runs never clash. Pure given the * injected suffix, so it's unit-tested. */ export declare function containerNameFor(name: string, suffix: string): string; /** The `docker run -d …` argv for a service. Pure. */ export declare function dockerRunArgs(spec: ServiceSpec, containerName: string): string[]; /** The `docker exec sh -c ` argv. Pure. */ export declare function dockerExecArgs(containerName: string, command: string): string[]; /** The port to publish — a 0-or-1 element list (v0 is single-port). Pure. */ export declare function publishedPorts(spec: ServiceSpec): number[]; /** * Parse the published host port out of `docker port ` output, * e.g. `0.0.0.0:49153` or `127.0.0.1:49153\n[::]:49153` → `49153`. Returns * `undefined` when nothing is published — parse-don't-validate: the caller gets * "a port or nothing", never a magic `0` to special-case. Pure. */ export declare function parseDockerPort(output: string): number | undefined; /** * Build a Docker-backed {@link ContainerRuntime}. The two real-IO seams default * to the real docker CLI + a real TCP probe, but both are injectable so the * lifecycle is unit-testable with fakes. * * @experimental */ export declare function experimental_makeDockerRuntime(deps?: { exec?: DockerExec; netProbe?: NetProbe; sleep?: (ms: number) => Promise; /** Readiness deadline; injectable so a test can cover the timeout path. */ readyTimeoutMs?: number; }): ContainerRuntime; /** * The default Docker-backed runtime — pass to `experimental_startServices`. * * @experimental */ export declare const experimental_dockerRuntime: ContainerRuntime; //# sourceMappingURL=services-docker.d.ts.map