@threadplane/ag-uiInterfacev0.3.4

ToAgentOptions

Options for adapting an AG-UI agent, including replay, interrupt persistence and transport, telemetry, and A2UI capabilities.

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

Declaration

export interface ToAgentOptions  {
  a2uiClientCapabilities?: {
        supportedCatalogIds: string[];
        inlineCatalogs?: unknown[];
    };
  interruptTransport?: InterruptTransport;
  persistence?: AgUiInterruptPersistence;
  replay?: AgUiReplaySource;
  telemetry?: AgentRuntimeTelemetrySink | false;
}

Members

a2uiClientCapabilities

A2UI client capabilities (catalog negotiation) to advertise to the agent. When set, they are seeded once into the AG-UI shared state under the a2ui_client_capabilities key, so every RunAgentInput.state carries them. Use @threadplane/chat's a2uiClientCapabilities() for the renderer's standard value.

a2uiClientCapabilities?: {
        supportedCatalogIds: string[];
        inlineCatalogs?: unknown[];
    };

interruptTransport

Native outcomes take precedence in auto mode; select a legacy profile explicitly when required.

interruptTransport?: InterruptTransport;

persistence

Application-owned durable storage. Requires a stable source threadId and scoped namespace.

replay

Loads the thread's AG-UI events from the server when the adapter hydrates.

The replayed events are folded through the same reducer a live run uses, so messages, tool calls, reasoning, subagent nesting and pending interrupts come back as the live view showed them, and each event is emitted on rawEvents$. Replay wins whenever it returns at least one event; an empty result, a failure, or events that cannot be folded fall back to persistence (or an empty thread). Failures never reject ready. The request is aborted when the adapter is disposed. See httpReplay() for the common HTTP shape.

telemetry

Omit to enable automatic development-only collection. Set false to disable. An app-owned sink replaces the automatic destination and receives the existing runtime lifecycle callbacks.

telemetry?: AgentRuntimeTelemetrySink | false;