import { useAgent } from "../hooks/useAgents"; import { agentFingerprint } from "../lib/agentIdentity"; import { AgentIdenticon } from "./AgentIdenticon"; import { formatRelative } from "./TaskDetailFields"; import { Button } from "./ui/button"; import { Separator } from "./ui/separator"; import { Sheet, SheetContent, SheetDescription, SheetTitle } from "./ui/sheet"; import { Skeleton } from "./ui/skeleton"; interface AgentProfileProps { agentId: string; onClose: () => void; onTaskClick: (taskId: string) => void; } const actionStyles: Record = { claimed: "text-accent", assigned: "text-accent", completed: "text-success", released: "text-warning", timed_out: "text-error", }; export function AgentProfile({ agentId, onClose, onTaskClick }: AgentProfileProps) { const { agent, loading } = useAgent(agentId); return ( { if (!open) onClose(); }} > Agent profile Agent details and activity {loading ? (
) : !agent ? (

Agent not found.

) : ( (() => { const schedulable = agent.status.schedulable; const tasks = agent.status.tasks; return ( <>

{agent.name}

{schedulable ? "Schedulable" : "Not schedulable"}
{agent.fingerprint && ( {agentFingerprint(agent.fingerprint)} )}
Active
{tasks.in_progress + tasks.in_review}
Todo
{tasks.todo}
Activity
{(agent.logs || []).map((log: any) => (
{formatRelative(log.created_at)} {log.action} {log.task_title && ( )}
))} {(!agent.logs || agent.logs.length === 0) &&

No activity yet.

}
); })() )}
); }