import { type CodeRunResult, type CodeRuntime, type RunCodeOptions } from './types.js'; /** Resource policy for one fresh QuickJS worker execution. */ export interface WorkerCodeRuntimeOptions { /** QuickJS allocator limit, also the WASM linear-memory ceiling. Does not bound total Node/process memory. Default: 64 MiB. */ readonly memoryLimitBytes?: number; /** Maximum UTF-8 program source size. Default: 256 KiB. */ readonly maxSourceBytes?: number; /** Maximum UTF-8 JSON size of each input, host result, and program return. Default: 1 MiB. */ readonly maxValueBytes?: number; /** Maximum host calls admitted by one program, including refusals. Default: 100. */ readonly maxHostCalls?: number; /** Maximum host calls awaiting replies simultaneously. Default: 100. */ readonly maxPendingHostCalls?: number; } /** * Runs untrusted JavaScript in a QuickJS interpreter inside a worker thread. * QuickJS owns the guest globals, functions, and promises. Node capabilities * never enter that realm; constructors and dynamic imports cannot recover them. * A fresh interpreter and bounded imported WASM memory are created per turn. * The worker makes wall-clock cancellation independent of interpreter progress. */ export declare class WorkerCodeRuntime implements CodeRuntime { readonly id = "worker_threads"; private readonly limits; constructor(options?: WorkerCodeRuntimeOptions); run(options: RunCodeOptions): Promise; } //# sourceMappingURL=worker.d.ts.map