Skip to content

BashExecutor

Defined in: packages/tools/src/bash/executor.ts:9

describe(): BashExecutorDescription

Defined in: packages/tools/src/bash/executor.ts:37

Reports this executor’s actual, resolved configuration — for the describeEnvironment tool (createBashToolProvider/createWorkspaceToolProvider) to give the model situational awareness of what it can and can’t do, instead of it only discovering limits by hitting a denial. Every concrete executor already holds this in closure; describe() just returns it, no new computation.

BashExecutorDescription


optional dispose(): Promise<void>

Defined in: packages/tools/src/bash/executor.ts:44

Releases long-lived resources this executor holds (the ASRT supervisor child, for example). Optional: executors with nothing to release omit it. Safe to call more than once. After dispose, a later run() may start fresh resources.

Promise<void>


run(argv, options): AsyncGenerator<BashExecutorUpdate, void, void>

Defined in: packages/tools/src/bash/executor.ts:25

Yields zero or more { done: false, ... } progress updates while the command is still running, then exactly one { done: true, ... } final result. An executor that doesn’t stream progress can just yield the final result alone — both shapes satisfy the same AsyncGenerator, so a caller (e.g. createBashTool) doesn’t need to know which.

argv is spawned as-is — no shell. A caller that wants a shell (the model-facing bash tool) passes ["/bin/bash", "-c", command]. Empty argv is an invariant break (AdlError("INIT_FAILED")), not a no-op.

This return type is exactly what the AI SDK’s tool execute accepts for a streaming tool (AsyncIterable<OUTPUT> — see ai’s ToolExecuteFunction): every yielded value becomes a preliminary tool-result, and the last one is re-emitted as the final one. createBashTool forwards this generator directly with no wrapping.

readonly string[]

BashExecutorRunOptions

AsyncGenerator<BashExecutorUpdate, void, void>