export type MachineSpec = { name: string; image: string; env?: Record; ports?: number[]; command?: string[]; checks?: Array<{ port: number; type: 'http' | 'tcp'; path?: string; }>; resetOnStop?: boolean; mounts?: Array<{ name: string; path: string; }>; signal?: AbortSignal; startTimeoutMs?: number; }; export type MachineRun = { ports: Array<{ internal: number; host: number; url?: string; }>; }; export type MachineStatus = { state: 'started' | 'paused' | 'stopped' | 'exited' | 'failed'; exitCode?: number; reason?: string; }; export type MachineFileStat = { type: 'file' | 'directory'; size: number; mode: number; mtime: string; }; export type MachineFiles = { read(path: string): Promise; write(path: string, bytes: Uint8Array): Promise; list(path: string): Promise>; mkdir(path: string): Promise; remove(path: string): Promise; stat(path: string): Promise; }; /** A process started in a machine: its pid, and what it writes and how it ends, as they happen. */ export type MachineProcess = { pid: number; events: AsyncIterable<{ stdout?: string; } | { stderr?: string; } | { exit: number; }>; }; export type ExecSpec = { args: string[]; env?: Record; cwd?: string; }; export type MachineHttpReply = { port: number; method: string; path: string; requestText?: string; status: number; headers?: Record; body?: string; }; export type MachinePool = { readonly kind: 'docker' | 'none' | 'fake'; /** Optional capability admission, before vendor resource creation; starts no process. */ admitRun?(spec: MachineSpec): Promise; /** runs the image; a failure (no container runtime, an image that will not start) rejects with the runtime's message */ run(spec: MachineSpec): Promise; /** starts a process in a running machine; a machine the pool does not run rejects */ exec(name: string, spec: ExecSpec): Promise; request(name: string, port: number, request: Request): Promise; /** Undefined means the metadata-only/fake backing has no process lifecycle to observe. */ status(name: string): Promise; ports(name: string): Promise; files(name: string): Promise; pause(name: string): Promise; resume(name: string): Promise; stop(name: string): Promise; remove(name: string): Promise; /** the fake pool's record of what it was asked */ readonly asked?: Array<{ act: 'run' | 'exec' | 'request' | 'pause' | 'resume' | 'stop' | 'remove'; name: string; spec?: MachineSpec; exec?: ExecSpec; port?: number; path?: string; requestText?: string; }>; }; /** A declared compute capability gap, distinct from a failed admitted guest. */ export declare function isMachineCapabilityGap(error: unknown): boolean; export declare const MACHINE_POOL = "_machine_pool"; export declare const POOL_KINDS: readonly ["docker", "none", "fake"]; /** The pool of a kind, for a World (`world`: the mark its containers carry). */ export declare function machinePool(kind: MachinePool['kind'], world?: string, httpReplies?: readonly MachineHttpReply[]): MachinePool; export declare function poolFor(service: string, root: string | undefined, kind: MachinePool['kind'], httpReplies?: readonly MachineHttpReply[]): MachinePool; /** Re-enrolling a verification pool starts a fresh fake execution record. */ export declare function resetFakePool(service: string, root: string | undefined): void; /** Every machine mutation shares the tree's refusal seam. HTTP/RPC reads must be explicitly * classified by the pack; a computed operation may execute arbitrary guest code. */ export declare function guardedMachinePool(pool: MachinePool, service: string, safeRead: boolean): MachinePool;