Expand description
Bash tool — Rust port of @agent-sh/harness-bash.
Conforms to agent-knowledge/design/bash.md. Same contract as the
TS package: bash / bash_output / bash_kill with a session
object, tokio-driven process runner, inactivity + wall-clock
timeouts, HeadTailBuffer with spill-to-file, background job map.
Structs§
- Background
Read Result - Bash
Background Started - Bash
Error - Bash
Kill Params - Bash
Nonzero Exit - BashOk
- Bash
Output Params - Bash
Params - Bash
Permission Policy - Permission policy with the autonomous-mode escape hatch for tests.
- Bash
RunInput - Everything the runtime needs to launch + wire up a subprocess. The
on_stdout/on_stderrcallbacks hand each chunk back to the orchestrator for head+tail buffering and inactivity-timer reset. - Bash
RunResult - Bash
Session Config - Bash
Timeout - CwdCarry
Outcome - Expose
applyCwdCarryequivalent for harnesses that want to mutate logical cwd after a successfulcdcommand. Same contract as the TSapplyCwdCarry— returns whether the cwd changed and whether the attempt escaped the workspace. - Head
Tail Buffer - Per-stream output buffer. Keeps head in memory, spills the rest to a temp file when overflow triggers. Matches the TS HeadTailBuffer simplification (head-only inline; full file recoverable via Read).
Enums§
Constants§
- BACKGROUND_
MAX_ JOBS - BASH_
KILL_ TOOL_ DESCRIPTION - BASH_
KILL_ TOOL_ NAME - BASH_
OUTPUT_ TOOL_ DESCRIPTION - BASH_
OUTPUT_ TOOL_ NAME - BASH_
TOOL_ DESCRIPTION - BASH_
TOOL_ NAME - DEFAULT_
INACTIVITY_ TIMEOUT_ MS - DEFAULT_
WALLCLOCK_ BACKSTOP_ MS - KILL_
GRACE_ MS - MAX_
COMMAND_ LENGTH - MAX_
OUTPUT_ BYTES_ FILE - MAX_
OUTPUT_ BYTES_ INLINE - SENSITIVE_
ENV_ PREFIXES - Env var prefixes the tool refuses to let the model set. Mirrors the
TS
SENSITIVE_ENV_PREFIXESlist.
Traits§
Functions§
- apply_
cwd_ carry - Expose
applyCwdCarryequivalent for harnesses that want to mutate logical cwd after a successfulcdcommand. Same contract as the TSapplyCwdCarry— returns whether the cwd changed and whether the attempt escaped the workspace. Mirror of the TSapplyCwdCarry. Takes the executed command, its exit code, and mutatessession.logical_cwdif a top-levelcdlanded inside the workspace. Returns a summary so the caller can annotate the tool result if an escape attempt was blocked. - bash
- bash_
kill - bash_
output - default_
executor - detect_
top_ level_ cd - Expose
applyCwdCarryequivalent for harnesses that want to mutate logical cwd after a successfulcdcommand. Same contract as the TSapplyCwdCarry— returns whether the cwd changed and whether the attempt escaped the workspace. Top-level grammar check for acd <path>command. Returns the target only for a single, unambiguous cd with no shell operators. - format_
background_ started_ text - format_
bash_ kill_ text - format_
bash_ output_ text - format_
result_ text - format_
timeout_ text - safe_
parse_ bash_ kill_ params - safe_
parse_ bash_ output_ params - safe_
parse_ bash_ params