UNPKG

@tanstack/ai-sandbox

Version:

Provider-agnostic sandbox layer for TanStack AI — run harness adapters inside isolated sandboxes (defineSandbox, defineWorkspace, withSandbox) with a uniform SandboxHandle, workspace bootstrap, policy, and resumable lifecycle.

13 lines (12 loc) • 736 B
import { IncomingMessage, ServerResponse } from 'node:http'; /** Read the full request body as bytes. */ export declare function readRawBody(req: IncomingMessage): Promise<Buffer<ArrayBuffer>>; /** Build a Web `Request` from a node request and its body bytes. */ export declare function toWebRequest(req: IncomingMessage, rawBody: Uint8Array<ArrayBuffer>): Request; /** * Write a Web `Response` to a node response. The body is written chunk by * chunk, so an SSE stream reaches the client while the server writes it. * When the client or the bridge closes the socket first, the Web stream is * cancelled and this function returns. */ export declare function sendWebResponse(res: ServerResponse, response: Response): Promise<void>;