We created the streams to make it easier to build apps that stream data from an llm to the client, but they’re fundamentally a single-writer, multiple-reader data structure.
The pointer events are stored as json lines in the stream, and then the replay reconstructs shapes from the events as they get played back.
The code lives at https://github.com/instantdb/inkdot