Skip to content

OutputBuffer

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:38

Accumulates command output up to a byte budget using a head + tail window. The full output is retained in memory so it can be spilled to disk on demand; the in-memory full copy is itself bounded at a hard safety ceiling to avoid unbounded growth from a runaway command.

new OutputBuffer(maxOutputBytes, fullCeiling?): OutputBuffer

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:58

number

total byte budget for the returned (head+tail) window.

number = ...

hard ceiling for the in-memory full copy kept for spillover. Defaults to a generous 16MB so the spill file holds the real output for typical noisy logs, while still bounding memory for a runaway command.

OutputBuffer

get isTruncated(): boolean

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:130

boolean


get totalBytes(): number

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:126

number

append(chunk): void

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:67

Append a chunk of output. Byte accounting uses UTF-8 byte length.

string

void


finalize(spill?): CappedOutput

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:147

Finalize the capture. When not truncated, returns the output verbatim. When truncated, spills the full output to a temp file and returns head + a gap note (with the file path) + tail.

(content) => string

optional injected spill function (path-returning) for testing. Defaults to writing into os.tmpdir().

CappedOutput


getFull(): string

Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:135

The full captured output (bounded by the in-memory ceiling).

string