/** * memory-journal-mcp - Worker Sandbox (worker_threads) * * Production-grade sandboxed execution using `node:worker_threads`. * Provides true V8 isolate boundary with resource limits, * hard timeouts, and MessagePort RPC bridge. */ import { type SandboxOptions, type PoolOptions, type SandboxResult } from './types.js'; /** * Worker-thread sandbox for secure code execution. * Maintains a persistent worker thread internally. */ export declare class WorkerSandbox { private readonly options; private worker; isBusy: boolean; readonly createdAt: number; lastUsedAt: number; private currentExecution; private executionId; get isDisposed(): boolean; constructor(options?: SandboxOptions); private initWorker; private handleWorkerDeath; dispose(): void; /** * Execute code in the worker thread with RPC bridge. */ execute(code: string, apiBindings: Record, schemas?: Record>, timeoutMs?: number, contextObj?: Record, readonlyMode?: boolean, maxResultSizeOverride?: number): Promise; } /** * Pool of persistent worker-thread sandboxes with pre-warming * and lifecycle management (age recycling, idle eviction, re-warming). */ export declare class WorkerSandboxPool { private readonly options; private readonly sandboxOptions; private pool; private lifecycleTimer; constructor(sandboxOptions?: SandboxOptions, poolOptions?: PoolOptions); /** * Eagerly create workers up to `minInstances`. */ private warmPool; /** * Periodic lifecycle sweep: * 1. Remove already-disposed workers * 2. Recycle workers that exceed maxWorkerAgeMs * 3. Evict idle workers (oldest first) above minInstances * 4. Re-warm pool to minInstances */ private lifecycleSweep; execute(code: string, apiBindings: Record, schemas?: Record>, timeoutMs?: number, contextObj?: Record, readonlyMode?: boolean, maxResultSizeOverride?: number): Promise; getActiveCount(): number; dispose(): void; readonly poolId: `${string}-${string}-${string}-${string}-${string}`; } //# sourceMappingURL=worker-sandbox.d.ts.map