Playground

The wire bench

A prompt, a stop reason, and whether the turn shows a tool call. What comes out is written by this library running in the page — its own encoders, built from the same source as the one the server uses — so the shapes below are the shapes that would travel.

Everything is recomputed as you change it. Nothing leaves the page.

The editor sends


            

The agent streams

The turn ends


            

The frames they travel in

What this is doing

The page imports the library compiled to JavaScript and calls one function: preview(settings) hands back the JSON text of each message. The prompt is a Prompt value, the stream is a SessionUpdate, the ending is a PromptResult — each encoded by the ToJson the library already carries for it, and the stop reason read back through the library's own decoder, so an unknown name is the library's answer rather than the page's.

The frames at the bottom are what the remote transport writes: the message after data: , a blank line after it. That is the whole of what a stream carries between two parties — nothing is added on the way.