export declare const AGENT_SERVICE_WS_SCHEMA: "botlearn-agent-sandbox-ws/0.4"; export declare const AGENT_SERVICE_WS_SUBPROTOCOL: "botlearn-agent-sandbox.v4"; export declare const WORKSPACE_FILE_READ_BINARY_CAPABILITY: "workspace_file_read_binary_v1"; export declare const WORKSPACE_FILES_LIST_CAPABILITY: "workspace_files_list_v1"; export declare const WORKSPACE_FILE_CHUNK_BYTES: number; export declare const WORKSPACE_FILE_CHUNK_HEADER_BYTES = 29; export type SandboxFrameType = "sandbox.hello" | "sandbox.sync" | "session.open" | "session.activate" | "turn.start" | "turn.cancel" | "session.close" | "sandbox.drain" | "sandbox.shutdown" | "event.ack" | "auth.rotate" | "workspace.file.read" | "workspace.files.list" | "ping" | "sandbox.ready" | "sandbox.heartbeat" | "command.ack" | "session.opened" | "session.open_failed" | "session.closed" | "activation.cleaned" | "turn.event" | "turn.files.report" | "workspace.file.result" | "workspace.files.result" | "sandbox.drained" | "sandbox.log" | "pong" | "protocol.error"; export declare class UnsupportedSandboxProtocolError extends Error { readonly schemaVersion: unknown; constructor(schemaVersion: unknown); } export interface SandboxFrame { schema_version: typeof AGENT_SERVICE_WS_SCHEMA; type: SandboxFrameType; frame_id: string; sandbox_id: string; sandbox_generation: number; connection_epoch: number; seq: number; sent_at: string; runtime_session_id: string | null; agent_run_id: string | null; worker_attempt: number | null; activation_id: string | null; payload: Record; } export interface WorkspaceFileChunk { transferId: string; chunkIndex: number; content: Buffer; } export declare function createWorkspaceFileChunk(transferId: string, chunkIndex: number, content: Buffer): Buffer; export declare function parseWorkspaceFileChunk(raw: Buffer): WorkspaceFileChunk; /** Wire encoding for every outbound frame: well-formed UTF-16, so valid UTF-8 JSON. */ export declare function serializeSandboxFrame(frame: SandboxFrame): string; export declare function parseSandboxFrame(raw: string, maxBytes?: number): SandboxFrame; export declare function createSandboxFrame(input: { type: SandboxFrameType; sandboxId: string; sandboxGeneration: number; connectionEpoch: number; seq: number; payload?: Record; runtimeSessionId?: string; agentRunId?: string; workerAttempt?: number; activationId?: string; frameId?: string; }): SandboxFrame;