AI chat primitives
A native-ESM port of assistant-ui's composable chat primitives — Thread, Message, Composer, and ActionBar — talking to the streaming POST /api/assistant endpoint over SSE. No React, no bundler, zero dependencies.
With no AKURAI_LLM_URL configured, the server emits an SSE
error event — the assistant turn renders that inline so the demo
still works. Open DevTools → Console for [chat] breadcrumbs.
What you're looking at
Each turn auto-scrolls; scroll up and a "↓" button appears to jump back. Assistant text renders as Markdown (bold, lists, code). Hover a message for copy / retry / edit actions.
The composer supports Enter-to-send, Shift+Enter for a newline, an attachment button, and — in browsers with the Web Speech API — a 🎤 dictation button.
Endpoint contract
POST /api/assistant → text/event-stream:
delta— token text, appended livetool_call— JSON, emitschat:toolcallfor tool-UI renderingdone— end of turnerror— shown inline