MCPcopy
hub / github.com/garrytan/gstack / push

Method push

browse/src/buffers.ts:32–42  ·  view source on GitHub ↗
(entry: T)

Source from the content-addressed store, hash-verified

30 }
31
32 push(entry: T): void {
33 const index = (this.head + this._size) % this.capacity;
34 this.buffer[index] = entry;
35 if (this._size < this.capacity) {
36 this._size++;
37 } else {
38 // Buffer full — advance head (overwrites oldest)
39 this.head = (this.head + 1) % this.capacity;
40 }
41 this._totalAdded++;
42 }
43
44 /** Return entries in insertion order (oldest first) */
45 toArray(): T[] {

Callers 15

readJsonlFunction · 0.45
harvestMethod · 0.45
parseSearchHitsFunction · 0.45
ensureSourceRegisteredFunction · 0.45
extractGbrainBlockFunction · 0.45
normalizeWithMapFunction · 0.45
toolFenceRangesFunction · 0.45
scanFunction · 0.45
applyRedactionsFunction · 0.45
redactFindingSpansFunction · 0.45
mainFunction · 0.45
spawn1Function · 0.45

Calls

no outgoing calls

Tested by 15

spawn1Function · 0.36
spawn1Function · 0.36
makeStubFetchFunction · 0.36
mockTabFunction · 0.36
pageBoxesFunction · 0.36
extractDescriptionFunction · 0.36
getAllSkillMdsFunction · 0.36
shFunction · 0.36
toolResultTextFunction · 0.36
walkFunction · 0.36
findInteractiveSkillsFunction · 0.36
runBlockLinesFunction · 0.36