MCPcopy
hub / github.com/RedPlanetHQ/core / pushTail

Method pushTail

packages/cli/src/server/tools/exec-tools.ts:69–83  ·  view source on GitHub ↗
(chunk: Buffer)

Source from the content-addressed store, hash-verified

67 }
68
69 private pushTail(chunk: Buffer): void {
70 this.tail.push(chunk);
71 this.tailBytes += chunk.length;
72 while (this.tailBytes > this.tailCap && this.tail.length > 0) {
73 const first = this.tail[0]!;
74 const excess = this.tailBytes - this.tailCap;
75 if (excess >= first.length) {
76 this.tail.shift();
77 this.tailBytes -= first.length;
78 } else {
79 this.tail[0] = first.subarray(excess);
80 this.tailBytes -= excess;
81 }
82 }
83 }
84
85 finalize(label: string): {
86 content: string;

Callers 1

pushMethod · 0.95

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected