generative-a11y
assistant-ui

bindThread

Connect one assistant-ui ThreadRuntime and send its public events to a core runtime supplied by your app.

Signature and import

Create one binding per thread scope and dispose it when that subscription owner unmounts.

import { bindThread } from "@generative-a11y/assistant-ui";

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

// Removes only the subscription and adapter state.
binding.dispose();

Walkthrough

Use the app runtime

ThreadBinding sends events to core without disposing your runtime.

Separate thread IDs

scopeId prevents ID collisions across mounted conversations.

Read public thread state

ThreadBinding needs only getState and subscribe from ThreadRuntime.

Dispose the binding

dispose removes the subscription without changing the thread runtime.

Prop

Type

Events reported from thread state

Each public thread snapshot is compared with its previous value, and confirmed changes become events.

assistant-ui stategenerative-a11y eventSource
Assistant message starts runningresponse.startedPublic message state
Text growsresponse.text.deltaNew text only
Message finishes, stops, or failscompleted, interrupted, failedPublic message status
Tool call and result partstool lifecyclePublic content parts
Approval stateapproval requested or resolvedPublic content parts
Source partscitation.availableOptional content parts