@threadplane/ag-uiTypeAliasv0.3.4

AgUiReplaySource

Loads a thread's AG-UI protocol events from the server, in the order a live stream delivered them, so the adapter can rebuild the thread exactly as the live view showed it.

Return the events as a Promise of an array or as an Observable that completes. Resolve to an empty array when the server has nothing for the thread; reject (or error) for any other failure. signal aborts when the adapter is disposed; honour it to cancel the request.

import type { AgUiReplaySource } from '@threadplane/ag-ui';

Declaration

export type AgUiReplaySource = (threadId: string, signal: AbortSignal) => Promise<readonly BaseEvent[]> | Observable<BaseEvent>;