Build a chat UI adapter on @tanstack/ai-client/ui. That subpath exports the types and selectors. Your adapter adds the components.
Import from @tanstack/ai-client/ui, not from the main client entry:
- selectChatUI: matches tool results to tool calls, and splits list interrupts from inline interrupts.
- partTypeToKey: turns a part type such as tool-call into a map key such as toolCall.
- Option types for tools, generic interrupts, and outputSchema.
- Native components and context.
- Native reactivity.
- Render callbacks, slots, or snippets.
- Development warnings for missing map keys.
Do not add default markup. Do not add a new store. The app owns the chat instance, from useAppChat in createChatHook, or from useChat or createChat.
- Call selectChatUI({ messages, interrupts, inlineToolNames }).
- In automatic traversal, skip a tool-result part only when matched is true. Keep unmatched results.
- Warn once for each missing runtime key in development. Each build tool detects development mode in a different way, so the adapter prints the warning.
- Match the public names of the existing adapters: Chat, Provider, Messages, Message, Part, Interrupts, Interrupt, useChatContext, and createChatHookContexts.
The React, Solid, Vue, Svelte, and Remix adapters show those names in use.