Skip to content
1 min read · 202 words

Interface: BinarySandbox ​

Defined in: src/batteries/sandbox/executor.ts:16

A command wrapper that REWRITES an invocation into the one the inner executor should run.

Remarks ​

The wrapper's job is to own quoting: it returns the argv that actually gets spawned, which for a sandbox is the wrapper binary (bwrap, sandbox-exec, …) followed by everything that binary needs. That is why sandboxedExecutor does NOT quote for it — quoting is a property of the wrapper being used (a shell -c string, an argv vector, a container exec line), so an adapter that quoted first would hand every implementor the wrong representation.

A wrap implementation must NOT execute anything: it only computes and returns the invocation.

Methods ​

wrap() ​

ts
wrap(invocation: BinaryInvocation): Promise<BinaryInvocation>;

Defined in: src/batteries/sandbox/executor.ts:25

Return the invocation the inner executor should run instead. Its cmd and args ARE the wrapped argv, so the caller's original args are never appended.

Parameters ​

ParameterTypeDescription
invocationBinaryInvocationThe command, args, working directory, environment, and limits to wrap.

Returns ​

Promise<BinaryInvocation>

The replacement invocation, carrying through whatever the caller asked for that the wrapper does not itself decide (cwd, timeoutMs, signal, the kill controls).