Skip to content

Graphorin API reference v0.4.0


Graphorin API reference / @graphorin/security / / BridgedSourceOptions

Interface: BridgedSourceOptions

Defined in: packages/security/src/sandbox/bridged-source.ts:52

Options for runBridgedSource.

Properties

PropertyModifierTypeDescriptionDefined in
abortGraceMs?readonlynumberGrace (ms) after abort before forcible terminate(). Default 100.packages/security/src/sandbox/bridged-source.ts:81
allowedToolsreadonlyreadonly string[]Names the script may call as tools.<name>(args).packages/security/src/sandbox/bridged-source.ts:60
dispatchreadonly(call) => Promise&lt;unknown&gt;Host bridge invoked for each tools.<name>(args) call. Resolve with the tool's output (structured-clone safe) or reject to surface an error to the script. Calls for a name not in allowedTools are rejected by the runner before dispatch is consulted.packages/security/src/sandbox/bridged-source.ts:67
maxMemoryMb?readonlynumberMemory ceiling (MB) for the worker. Omitted ⇒ Node default.packages/security/src/sandbox/bridged-source.ts:71
maxToolCalls?readonlynumberCeiling on bridged tool calls per run. Default 64.packages/security/src/sandbox/bridged-source.ts:79
noFilesystem?readonlybooleanBlock filesystem (node:fs/…) imports. Default true.packages/security/src/sandbox/bridged-source.ts:75
noNetwork?readonlybooleanBlock outbound network (fetch + node:http/net/…). Default true.packages/security/src/sandbox/bridged-source.ts:73
signal?readonlyAbortSignalCancellation signal; aborts the run and terminates the worker.packages/security/src/sandbox/bridged-source.ts:77
sourcereadonlystringModel-written JavaScript, evaluated as the body of an async (tools) => { … } function. A top-level return yields the final result; the value must be structured-clone safe.packages/security/src/sandbox/bridged-source.ts:58
timeoutMs?readonlynumberHard wall-clock timeout (ms) for the whole script. Default 30000.packages/security/src/sandbox/bridged-source.ts:69
warn?readonly(message) => voidOptional WARN logger.packages/security/src/sandbox/bridged-source.ts:83