AI SDK

@generative-a11y/ai-sdk

Turn documented AI SDK useChat state and callbacks into generative-a11y events.

Public APIs used

AI SDK adapters read documented messages, status, and error state. onFinish and onError report final response state.

SurfaceExportsUse
Framework-neutralcreateObserver, composeChatCallbacksCustom subscription or state bridge
ReactuseChatAccessibility, useObserveChatAccessibilityAI SDK useChat components
MetadataCHAT_ADAPTER_METADATASupported events and framework APIs

Runtime and app ownership

Your app owns the core runtime. Adapters report events without running chat actions or reading rendered messages and private AI SDK fields.

  • scopeId separates response and message IDs across chat instances.
  • Tool arguments do not mean that execution started.
  • Your onFinish and onError callbacks remain intact.
  • Disposing the observer clears only records created by the adapter.