MCPcopy Create free account
hub / github.com/tiann/hapi / appendTail

Function appendTail

cli/src/runner/run.ts:437–444  ·  view source on GitHub ↗
(current: string, chunk: Buffer | string)

Source from the content-addressed store, hash-verified

435 const MAX_TAIL_CHARS = 4000;
436 let stderrTail = '';
437 const appendTail = (current: string, chunk: Buffer | string): string => {
438 const text = chunk.toString();
439 if (!text) {
440 return current;
441 }
442 const combined = current + text;
443 return combined.length > MAX_TAIL_CHARS ? combined.slice(-MAX_TAIL_CHARS) : combined;
444 };
445 const logStderrTail = () => {
446 const trimmed = stderrTail.trim();
447 if (!trimmed) {

Callers 1

spawnSessionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected