What problem does it solve?
assistant-ui-runtime helps you correctly manage Assistant UI runtime state—threads, messages, and events—so your app stays in sync while chat is running, edited, canceled, or regenerated.
Core Features & Use Cases
- Runtime hierarchy you can reason about: Manage thread lists and the active thread, including per-composer input state and per-message content parts.
- Modern state access API: Use
useAui, useAuiState, and useAuiEvent to read state safely and react to lifecycle events like message sends and run start/end.
- Deterministic thread & message operations: Append messages, cancel runs, edit/reload messages, and inspect capabilities (cancel/edit/reload/copy/speak/attachments).
- Reference-backed adapter patterns: Use documented approaches for local runtime (custom model adapters) and external store runtime (Redux/Zustand/custom message stores) while keeping the UI operational.
Quick Start
Use the assistant-ui runtime hooks to read thread.messages and thread.isRunning, then append a user message and listen for composer.send to confirm it was submitted.