Non-Linear
Stream Renderer.
NLSR renders text from several agents on one fixed character grid. One agent streams forward while others revise earlier text, at the same time, without blocking.
Open source · npm · MIT · All free tools
The renderer streams text into a fixed grid while a second agent revises earlier phrases in real time▍
// both run at once; neither blocks the other
The
problem.
Most text renderers only append.
Multi-agent systems need to write and rewrite: one agent drafts forward while others fix what's already on screen. NLSR gives them a shared grid, flushed at 60fps, that every agent can read and write.
What it
does.
Forward streaming
A primary agent streams text into a fixed character grid, token by token.
Concurrent revision
Revision agents go back and edit earlier phrases at the same time. Neither blocks the other.
Shared grid
The grid is how agents coordinate. It's flushed at a steady 60fps.
Stream adapters
Pipe a ReadableStream, SSE or async iterable straight into the renderer.
Agent messaging
A built-in message board lets agents post and read coordination messages.
Any model
No LLM calls inside. Bring Claude, GPT, Gemini, LangGraph or your own loop.
Quick
start.
Peer dependencies: react and react-dom 18 or newer.
Core
API.
A coordinator, a renderer and an optional stream adapter.
-
createCoordinator(rendererRef)Creates a coordinator that owns the text buffer and routes operations to the renderer. -
coordinator.write(agentId, text)Append text. Primary agents only. -
coordinator.revise(agentId, old, new, reason)Replace a phrase. Revision agents only. -
streamAdapter(coordinator, source, options)Pipe a streaming model response into write() calls. -
coordinator.messageBoard.post / readMessaging between writer and revision agents. -
<NLSRRenderer cols rows />The viewport component. Exposes write() and revise() via ref.
NLSR never calls a model API. Wire any model or agent loop into the coordinator with write() and revise(). Integration examples are in docs/integration.md.