EventStream
Events after a cursor, as an async iterable. Returned by the stream* methods.
const events = agent.streamEvents({ after: saved });for await (const event of events) await save(event, events.cursor);- Reconnects after any drop and resumes after
cursor. - Throws a
WardrikErrorfor a status below 500. - Deltas and tool progress don't move the cursor, and aren't resent after a reconnect.
wardrik.events.droppedsays the log was trimmed past the cursor.- Never ends by itself. Stop it with
signal.
Implements
Section titled “Implements”AsyncIterable<WardrikEvent>
Properties
Section titled “Properties”opened
Section titled “opened”readonly opened: Promise<void>;Resolves when the stream first opens. Rejects if it can't open.
Accessors
Section titled “Accessors”cursor
Section titled “cursor”Get Signature
Section titled “Get Signature”get cursor(): string | undefined;The cursor to resume after. Save it and pass it back as after.
Returns
Section titled “Returns”string | undefined
Methods
Section titled “Methods”[asyncIterator]()
Section titled “[asyncIterator]()”[asyncIterator](): AsyncGenerator<WardrikEvent>;Returns
Section titled “Returns”AsyncGenerator<WardrikEvent>
Implementation of
Section titled “Implementation of”AsyncIterable.[asyncIterator]