Skip to main content

Module bash

Module bash 

Source
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§

BashExecution
Mutable execution description passed to the optional prepare hook.
BashInput
Input for the bash tool. Mirrors TS BashToolInput. timeout is in seconds.
BashTool
The built-in bash tool. Holds an Arc<dyn ExecutionEnv> (read-only view suffices — bash does not touch the mutation queue).
BashToolDetails
Structured details for the bash tool. Mirrors TS BashToolDetails.
BashToolOptions
Options for create_bash_tool. Mirrors TS BashToolOptions.

Functions§

create_bash_tool
Build the bash tool from a context. Mirrors TS createBashTool.

Type Aliases§

BashPrepare
Async hook called immediately before shell execution, matching native Pi’s BashPrepare extension point.