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

Function parseCollabAgentStatuses

src/utils/threadItems.collab.ts:88–110  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

86}
87
88function 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
112function parseCollabAgentStatusesFromMap(value: unknown) {
113 if (!value || typeof value !== "object" || Array.isArray(value)) {

Callers 1

parseCollabToolCallItemFunction · 0.85

Calls 1

buildCollabAgentStatusFunction · 0.85

Tested by

no test coverage detected