// — an agent's open todos, in the details' **activity** section: what each // says, which subsystem raised it and since when. The list is // `GET /api/agents/{name}/todos` (`useAgentTodos`), which swarm-controller reads // from what the agent's harness published. Read-only. // // Mount it keyed by agent name: the refresh timer is armed once per mount. import { ApiErrorPanel } from "@hive/shared/api-error-panel.js"; import { CappedRows } from "../../ui/capped-rows/CappedRows.js"; import { Hint } from "../../ui/hint/Hint.js"; import { RelativeTime } from "../../ui/relative-time/RelativeTime.js"; import { todosLabel } from "./agent-todos.js"; import { useAgentTodos } from "./useAgentTodos.js"; import "./AgentTodos.css"; export function AgentTodos({ agentName }: { agentName: string }) { const { todos, error } = useAgentTodos(agentName); return (
{error && ( )} {todos === null ? ( error ? null : ( … ) ) : todos.length === 0 ? ( {todosLabel(todos)} ) : ( <>

{todosLabel(todos)}

{(shown) => (
    {shown.map((t) => (
  • {t.subsystem} {t.summary}
  • ))}
)}
)}
); }