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.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new OutputBuffer(
maxOutputBytes,fullCeiling?):OutputBuffer
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:58
Parameters
Section titled “Parameters”maxOutputBytes
Section titled “maxOutputBytes”number
total byte budget for the returned (head+tail) window.
fullCeiling?
Section titled “fullCeiling?”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.
Returns
Section titled “Returns”OutputBuffer
Accessors
Section titled “Accessors”isTruncated
Section titled “isTruncated”Get Signature
Section titled “Get Signature”get isTruncated():
boolean
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:130
Returns
Section titled “Returns”boolean
totalBytes
Section titled “totalBytes”Get Signature
Section titled “Get Signature”get totalBytes():
number
Defined in: _worktrees/docs-release/gaunt-sloth/packages/agent/src/tools/shell/outputBuffer.ts:126
Returns
Section titled “Returns”number
Methods
Section titled “Methods”append()
Section titled “append()”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
finalize()
Section titled “finalize()”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.
Parameters
Section titled “Parameters”spill?
Section titled “spill?”(content) => string
optional injected spill function (path-returning) for testing.
Defaults to writing into os.tmpdir().
Returns
Section titled “Returns”getFull()
Section titled “getFull()”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).
Returns
Section titled “Returns”string