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

Function mergeCollabAgentRefs

src/utils/threadItems.collab.ts:52–69  ·  view source on GitHub ↗
(...lists: CollabAgentRef[][])

Source from the content-addressed store, hash-verified

50}
51
52function mergeCollabAgentRefs(...lists: CollabAgentRef[][]) {
53 const byThreadId = new Map<string, CollabAgentRef>();
54 lists.forEach((list) => {
55 list.forEach((entry) => {
56 const existing = byThreadId.get(entry.threadId);
57 if (!existing) {
58 byThreadId.set(entry.threadId, { ...entry });
59 return;
60 }
61 byThreadId.set(entry.threadId, {
62 threadId: existing.threadId,
63 nickname: existing.nickname ?? entry.nickname,
64 role: existing.role ?? entry.role,
65 });
66 });
67 });
68 return Array.from(byThreadId.values());
69}
70
71function buildCollabAgentStatus(
72 threadIdValue: unknown,

Callers 1

parseCollabToolCallItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected