Fix TypeScript errors in TeamHuddleWidget after merge
This commit is contained in:
@@ -139,20 +139,20 @@ const TeamHuddleWidget: React.FC = () => {
|
|||||||
|
|
||||||
const runByAgent = new Map<string, string>();
|
const runByAgent = new Map<string, string>();
|
||||||
runsPayload.forEach((run: Record<string, unknown>) => {
|
runsPayload.forEach((run: Record<string, unknown>) => {
|
||||||
const key = normalizeAgentKey(run.agent_key || run.agent || run.agent_id || '');
|
const key = normalizeAgentKey((run.agent_key || run.agent || run.agent_id || '') as string);
|
||||||
if (!key || runByAgent.has(key)) return;
|
if (!key || runByAgent.has(key)) return;
|
||||||
|
|
||||||
runByAgent.set(
|
runByAgent.set(
|
||||||
key,
|
key,
|
||||||
run.summary || run.context || run.activity || run.status_message || 'Working on recent tasks'
|
(run.summary || run.context || run.activity || run.status_message || 'Working on recent tasks') as string
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const normalizedAgents: AgentCard[] = statusPayload.map((agent: Record<string, unknown>, index: number) => {
|
const normalizedAgents: AgentCard[] = statusPayload.map((agent: Record<string, unknown>, index: number) => {
|
||||||
const rawKey = agent.key || agent.agent_key || agent.id || agent.name || `agent-${index}`;
|
const rawKey = (agent.key || agent.agent_key || agent.id || agent.name || `agent-${index}`) as string;
|
||||||
const normalizedKey = normalizeAgentKey(rawKey);
|
const normalizedKey = normalizeAgentKey(rawKey);
|
||||||
const meta = AGENT_META[normalizedKey] || {
|
const meta = AGENT_META[normalizedKey] || {
|
||||||
name: agent.display_name || agent.name || rawKey,
|
name: (agent.display_name || agent.name || rawKey) as string,
|
||||||
role: 'AI Agent',
|
role: 'AI Agent',
|
||||||
icon: AgentIcon,
|
icon: AgentIcon,
|
||||||
color: '#64748b'
|
color: '#64748b'
|
||||||
@@ -160,14 +160,14 @@ const TeamHuddleWidget: React.FC = () => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: String(rawKey),
|
id: String(rawKey),
|
||||||
name: agent.display_name || meta.name,
|
name: (agent.display_name || meta.name) as string,
|
||||||
role: agent.role || meta.role,
|
role: (agent.role || meta.role) as string,
|
||||||
status: normalizeStatus(agent.status || agent.operational_status || ''),
|
status: normalizeStatus((agent.status || agent.operational_status || '') as string),
|
||||||
current_activity:
|
current_activity:
|
||||||
agent.current_activity ||
|
(agent.current_activity ||
|
||||||
runByAgent.get(normalizedKey) ||
|
runByAgent.get(normalizedKey) ||
|
||||||
agent.last_message ||
|
agent.last_message ||
|
||||||
'Waiting for next instruction',
|
'Waiting for next instruction') as string,
|
||||||
icon: meta.icon,
|
icon: meta.icon,
|
||||||
color: meta.color
|
color: meta.color
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user