(value: unknown)
| 86 | } |
| 87 | |
| 88 | function parseCollabAgentStatuses(value: unknown) { |
| 89 | if (!Array.isArray(value)) { |
| 90 | return []; |
| 91 | } |
| 92 | return value |
| 93 | .map((entry) => { |
| 94 | if (!entry || typeof entry !== "object") { |
| 95 | return null; |
| 96 | } |
| 97 | const record = entry as Record<string, unknown>; |
| 98 | return buildCollabAgentStatus( |
| 99 | record.threadId ?? record.thread_id ?? record.id, |
| 100 | record.status, |
| 101 | record.agentNickname ?? record.agent_nickname ?? record.nickname, |
| 102 | record.agentRole ?? |
| 103 | record.agent_role ?? |
| 104 | record.agentType ?? |
| 105 | record.agent_type ?? |
| 106 | record.role, |
| 107 | ); |
| 108 | }) |
| 109 | .filter((entry): entry is CollabAgentStatus => Boolean(entry)); |
| 110 | } |
| 111 | |
| 112 | function parseCollabAgentStatusesFromMap(value: unknown) { |
| 113 | if (!value || typeof value !== "object" || Array.isArray(value)) { |
no test coverage detected