export type SandboxControlEvent = { readonly type: "init.ready"; readonly guest: { readonly root: { readonly readonly: boolean; }; readonly init: { readonly name: string; }; }; } | { readonly type: "guest.exec.complete"; readonly id: string; readonly exitCode: number; readonly stdout: string; readonly stderr: string; } | { readonly type: "guest.spawn.stdout" | "guest.spawn.stderr"; readonly id: string; readonly data: Uint8Array; } | { readonly type: "guest.spawn.pipe.output"; readonly id: string; readonly fd: number; readonly data: Uint8Array; } | { readonly type: "guest.spawn.pipe.output.closed"; readonly id: string; readonly fd: number; } | { readonly type: "guest.spawn.started"; readonly id: string; } | { readonly type: "guest.spawn.exit"; readonly id: string; readonly exitCode: number | null; readonly signal?: string; } | { readonly type: "guest.spawn.streams.closed"; readonly id: string; } | { readonly type: "guest.fs.response"; readonly id: string; readonly result: { readonly ok: true; readonly stat?: SandboxControlFsStat; readonly entries?: readonly SandboxControlFsDirectoryEntry[]; readonly contents?: Uint8Array; } | { readonly ok: false; readonly error: { readonly message: string; readonly code?: string; }; }; } | { readonly type: "guest.connection.opened" | "guest.connection.write.complete" | "guest.connection.end"; readonly id: string; } | { readonly type: "guest.connection.data"; readonly id: string; readonly data: Uint8Array; } | { readonly type: "guest.connection.error"; readonly id: string; readonly message: string; }; export type SandboxControlFsStat = { readonly type: "file" | "directory" | "symlink" | "other"; readonly sizeBytes: number; readonly modifiedAtMs: number; }; export type SandboxControlFsDirectoryEntry = { readonly name: string; readonly nameBytes: Uint8Array; readonly stat: SandboxControlFsStat; }; export type SandboxControlFsCommand = { readonly type: "guest.fs.stat"; readonly id: string; readonly path: string; } | { readonly type: "guest.fs.readDir"; readonly id: string; readonly path: string; } | { readonly type: "guest.fs.readFile"; readonly id: string; readonly path: string; readonly range?: { readonly offset: number; readonly length: number; }; } | { readonly type: "guest.fs.writeFile"; readonly id: string; readonly path: string; readonly contents: Uint8Array; readonly createParents: boolean; } | { readonly type: "guest.fs.mkdir"; readonly id: string; readonly path: string; readonly recursive: boolean; } | { readonly type: "guest.fs.remove"; readonly id: string; readonly path: string; readonly recursive: boolean; readonly force: boolean; } | { readonly type: "guest.fs.rename"; readonly id: string; readonly from: string; readonly to: string; }; export type SandboxControlCommand = { readonly type: "guest.exec"; readonly id: string; readonly argv: readonly string[]; readonly env?: Record; readonly cwd: string; readonly timeoutMs?: number; } | { readonly type: "guest.exec.abort"; readonly id: string; } | { readonly type: "guest.spawn"; readonly id: string; readonly argv: readonly string[]; readonly env?: Record; readonly cwd: string; readonly stdin: "pipe" | "pty"; readonly stdout: "pipe" | "pty"; readonly stderr: "pipe" | "pty"; readonly pipes: readonly number[]; readonly pty?: { readonly rows: number; readonly cols: number; }; } | { readonly type: "guest.spawn.stdin"; readonly id: string; readonly data: Uint8Array; } | { readonly type: "guest.spawn.stdin.close"; readonly id: string; } | { readonly type: "guest.spawn.pipe.write"; readonly id: string; readonly fd: number; readonly data: Uint8Array; } | { readonly type: "guest.spawn.pipe.close"; readonly id: string; readonly fd: number; } | { readonly type: "guest.spawn.signal"; readonly id: string; readonly signal: string; } | { readonly type: "guest.spawn.resize"; readonly id: string; readonly rows: number; readonly cols: number; } | { readonly type: "guest.connection.open"; readonly id: string; readonly hostname: string; readonly port: number; readonly secure: boolean; readonly timeoutMs: number; readonly serverName?: string; } | { readonly type: "guest.connection.write"; readonly id: string; readonly data: Uint8Array; } | { readonly type: "guest.connection.read"; readonly id: string; readonly maxBytes: number; } | { readonly type: "guest.connection.close"; readonly id: string; } | SandboxControlFsCommand; export declare function encodeControlCommand(command: SandboxControlCommand): Uint8Array; export declare function decodeControlEvent(packet: Uint8Array): SandboxControlEvent; //# sourceMappingURL=control-codec.d.ts.map