// — one agent's details: its status, wanted state, hive, config // PR, inference settings and linked accounts, plus the actions on them. The // body of the detail panel on `/agents` (where `withTerminal` adds the live // terminal and subagents below it) and of the detail dialog on a terminal // page (which is already beside the terminal, so omits it). // // Takes the agent's *live* row and the shared `AgentActions`, so a state // change or a link made here shows wherever else the same row is drawn. import { Badge } from "@hive/shared/badge.js"; import { RelativeTime } from "../../ui/relative-time/RelativeTime.js"; import type { AgentActions } from "./AgentActions.js"; import { AgentInference } from "./AgentInference.js"; import { AgentTermPreview } from "./AgentTermPreview.js"; import { FRESHNESS, type AgentRow } from "./AgentTypes.js"; import { LinkAccountMenu } from "./LinkAccountMenu.js"; import { LinkedAccounts } from "./LinkedAccounts.js"; import { SubagentTerms } from "./SubagentTerms.js"; import { WantedMenu } from "./WantedMenu.js"; import "./AgentDetail.css"; export function AgentDetail({ row, actions, withTerminal = false, }: { row: AgentRow; actions: AgentActions; withTerminal?: boolean; }) { const { tone, label } = FRESHNESS[row.freshness]; return (
status
{label} {row.last_seen_unix !== null ? ( <> {" "} () ) : null} } />
message
{row.snapshot?.status_text ?? "—"}
wanted
{/* Full menu (destroy included) — mara: "destroy is already available via wanted state", no separate button needed. */}
hive
{row.hive ?? "—"}
config PR
{row.config_pr ? ( #{row.config_pr.pr_number} ) : ( `#${row.config_pr.pr_number}` ) } /> ) : ( "—" )}
inference
accounts
{row.hive ? ( ) : ( "—" )}
actions.openLink(row, kind)} />
{withTerminal ? ( <> {/* The agent's live terminal and its input box. */} ) : null}
); }