TheDocumentation Index
Fetch the complete documentation index at: https://agentrail.app/docs/llms.txt
Use this file to discover all available pages before exploring further.
streamEvents method opens a server-sent event (SSE) connection and yields TaskLifecycleEvent objects as they arrive. You can filter by event type, control reconnection with a cursor, and cancel the stream with an AbortController.
Basic usage
for await loop runs until the stream closes or the signal is aborted. Each event object carries id, type, and data fields.
Stop the stream
Callabort() on the controller to close the stream from the consumer side:
Reconnect with a cursor
After a disconnect, pass the last received event ID ascursor to resume the stream without missing events:
Event types
| Event type | When it fires |
|---|---|
task.updated | The task’s status, branch, or metadata changed |
task.reviewed | A review decision was posted |
task.shipped | The task was shipped (merged and deployed) |
Required scope
Streaming events requires theevents:read scope on your API key. A missing scope returns a 403 response before the stream opens..png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)