/** * Worker Result Compactor — compacts oversized structured payloads and enforces * the serialized egress byte boundary to prevent OOM and hard payload failures. */ import type { SandboxResult } from '../types.js'; /** * Automatically compacts oversized structured result payloads (objects and collections) * so that queries returning large datasets (e.g. 50 entries with markdown content) * do not fail outright when exceeding the egress limit. * * Primitive strings and numbers are deliberately left uncompacted so that raw * string contract tests reject properly with structured aggregation guidance. */ export declare function compactOversizedResult(val: unknown, limitBytes: number, depth?: number, seen?: WeakSet): unknown; /** * Enforces the egress byte limit during JSON serialization and applies * `compactOversizedResult` fallback when an object/array exceeds the boundary. */ export declare function serializeAndEnforceEgress(result: SandboxResult, maxResultSize?: number): void; //# sourceMappingURL=result-compactor.d.ts.map