API Reference
ShellBackend
Defined in: tools/builtin/builtin.types.ts:62
The shell capability seam — implement this against your host.
Remarks
Wire it to e.g. Node's child_process, a container, or a remote sandbox. The
ctx.signal is forwarded from the loop so a cooperating backend can abort an
in-flight command.
SECURITY: this runs arbitrary commands on whatever host you wire up. There is
no sandbox here — that is the backend's responsibility. Route the resulting
tool through the permission gate (../../permissions) before granting it to a
model you do not fully trust.
See
- ShellResult
- shellTool which wraps this seam in a model-facing tool.
Methods
exec()
exec(command, ctx): Promise<ShellResult>;Defined in: tools/builtin/builtin.types.ts:70
Execute a shell command and capture its output.
Parameters
| Parameter | Type | Description |
|---|---|---|
command | string | The shell command to run. |
ctx | ToolContext | Per-call context; ctx.signal may be used to abort the command. |
Returns
Promise<ShellResult>
The command's stdout, stderr, and exit code.