'use client'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { MessageSquare, Zap, Shield, Activity, Brain, Archive, Cpu, ExternalLink, Radio } from 'lucide-react'; const AGENT_META: Record = { LUCIDIA: { icon: Brain, color: '#2979FF', gradient: 'from-[#2979FF] to-violet-600', accent: '#2979FF', type: 'LOGIC', specialty: 'Deep reasoning, synthesis, strategy', skills: ['Reasoning', 'Philosophy', 'Meta-cognition', 'Planning'], node: 'aria64', capacity: 7500, }, ALICE: { icon: Zap, color: '#34d399', gradient: 'from-emerald-400 to-teal-600', accent: '#34d399', type: 'GATEWAY', specialty: 'Task execution, automation, code generation', skills: ['Automation', 'Code Gen', 'File Ops', 'Routing'], node: 'alice', capacity: 7500, }, OCTAVIA: { icon: Cpu, color: '#F5A623', gradient: 'from-amber-400 to-orange-600', accent: '#F5A623', type: 'COMPUTE', specialty: 'Infrastructure, deployment, system monitoring', skills: ['DevOps', 'Deploy', 'Monitoring', 'Scaling'], node: 'aria64', capacity: 22500, }, PRISM: { icon: Activity, color: '#fbbf24', gradient: 'from-yellow-400 to-amber-600', accent: '#fbbf24', type: 'VISION', specialty: 'Pattern recognition, data analysis, trends', skills: ['Analytics', 'Patterns', 'Reporting', 'Anomalies'], node: 'alice', capacity: 5000, }, ECHO: { icon: Archive, color: '#9C27B0', gradient: 'from-purple-400 to-violet-700', accent: '#9C27B0', type: 'MEMORY', specialty: 'Knowledge retrieval, context, memory synthesis', skills: ['Recall', 'Context', 'Synthesis', 'Indexing'], node: 'aria64', capacity: 3000, }, CIPHER: { icon: Shield, color: '#FF1D6C', gradient: 'from-[#FF1D6C] to-red-700', accent: '#FF1D6C', type: 'SECURITY', specialty: 'Security scanning, threat detection, encryption', skills: ['Scanning', 'Auth', 'Encryption', 'Guardrails'], node: 'alice', capacity: 3000, }, }; interface Agent { id: string; name: string; role: string; type: string; status: 'active' | 'idle' | 'offline'; node: string; color: string; } interface AgentData { agents: Agent[]; fleet?: { total_capacity: number; online_nodes: number }; worlds_count?: number; fallback?: boolean; } const TASKS_PER_DAY: Record = { LUCIDIA: 847, ALICE: 12453, OCTAVIA: 3291, PRISM: 2104, ECHO: 1876, CIPHER: 8932, }; export default function AgentsPage() { const [data, setData] = useState(null); const [loading, setLoading] = useState(true); const [filter, setFilter] = useState<'all' | 'active' | 'idle'>('all'); useEffect(() => { async function load() { try { const res = await fetch('/api/agents'); const d = await res.json(); setData(d); } finally { setLoading(false); } } load(); const interval = setInterval(load, 30000); return () => clearInterval(interval); }, []); const agents = data?.agents ?? []; const filtered = filter === 'all' ? agents : agents.filter(a => a.status === filter); if (loading) return (
Connecting to fleet…
); return (
{/* Header */}

Agents

{(data?.fleet?.total_capacity ?? 30000).toLocaleString()} total capacity ·{' '} {data?.fleet?.online_nodes ?? 2} nodes online {data?.fallback && (offline mode)}

{(['all', 'active', 'idle'] as const).map(f => ( ))}
{/* Stats */}
{[ { label: 'Total Capacity', value: '30,000', sub: 'agent slots' }, { label: 'Tasks / Day', value: Object.values(TASKS_PER_DAY).reduce((a,b) => a+b, 0).toLocaleString(), sub: 'combined' }, { label: 'Avg Uptime', value: '99.96%', sub: 'last 30 days' }, { label: 'Worlds Generated', value: data?.worlds_count ? `${data.worlds_count}+` : '60+', sub: 'artifacts' }, ].map(s => (
{s.label}
{s.value}
{s.sub}
))}
{/* Agent Grid */}
{filtered.map(agent => { const meta = AGENT_META[agent.name] ?? {}; const Icon = meta.icon ?? Brain; const tasksDay = TASKS_PER_DAY[agent.name] ?? 0; return (
{/* Top row */}
{agent.status}
{/* Name + type */}

{agent.name}

{agent.role} {meta.type}
{/* Specialty */}

{meta.specialty}

{/* Skills */}
{(meta.skills ?? []).map(skill => ( {skill} ))}
{/* Stats row */}
{tasksDay.toLocaleString()} tasks/day · {(meta.capacity ?? 0).toLocaleString()} slots · {meta.node}
{/* Actions */}
Chat Profile
); })}
Refreshes every 30s · Data from{' '} agents-status.blackroad.io
); }