/** * The sandbox: a child `node --permission` process with an empty environment. * * See engine.ts for why this rather than QuickJS-WASM. What matters here is the * shape of the boundary: the child can compute and it can talk to this process * over a pipe, and that is all it can do. It has no filesystem, no sockets, no * `fetch`, no ability to spawn anything, and nothing in its environment — so * the Atlassian credential is not merely hidden from it, it is not there. Every * operation it performs is a message to this process, which holds the * credential and makes the request. * * The script is written to stdin rather than passed in argv, because argv is * readable by anything that can list processes and a script may legitimately * carry alert text or an account id. */ import { type Logger } from "../../services/log.js"; import type { ScriptEngine } from "./engine.js"; /** * The first Node major whose permission model gates the network. * * `--allow-net` was added in v25.0.0. On Node 24 — which this package's * `engines` field allows — `--permission` restricts the filesystem, * subprocesses and workers and leaves sockets alone, so a script could open a * connection and send whatever it had read. Nothing in the test suite noticed, * because nothing in it tried to connect. */ export declare const SANDBOX_MIN_NODE_MAJOR = 25; export interface SandboxSupport { supported: boolean; /** Why not, in words an operator can act on. */ reason?: string; } /** * Whether this runtime can run the sandbox at all. * * The child runs `process.execPath`, so this process's version is the child's. * A version check is a claim read from a changelog; `verifyBoundary` below is * the same claim checked against the runtime, and both have to hold. */ export declare function sandboxSupport(version?: string): SandboxSupport; /** * Starts a child exactly as a script's child is started and has it try to * read a file, spawn a process, open a socket and resolve a name. * * Every attempt has to be denied. Resolves to a reason when one was not. */ export declare function verifyBoundary(execPath?: string): Promise; export interface ChildEngineOptions { memoryMb?: number; maxConcurrent?: number; maxLogLines?: number; logger?: Logger; /** Node binary to run. Defaults to this process's own. */ execPath?: string; } export declare function createChildEngine(options?: ChildEngineOptions): ScriptEngine; export declare function sharedChildEngine(options?: ChildEngineOptions): ScriptEngine; /** Test-only: drops the memoised engine so options can be changed. */ export declare function resetSharedChildEngine(): void; //# sourceMappingURL=child-engine.d.ts.map