@threadplane/ag-uiFunctionv0.3.4

httpReplay

A replay source for the common HTTP shape: GET url(threadId) answering JSON { events: BaseEvent[] }.

A 404 resolves to no events, so the adapter falls back to persistence (or starts empty). Any other non-2xx status, a body without an events array, or an entry without a string type rejects; the adapter treats that as a failed replay and falls back the same way.

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

Declaration · overload 1

export declare function httpReplay(options: HttpReplayOptions): AgUiReplaySource;

Parameters

options · required
HttpReplayOptions

Returns

AgUiReplaySource

Examples

provideAgent({
  url: '/api/agent',
  threadId,
  replay: httpReplay({ url: (id) => `/api/threads/${encodeURIComponent(id)}/events` }),
});