generative-a11y

@generative-a11y/assistant-ui

Turn public assistant-ui ThreadRuntime state into response, tool, approval, and source events.

Connect your runtime

Pass your existing thread and core runtime. The binding observes public state and callbacks; your app owns execution and browser delivery.

thread-accessibility.ts
import { bindThread } from "@generative-a11y/assistant-ui";

const binding = bindThread({ runtime, scopeId: "support-thread", thread });

// Call binding.dispose() when the owning scope ends.

See bindThread for options and the integration guide for setup and compatibility.

Public exports

assistant-ui integration uses only getState and subscribe from your ThreadRuntime.

ExportKindPurpose
bindThreadFunctionCreate one adapter subscription
adapterInfoFrozen constantList supported events and methods
BindThreadOptionsInterfaceOptions for the binding
ThreadBindingInterfaceCleanup method for the binding

Events the adapter can report

Public thread state can report interruptions but not general retries or connection changes. Tool failures and sources depend on content parts from assistant-ui.

Missing events are never guessed from rendered text, timing, or private runtime fields.

Localized announcements

See catalogs and adapter copy for the typed messages and copy options, language ownership, validation, construction lifetime, and replay requirements. Existing lifecycle evidence and timing remain unchanged.

Public declarations: @generative-a11y/assistant-ui

All exported values and types for this entry point. Import these names from @generative-a11y/assistant-ui; the signatures below are reference material, not a replacement for the ownership and lifecycle guidance above.

adapterInfo — value
declare const adapterInfo: AdapterInfo;
AdapterInfo — type
interface AdapterInfo {
    readonly name: "assistant-ui";
    readonly fidelity: Readonly<Omit<AdapterFidelity, "optionalEvents">> & {
        readonly optionalEvents: readonly NonNullable<AdapterFidelity["optionalEvents"]>[number][];
    };
    readonly observedRuntimeMethods: readonly [
        "getState",
        "subscribe"
    ];
}
bindThread — value
/**
 * Subscribes to the documented public assistant-ui thread runtime. It only
 * reads snapshots; disposing the returned binding never disposes either host runtime.
 */
declare function bindThread(options: BindThreadOptions): ThreadBinding;
BindThreadOptions — type
interface BindThreadOptions {
    /** Host-owned localized copy, captured and validated at construction. */
    readonly copy?: AdapterCopy;
    readonly runtime: Pick<Runtime, "dispatch">;
    readonly scopeId: string;
    readonly thread: ThreadRuntimeSource;
    readonly maxTrackedEntities?: number;
}
ThreadBinding — type
interface ThreadBinding {
    dispose(): void;
}
ThreadRuntimeSource — type
type ThreadRuntimeSource = Pick<ThreadRuntime, "getState" | "subscribe">;