(...lists: CollabAgentRef[][])
| 50 | } |
| 51 | |
| 52 | function 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 | |
| 71 | function buildCollabAgentStatus( |
| 72 | threadIdValue: unknown, |
no outgoing calls
no test coverage detected