MCPcopy
hub / github.com/afar1/fieldtheory-cli / tailString

Function tailString

src/engine.ts:294–297  ·  view source on GitHub ↗

Clip the tail of a buffer to a byte budget — engines put the "what went * wrong" line at the end of stderr.

(buf: Buffer, bytes: number)

Source from the content-addressed store, hash-verified

292/** Clip the tail of a buffer to a byte budget — engines put the "what went
293 * wrong" line at the end of stderr. */
294function tailString(buf: Buffer, bytes: number): string {
295 if (buf.length <= bytes) return buf.toString('utf-8');
296 return '\u2026' + buf.subarray(buf.length - bytes).toString('utf-8');
297}
298
299/**
300 * Strip high-confidence secret shapes from child stderr before it lands in

Callers 2

invokeEngineFunction · 0.85
stderrTailFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected