OptionaltaskRepository: IA2ATaskRepositoryClears all subscriptions. Useful for cleanup.
Retrieves historical A2A task events, optionally filtered by criteria. Note: This method constructs events from stored tasks, not from a dedicated event log.
Optionalfilter: A2ATaskFilterOptional A2ATaskFilter to filter the tasks.
Optionaloptions: { limit?: number; threadId?: string }Optional threadId and limit.
A promise resolving to an array of A2A task events.
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: A2ATaskEvent, filter?: A2ATaskFilter) => booleanA function to check if a subscription's filter matches the data.
Convenience method to notify about task completion.
The completed A2A task.
Optionalmetadata: { automatic?: boolean; context?: Record<string, any>; source?: string }Optional additional metadata about the completion.
Optionalautomatic?: booleanWhether this was an automatic update or manual
Optionalcontext?: Record<string, any>Any additional context
Optionalsource?: stringThe component that triggered the update
Convenience method to notify about a task creation.
The newly created A2A task.
Optionalmetadata: { automatic?: boolean; context?: Record<string, any>; source?: string }Optional additional metadata about the creation.
Optionalautomatic?: booleanWhether this was an automatic update or manual
Optionalcontext?: Record<string, any>Any additional context
Optionalsource?: stringThe component that triggered the update
Convenience method to notify about task delegation.
The delegated A2A task.
Optionalmetadata: { automatic?: boolean; context?: Record<string, any>; source?: string }Optional additional metadata about the delegation.
Optionalautomatic?: booleanWhether this was an automatic update or manual
Optionalcontext?: Record<string, any>Any additional context
Optionalsource?: stringThe component that triggered the update
Notifies subscribers about a new A2A task event.
The A2A task event data.
Convenience method to notify about task failure.
The failed A2A task.
Optionalmetadata: { automatic?: boolean; context?: Record<string, any>; source?: string }Optional additional metadata about the failure.
Optionalautomatic?: booleanWhether this was an automatic update or manual
Optionalcontext?: Record<string, any>Any additional context
Optionalsource?: stringThe component that triggered the update
Convenience method to notify about a task update.
The updated A2A task.
OptionalpreviousStatus: A2ATaskStatusThe previous status of the task (if status changed).
Optionalmetadata: { automatic?: boolean; context?: Record<string, any>; source?: string }Optional additional metadata about the update.
Optionalautomatic?: booleanWhether this was an automatic update or manual
Optionalcontext?: Record<string, any>Any additional context
Optionalsource?: stringThe component that triggered the update
Subscribes a callback function to receive notifications.
The function to call when new data is notified.
Optionalfilter: A2ATaskFilterAn 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 A2A task status updates and events. Allows filtering by task status, type, agent, and other criteria. Can optionally fetch historical task data from a repository.