Optionalstream: stringReadonlyhead: numberThe number of the last event recorded; 0 before the first. The next event gets head + 1.
The kept events after from, oldest first; none for another stream (the viewer started again since).
Keep an event the port took, as the number head + 1; returns that number. Pass the snapshot that was posted
(structuredClone of the caller's payload, taken once before posting), so a resend is exactly the event as
posted, whatever the caller's object does later. Record only after the post succeeded: a post that failed
(or a payload that could not be snapshotted) takes no number and is not kept.
The viewer's side: its stream, the numbers it gives the events it posts on a port, and the last MAX_RESUME_EVENTS of them. Shared by the viewer and
fakeViewer, so both resume the same way.