diff --git a/src/components/panels/agent-squad-panel-phase3.tsx b/src/components/panels/agent-squad-panel-phase3.tsx index 8905d31..97b827c 100644 --- a/src/components/panels/agent-squad-panel-phase3.tsx +++ b/src/components/panels/agent-squad-panel-phase3.tsx @@ -65,6 +65,13 @@ const statusColors: Record = { error: 'bg-red-500', } +const statusBadgeStyles: Record = { + offline: 'bg-slate-500/15 text-slate-300 border-slate-500/30', + idle: 'bg-emerald-500/15 text-emerald-300 border-emerald-500/30', + busy: 'bg-amber-500/15 text-amber-300 border-amber-500/30', + error: 'bg-rose-500/15 text-rose-300 border-rose-500/30', +} + const statusIcons: Record = { offline: '-', idle: 'o', @@ -494,6 +501,17 @@ function AgentDetailModalPhase3({ const [heartbeatData, setHeartbeatData] = useState(null) const [loadingHeartbeat, setLoadingHeartbeat] = useState(false) + const formatLastSeen = (timestamp?: number) => { + if (!timestamp) return 'Never' + const diffMs = Date.now() - (timestamp * 1000) + const diffMinutes = Math.floor(diffMs / (1000 * 60)) + const diffHours = Math.floor(diffMs / (1000 * 60 * 60)) + if (diffMinutes < 1) return 'Just now' + if (diffMinutes < 60) return `${diffMinutes}m ago` + if (diffHours < 24) return `${diffHours}h ago` + return new Date(timestamp * 1000).toLocaleDateString() + } + // Load SOUL templates useEffect(() => { const loadTemplates = async () => { @@ -593,44 +611,71 @@ function AgentDetailModalPhase3({ } const tabs = [ - { id: 'overview', label: 'Overview', icon: '#' }, - { id: 'soul', label: 'SOUL', icon: '~' }, - { id: 'memory', label: 'Memory', icon: '@' }, - { id: 'tasks', label: 'Tasks', icon: '+' }, - { id: 'config', label: 'Config', icon: '*' }, - { id: 'activity', label: 'Activity', icon: '>' } + { id: 'overview', label: 'Overview', icon: 'O' }, + { id: 'soul', label: 'SOUL', icon: 'S' }, + { id: 'memory', label: 'Memory', icon: 'M' }, + { id: 'tasks', label: 'Tasks', icon: 'T' }, + { id: 'config', label: 'Config', icon: 'C' }, + { id: 'activity', label: 'Activity', icon: 'A' } ] return ( -
-
+
+
e.stopPropagation()} + > {/* Modal Header */} -
-
-
-

{agent.name}

-

{agent.role}

+
+
+
+ +
+

{agent.name}

+

{agent.role}

+
+ + + {agent.status} + + + Last seen {formatLastSeen(agent.last_seen)} + + {agent.session_key && ( + + Session active + + )} +
+
-
- {agent.status} - +
{/* Tab Navigation */} -
+
{tabs.map(tab => ( ))}