Expand description
Mirrors packages/agent/src/harness/tools/bash.ts — the built-in bash
AgentTool. Drives execute_shell_with_capture with a 2-second checkpoint
throttle, and converts ALL failures (non-zero exit, timeout, abort,
executionError) into Err(AgentError) — the agent loop encodes those into an
error ToolResultMessage.
Throttle mirrors the TS BASH_CHECKPOINT_INTERVAL_MS: at most one
checkpoint update per 2-second window; a final flush always follows capture
resolution.
Structs§
- Bash
Execution - Mutable execution description passed to the optional prepare hook.
- Bash
Input - Input for the bash tool. Mirrors TS
BashToolInput.timeoutis in seconds. - Bash
Tool - The built-in
bashtool. Holds anArc<dyn ExecutionEnv>(read-only view suffices — bash does not touch the mutation queue). - Bash
Tool Details - Structured details for the bash tool. Mirrors TS
BashToolDetails. - Bash
Tool Options - Options for
create_bash_tool. Mirrors TSBashToolOptions.
Functions§
- create_
bash_ tool - Build the
bashtool from a context. Mirrors TScreateBashTool.
Type Aliases§
- Bash
Prepare - Async hook called immediately before shell execution, matching native Pi’s
BashPrepareextension point.