import type { SandboxAdapter, SandboxMachine } from "../escalation/sandbox.js"; interface FakeStatefulSnapshot { env: Readonly>; /** The create-time egress allowlist the snapshot carries (like real refs). */ allowedDomains?: readonly string[]; template?: string; state: ReadonlyMap; files: ReadonlyMap; } /** * Execution-v2 fake machine. Its only observable box state is a key-value map * mutated over HTTP (`POST /state/` writes the body, `GET /state/` * reads it back), so lifecycle tests can prove a snapshot/resume cycle * preserves what ran inside the box. */ export declare class FakeStatefulMachine implements SandboxMachine { readonly id: string; readonly allowedDomains: readonly string[] | undefined; readonly template: string | undefined; private readonly saveSnapshot; stopped: boolean; /** True after the live-machine destroy() (distinct from a snapshot-preserving stop). */ destroyedSelf: boolean; /** True after the PROVIDER reaped the machine out from under us (TTL, sweep). */ reaped: boolean; readonly env: Readonly>; readonly state: Map; /** The box's disk, beside its key-value state: a snapshot/resume cycle * carries both, so a lifecycle test can prove the app's SOURCE survived. */ readonly fileContents: Map; readonly files: SandboxMachine["files"]; constructor(id: string, env: Record, allowedDomains: readonly string[] | undefined, template: string | undefined, state: ReadonlyMap, files: ReadonlyMap, saveSnapshot: (machine: FakeStatefulMachine) => string); request(req: { method: string; path: string; headers?: Record; body?: Uint8Array | string; }): Promise<{ status: number; headers: Record; body: Uint8Array; }>; url(port?: number): Promise; snapshot(): Promise; stop(): Promise; /** Live-machine destroy: gone for good; previously taken snapshot refs stay valid. */ destroy(): Promise; /** Simulate the PROVIDER killing the machine (TTL expiry, idle sweep). */ reap(): void; } export interface FakeStatefulSandbox extends SandboxAdapter { /** Every machine this adapter ever booted, in boot order. */ readonly machines: FakeStatefulMachine[]; /** Live provider-side snapshots (destroy removes its ref from here). */ readonly snapshots: Map; /** Refs passed to destroy, in call order. */ readonly destroyed: string[]; creates: number; resumes: number; } /** In-process SandboxAdapter with inspectable machines, snapshots, and destroys. */ export declare const fakeStatefulSandbox: () => FakeStatefulSandbox; export {}; //# sourceMappingURL=fake-sandbox-stateful.d.ts.map