MCPcopy
hub / github.com/Dimillian/CodexMonitor / coalesceReadEntries

Function coalesceReadEntries

src/utils/threadItems.explore.ts:273–290  ·  view source on GitHub ↗
(entries: ExploreEntry[])

Source from the content-addressed store, hash-verified

271}
272
273function coalesceReadEntries(entries: ExploreEntry[]) {
274 const result: ExploreEntry[] = [];
275 const seenReads = new Set<string>();
276
277 for (const entry of entries) {
278 if (entry.kind !== "read") {
279 result.push(entry);
280 continue;
281 }
282 const key = entry.detail ? `${entry.label}|${entry.detail}` : entry.label;
283 if (seenReads.has(key)) {
284 continue;
285 }
286 seenReads.add(key);
287 result.push(entry);
288 }
289 return result;
290}
291
292function mergeExploreEntries(base: ExploreEntry[], next: ExploreEntry[]) {
293 const merged = [...base, ...next];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected