AgentHud
仲裁器当前的读数,用一个角色加一块底盘表达。
Nova
只有一个数据源
屏幕上的一切都来自最近的 AgentStateProvider。状态决定脸,tips 变成底盘的补充文字,hud 跟着当前胜出的会话走——所以一个会话发来的倒计时,绝不会留在另一个会话的脸上。底盘等级随状态而定:alerting 和 refusing 是 alert,waiting 和 suspicious 是 warn,happy、proud、celebrate 是 ok,其余是 info。传 level 可以覆盖。
没有 Provider 时组件照样渲染——一个空闲角色、智能体名字、没有表盘——所以页头可以在智能体通道接通之前就先挂载。
useAgentHud
它背后的 hook。从 Provider 读出胜出结果的 hud,没有 Provider 或没有表盘时返回 null,于是想自己排版的宿主可以把同一份 spec 直接放到 CharacterMark 上。
外观
agent 提供形状、墨色、脸型和鼻子,解析方式与 AgentAvatar 相同:先看显式字段,再看 preset,最后由 id 确定性推导。face、nose、lineWeight 会覆盖智能体自己的设定,所以要一个笔画更重的线条脸 HUD,只差一个 prop。线条粗细由鼻子、嘴和表盘共用——见线条脸在各个面上。
API
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
agent | AgentLike | — | Whose face to draw. Without one the character falls back to the default blob. |
className | string | — | — |
face | "cute" | "eyes" | "line" | — | — |
level | HudLevel | — | Override the level the state implies. |
lineWeight | number | — | — |
nose | "slant" | "angular" | "hook" | "long" | "curve" | "bow" | null | — | — |
placement | HudPlacement | 'bottom' | — |
sizePx | number | 72 | — |
style | CSSProperties | — | — |
title | string | — | Heading on the plate. Defaults to the agent's name. |