MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / compressTerminalOutput

Function compressTerminalOutput

src/integrations/terminal/BaseTerminal.ts:277–284  ·  view source on GitHub ↗

* Compresses terminal output by applying run-length encoding and truncating to reasonable limits. * Uses hardcoded defaults: 500 lines, 50K characters - these are UI display limits to prevent * memory issues, not LLM context limits (which are controlled by terminalOutputPreviewSize). * @param

(input: string)

Source from the content-addressed store, hash-verified

275 * @returns The compressed terminal output
276 */
277 public static compressTerminalOutput(input: string): string {
278 // Hardcoded UI display limits - these prevent unbounded memory growth
279 // in the chat display, separate from the LLM context limits
280 const LINE_LIMIT = 500
281 const CHARACTER_LIMIT = 50_000
282
283 return truncateOutput(applyRunLengthEncoding(input), LINE_LIMIT, CHARACTER_LIMIT)
284 }
285
286 /**
287 * Sets whether to enable ZDOTDIR handling for zsh

Callers

nothing calls this directly

Calls 2

truncateOutputFunction · 0.90
applyRunLengthEncodingFunction · 0.90

Tested by

no test coverage detected