Skip to content

Graphorin API reference v0.4.0


Graphorin API reference / @graphorin/tools / code-mode

code-mode

Code-mode / programmatic tool calling (P1-2). Public surface:

The sandbox primitive these build on, runBridgedSource, lives in @graphorin/security/sandbox (sandbox isolation is a security concern); this module supplies the tool bridge + the model-facing projection. The agent runtime wires them behind the opt-in toolInvocation: 'code-mode' config.

Interfaces

InterfaceDescription
CodeApiProjectionThe projected code API for a set of tools.
CodeExecuteLimitsTunable sandbox limits for createCodeExecuteTool.
CodeExecuteToolOptionsConfiguration for createCodeExecuteTool.
CodeSearchMatchA tool-search match code_search can fold in (deferred pool).
CodeSearchToolOptionsConfiguration for createCodeSearchTool.
ProjectableToolStructural view of a tool this module can project.

Type Aliases

Type AliasDescription
CodeExecuteBridgeHost bridge: run one bridged tool call and return its output. Receives the code_execute call's own ToolExecutionContext, so the agent can route the inner call through the real executor under the same runContext (same run / step / tracer / secrets scope).

Functions

FunctionDescription
createCodeExecuteToolBuild the code_execute meta-tool. Its output is the script's final value rendered as a string, so the executor's maxResultTokens / 'spill-to-file' pipeline bounds even a large final result (WI-10).
createCodeSearchToolBuild the code_search meta-tool. Returns matching tools.<name>(…) signatures as text (eager substring match + the deferred pool).
projectToolApiProject a set of resolved tools as a typed code API. See the module docstring.