Skip to content

AgentUiProjectionView

AgentUiProjectionView 是当前 React seed 的组合 surface。它把 projection state 拆给 message、timeline、action、tool、runtime facts、artifact refs、evidence refs、Team Workbench 和 graph 子 surface。

实现锚点:packages/agent-runtime-ui/src/projectionView.tsx

Props

ts
export interface AgentUiProjectionViewProps<TEvent = AgentRuntimeExecutionEvent> {
  state: AgentUiProjectionState<TEvent>;
  artifact?: ReactNode;
  emptyMessages?: ReactNode;
  labels?: AgentUiProjectionViewLabels<TEvent>;
  onResolveAction?: AgentRuntimeActionResolver<TEvent>;
  onSelectArtifactRef?: (ref: AgentUiArtifactRefView) => void;
  onSelectEvidenceRef?: (ref: AgentUiEvidenceRefView) => void;
}
PropTypeDescription
stateAgentUiProjectionState必需,唯一事实输入。
artifactReactNode可选产品 artifact 区域。
emptyMessagesReactNode空消息 presentation。
labelsAgentUiProjectionViewLabelsaria、标题、状态、按钮等 label callbacks。
onResolveActionAgentRuntimeActionResolver用户处理 action 的 callback。
onSelectArtifactRefcallback用户选择 artifact ref 的 callback。
onSelectEvidenceRefcallback用户选择 evidence ref 的 callback。

DOM Contract

根元素带稳定状态属性:

tsx
<section
  className="agent-ui-projection"
  data-runtime-status={state.runtime.status}
  data-hydration-status={state.hydration.status}
>

产品应用可以用这些属性接 design token,但不能据此修改 runtime truth。

Example

tsx
<AgentUiProjectionView
  state={projectionState}
  onResolveAction={(event, action) => {
    runtime.respondAction({
      actionId: event.actionId,
      decision: action.decision
    });
  }}
/>

Layout

RegionContents
.agent-ui-mainUIMessagePartsViewProcessTimelineView
.agent-ui-sidecarsummary、actions、tools、events、artifact/evidence refs、Team Workbench、artifact slot、execution graph

禁止事项

  • 不在组件里创建 runtime client。
  • 不在点击后直接删除 action。
  • 不从 state.readModel.visibleEvents 外的 payload 重算 status。
  • 不把 artifact 子树作为 runtime facts owner。
  • 不在组件里读取 artifact body 或 evidence pack;只通过 callback 交还宿主。

Lime Agent Workbench 是面向 Lime AgentRuntime 与 AgentUI 的治理优先标准。