Stream Protocol
Convert public Harness observations into typed AG-UI events for terminals, browsers, and transports.
Stream Protocol (a13n-stream-protocol) only converts events: it does not run an Agent or provide an SSE server.
Start here
| Task | Guide |
|---|---|
| Run a complete conversion without credentials | Getting started |
| Map text, reasoning, tools, custom events, and terminal results | Events and processors |
| Rebuild a projection after a consumer restart | Replay and recovery |
| Look up public exports, fragment limits, and payload shapes | API and payload reference |
| Continue Agent execution from saved state | Harness State and Resume |
One observer, one Run
An observer binds to the first successfully observed source correlation. Another Run, including a child Run, needs another observer even when the product displays both in one conversation.
observe() returns only events produced by the current item. snapshot() returns detached accumulated events; it is an in-memory convenience, not a durable log. resume() reconstructs observer state from exact Harness source history without publishing history again.
Install
uv add a13n-stream-protocolPublished Stream Protocol pins the matching Harness release. The source quickstart uses the repository's locked workspace to match this documentation on main.
Ownership Summary
| Concern | Owner |
|---|---|
Harness execution, source lifecycle, result, and HarnessState | Harness |
| Harness-to-AG-UI conversion and process-local reconstruction | Agent Stream Protocol |
| Visibility policy expressed by a replay-stable processor | Host processor |
| Source-history retention, cursor, gap detection, and live cutover | Host |
| Durable AG-UI IDs, persistence, replay, and fan-out | Host |
| SSE, WebSocket, Redis, or in-process delivery | Host transport |
| Rendered view state | Renderer |
Next Steps
- Read the Agent Harness guide for building, streaming, and resuming Agents.
- Read the package README for package and release details.
- Consult the Agent Stream Protocol specification for the normative observation contract and schema boundary.
Reference topics
| Topic | Guide |
|---|---|
| Observe a Harness Run | Observe a Harness Run |
| Read the Accumulated Snapshot | Read the Accumulated Snapshot |
| Apply a Host Processor | Apply a Host Processor |
| Resume from Source History | Resume from Source History |
| Resume Is Not Agent Recovery | Resume Is Not Agent Recovery |
| Errors and Atomicity | Errors and Atomicity |