Clears all subscriptions. Useful for cleanup.
OptionalgetOptional: Retrieves historical data. This base implementation is empty. Subclasses might implement this by interacting with repositories.
Optional_filter: StreamEventTypeFilterOptional_options: { limit?: number; threadId?: string }Notifies all relevant subscribers with new data.
The data payload to send to subscribers.
Optionaloptions: { targetSessionId?: string; targetThreadId?: string }Optional targeting options (e.g., targetThreadId).
OptionalfilterCheck: (data: StreamEvent, filter?: StreamEventTypeFilter) => booleanA function to check if a subscription's filter matches the data.
Notifies subscribers about a new LLM stream event. Filters based on event type if a filter is provided during subscription.
The StreamEvent data.
Subscribes a callback function to receive notifications.
The function to call when new data is notified.
Optionalfilter: StreamEventTypeFilterAn optional filter to only receive specific types of data.
Optionaloptions: { threadId?: string }Optional configuration, like a threadId for filtering.
An unsubscribe function.
A dedicated socket for broadcasting LLM stream events (
StreamEvent) to UI subscribers. Extends the generic TypedSocket and implements filtering based onStreamEvent.type.