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 100ms-throttled on_update, 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_UPDATE_THROTTLE_MS: at most one on_update per 100ms window; a final flush after capture resolves. on_chunk invocations from the capture layer mark the throttle dirty + schedule a flush.

Structs§

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.