OptionalobservationRepository: IObservationRepositoryClears all subscriptions. Useful for cleanup.
Retrieves historical observations, optionally filtered by type and thread. Requires an ObservationRepository to be configured.
Optionalfilter: ObservationType | ObservationType[]Optional ObservationType or array of types to filter by.
Optionaloptions: { limit?: number; threadId?: string }Optional threadId and limit.
A promise resolving to an array of observations.
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: Observation, filter?: ObservationType | ObservationType[]) => booleanA function to check if a subscription's filter matches the data.
Notifies subscribers about a new observation.
The observation data.
Subscribes a callback function to receive notifications.
The function to call when new data is notified.
Optionalfilter: ObservationType | ObservationType[]An optional filter to only receive specific types of data.
Optionaloptions: { threadId?: string }Optional configuration, like a threadId for filtering.
An unsubscribe function.
A specialized TypedSocket for handling Observation data. Allows filtering by ObservationType. Can optionally fetch historical observations from a repository.