'use client'; import type { AgentRecord, AgentLiveness } from '../../lib/agent-registry'; import { ProjectScopeControls } from '../shared/project-scope-controls'; import type { ProjectScopeOption } from '../../lib/project-scope'; import { AgentStation } from './agent-station'; import { getSwarmHealth } from './sessions-header-logic'; export interface SwarmGroup { swarmId: string; swarmLabel: string; members: AgentRecord[]; } interface SessionsHeaderProps { agents: AgentRecord[]; activeAgentId: string | null; onSelectAgent: (id: string | null) => void; projectScopeKey: string; projectScopeMode: 'single' | 'aggregate'; projectScopeOptions: ProjectScopeOption[]; stats?: { active: number; needsInput: number; completed: number; }; livenessMap?: Record; swarmGroups?: SwarmGroup[]; unassignedAgents?: AgentRecord[]; missionCounts?: Record; } export function SessionsHeader({ agents, activeAgentId, onSelectAgent, projectScopeKey, projectScopeMode, projectScopeOptions, stats, livenessMap = {}, swarmGroups = [], unassignedAgents = [], missionCounts = {}, }: SessionsHeaderProps) { return (
{/* Row 1: Agent Command Deck */}

Command

OPERATIVES

{swarmGroups.length > 0 || unassignedAgents.length > 0 ? (
{swarmGroups.map((group) => { const health = getSwarmHealth(group.members, livenessMap); return (
{group.swarmLabel} {health.status}
{group.members.map((agent) => ( ))}
); })} {unassignedAgents.length > 0 && (
No Swarm
{unassignedAgents.map((agent) => ( ))}
)}
) : ( agents.map((agent) => ( )) )}
{/* Row 2: Management & Meta */}
Load Pulse {stats && (
)}
); } function StatPill({ label, value, color }: { label: string, value: number, color: string }) { return (
{label} {value}
); }