@texuli/player · streaming mode · in development · on npm from 0.6.0

Watch an agent's draft paint as it streams

An agent writes a blueprint token by token. In streaming mode the player paints each node as soon as it is complete and checked, instead of waiting for the whole draft, and adds speed without adding trust: the complete draft still passes the full validation before anything is armed. Streaming mode is in development and in @texuli/player from 0.6.0, a pre-1.0 release.

This playground replays recorded drafts in your browser: no network request, no model and no key. The agent service that streams real drafts is in the repository and is not deployed, so texuli.com runs no model.

Stream a recorded draft

Pick a draft and a speed, press Start, and pause or step one chunk at a time to see a node wait as a skeleton, then paint. Drop the connection to see what stays.

Recorded draft

The recorded answer to “Build a weekly report for the fictional Harbor support team.” Every node passes its checks and paints as soon as its shell is complete.

Speed
0 of 268
Phase
not started
Painted
0
Held
0
Bytes read
0

Press Start to stream the recorded draft into the player.

What happened

Nothing yet.

How a node goes from bytes to paint

  1. Bytes arrive

    The agent writes the blueprint as JSON text. Chunks split anywhere, even inside a word or a number.

  2. A skeleton holds the place

    A node whose shell is still arriving shows a static skeleton of its catalog family: no content, no spinner, nothing to focus.

  3. The shell is checked

    Once a node’s members before children are final, it passes the same node-level rules as a whole draft: closed id and props, the URL policy at the untrusted tier, the sink scan.

  4. It paints, or it is held

    A node that passes paints at once. A node that fails is held with its subtree, as a static note; its props never reach the screen.

  5. The final verdict

    When the stream completes, the whole draft is validated again. Only a valid draft is armed; a refused one replaces the paint with the refusal notice.

While the stream is open the surface is busy and inert: nothing to focus, nothing to activate, and no action runs until the complete draft passes validation. The player announces progress politely, at most every few seconds, never once per node.

What the replay is

Each draft is one blueprint envelope, written the way the agent service streams it (its header first, then the model's tree, children last) and cut into chunks of 7, 13, 4, 19, 9, 23, 5, 11, 16, 3 characters, in turn, so every replay is the same. The weekly report is the agent service's recorded answer to its first preset prompt. Reduced motion, from your system or the checkbox, is passed to the player: nodes appear in place and nothing on this page glides.

In code

import { Player } from '@texuli/player';
import { createBlueprintStream } from '@texuli/spec/stream';

let stream = $state(createBlueprintStream());
agent.onDelta((text) => stream.write(text));
agent.onDone(() => stream.end());
agent.onError(() => stream.abort('The agent stopped.'));

<Player {stream} onStreamRetry={() => (stream = createBlueprintStream())} />

Read more

The site does not render the package docs yet. Read them in the repository, or try a whole draft in the playground.

  • Streaming mode: packages/player/docs/streaming.md
  • The agent service: apps/agent/README.md
  • Streaming decision (ADR-014): docs/DECISIONS.md