Interface: MessageStore
A pure append-only buffer of raw protocol messages produced by the developer's IO module. The store knows nothing about the v0.9 protocol — it does not parse, process, or interpret messages. It only:
- Stores them in arrival order.
- Notifies subscribers when new ones land.
- Hands the current snapshot back via
getSnapshot()(referentially stable between mutations — required byuseSyncExternalStore).
Protocol-aware processing — surfaces, signals, resources, action
dispatch — is the responsibility of <A2UI> (the renderer component).
Developers who don't want to learn the protocol should use <A2UI>;
developers who do can run their own MessageProcessor against the
snapshot directly.
Properties
getSnapshot
readonlygetSnapshot: () => readonlyServerToClientMessage[]
useSyncExternalStore getSnapshot contract — stable between pushes.
Returns
readonly ServerToClientMessage[]
subscribe
readonlysubscribe: (cb: () =>void) => () =>void
useSyncExternalStore subscribe contract.
Parameters
Returns
() => void
Methods
clear()
clear():
void
Reset the buffer. Notifies subscribers.
Returns
void
push()
push(
message:ServerToClientMessage| readonlyServerToClientMessage[]):void
Append one or more raw messages to the buffer. Notifies subscribers once per call (batches a single array argument into a single notify).
Parameters
Returns
void