MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / set

Method set

src/utils/tool-cache.ts:55–64  ·  view source on GitHub ↗
(toolName: string, args: any, result: string)

Source from the content-addressed store, hash-verified

53 }
54
55 set(toolName: string, args: any, result: string): void {
56 if (typeof result !== 'string') return;
57 const size = result.length;
58 if (size > this.maxBytesPerEntry) return;
59 if (this.totalBytes + size > this.maxTotalBytes) this.evictOldest();
60 if (this.cache.size >= this.maxEntries) this.evictOldest();
61 const key = this.keyFor(toolName, args);
62 this.cache.set(key, { result, size, hits: 0 });
63 this.totalBytes += size;
64 }
65
66 private evictOldest(): void {
67 const first = this.cache.keys().next();

Callers 2

openDatabaseFunction · 0.45
isHostReachableFunction · 0.45

Calls 2

evictOldestMethod · 0.95
keyForMethod · 0.95

Tested by

no test coverage detected