{
"pair": "sol-perp",
"depth": 5
}{
"mid": 184.21,
"ask1": 184.22,
"bid1": 184.2
}AG-UI is the third leg of MCP / A2A / AG-UI — a 17-event SSE stream that flows from an agent backend to a UI. @zero/agent-streamships a pure reducer that folds the stream into a typed AgentSession; the brand's existing primitives render every part of the session without a generic chat shell. the run below was reduced at build time from a frozen fixture · 28 events · 4 steps · 4 tool calls · 1 approval.
| group | event | reducer effect |
|---|---|---|
| run lifecycle | run.started · run.finished · run.cancelled | set runId + status |
| message lifecycle | message.start · message.delta · message.end | append + concat into messages[] with streaming flag |
| tool lifecycle | tool.start · tool.result | append + resolve into toolCalls[] |
| state patch | state.snapshot · state.delta | RFC 6902 patch into state |
| step lifecycle | step.start · step.delta · step.end | append + status-progress into steps[] |
| approval (ADR-029 · confirm) | approval.request · approval.resolve | append + resolve into approvals[] |
| terminal | error | set status='error' |
{
"pair": "sol-perp",
"depth": 5
}{
"mid": 184.21,
"ask1": 184.22,
"bid1": 184.2
}{
"account": "paper-0"
}{
"remainingPct": 0.83
}{
"oid": "o-9412",
"newStop": 188.06
}{
"rotatedOid": "o-9418"
}{
"pair": "doge-perp"
}model · gpt-5.1 · 2026-04 inputs · book(sol-perp) · risk(remaining 0.83) · funding(doge-perp +0.046) plan observe · book + funding skew read across 6 paper coins decide · sol-perp short reduce 0.7x → 0.4x · risk delta -0.012 event · stop replaced atomically · oid rotated · cancel-replace single tx refuse · doge-perp drawdown gate · funding skew exceeds 0.04 ceiling output · 1 reduce, 1 cancel-replace, 1 refuse · all signed · 0 unsigned
sol-perp reduced. doge-perp refused. journal signed.
sol-perp · book + funding skew read · t-0
◆ ev0001reduce sol-perp short · 0.7x → 0.4x · all gates passed
◆ ev0002stop replaced atomically · oid o-9412 → o-9418
◆ ev0003doge-perp · drawdown gate · funding skew above ceiling
◆ ev0004journal signed · sol-perp delta booked
◆ ev0005all gates passed · 3/3 risk · 1/1 liquidity · 0 drift
applyEvents(INITIAL_SESSION, FIXTURE)is pure. SSR runs the reducer once at build time and the resulting AgentSession drives every primitive on this page · PlanSurface · ToolCallCard · ApprovalGate · AsyncTask · ReasoningReveal · StreamingCursor · EvidenceTrail · ConfidenceArc · CostMeter · SafetyShield · TickStream · Receipt. switching to a real SSE source means swapping FIXTURE for useAgentStream(url) · the renders never change shape.◆ run001a replay-safe