OptionalconversationRepository: IConversationRepositoryClears all subscriptions. Useful for cleanup.
Retrieves historical messages, optionally filtered by role and thread. Requires a ConversationRepository to be configured.
Optionalfilter: MessageRole | MessageRole[]Optional MessageRole or array of roles to filter by.
Optionaloptions: { limit?: number; threadId?: string }Optional threadId and limit.
A promise resolving to an array of messages.
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: ConversationMessage, filter?: MessageRole | MessageRole[]) => booleanA function to check if a subscription's filter matches the data.
Notifies subscribers about a new conversation message.
The conversation message data.
Subscribes a callback function to receive notifications.
The function to call when new data is notified.
Optionalfilter: MessageRole | MessageRole[]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 ConversationMessage data. Allows filtering by MessageRole. Can optionally fetch historical messages from a repository.