Member Junction
    Preparing search index...

    Parameters for code execution.

    bridgeHandlers is the ONLY field that is NOT sent over IPC — functions can't be serialized across the process boundary. The host keeps the map alive for the duration of this execution and uses it to service bridge-call messages coming back from the worker.

    interface CodeExecutionParams {
        abortSignal?: AbortSignal;
        bridgeHandlers?: BridgeHandlerMap;
        code: string;
        inputData?: any;
        language: "javascript";
        maxBridgeCalls?: number;
        memoryLimitMB?: number;
        timeoutSeconds?: number;
    }
    Index

    Properties

    abortSignal?: AbortSignal

    Optional AbortSignal for upstream cancellation. When aborted, any in-flight await __bridgeCall(...) inside the sandbox rejects and the sandbox script is left to wind down (we don't dispose the isolate mid-execution — see design notes in the plan).

    bridgeHandlers?: BridgeHandlerMap

    Optional map of bridge handlers to expose to sandbox code as __bridgeCall(name, args). When present, the sandbox can make async round-trips to the host for each registered name. Host-side only — not sent over IPC. See BridgeHandler.

    code: string

    The code to execute

    inputData?: any

    Input data available to the code via 'input' variable

    language: "javascript"

    Programming language (currently only 'javascript' supported)

    maxBridgeCalls?: number

    Optional cap on the number of bridge calls a single execution may make (default: 100). The (N+1)th call rejects with a BRIDGE_LIMIT error. Prevents runaway loops inside sandbox code.

    memoryLimitMB?: number

    Memory limit in MB (default: 128) Note: Memory limiting requires Node.js flags, enforced at process level

    timeoutSeconds?: number

    Maximum execution time in seconds (default: 30)