AI agent thread
Shown as Kestrel, a made-up product
A conversation with an on-call agent working a live incident: your question settles at the top while the reply streams in with its reasoning, tool calls and an answer whose citations light up the output they came from. It follows the reply only while you stay at the live edge.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/kestrel-thread.json?token=…"Adds the piece to components/propui/08-kestrel-thread/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- An agent or assistant thread where each answer is worked out from tools: logs, queries, deploys, searches.
- Any chat where long replies stream in and people scroll back to check earlier answers while the next one arrives.
- Incident, support or ops tools where an answer has to show the evidence it rests on.
Something else fits when
- A one-shot question and answer with no history: a single prompt field with a result card is simpler.
- A chat between people: a messaging thread with avatars, read receipts and timestamps fits better.
- Long documents the agent writes: an editor with a side panel keeps the thread from scrolling past the work.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/08-kestrel-thread/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace SCRIPT, FALLBACK, AGENT and INCIDENT in data.ts. Each scripted turn is a prompt and its parts: reasoning, tool calls and the reply. To use a real model, append the parts as they arrive instead of streaming them from the script.
Your data
Replace these and everything on screen follows.
SCRIPT{ prompt; parts: Part[] }[]- The questions the thread knows and how each reply streams.
Part{ kind: "reasoning"; text } | { kind: "tool"; name; input; head; rows; ms } | { kind: "text"; text }- One step of a reply: the thinking, a tool call with its output table, or the answer.
FALLBACKPart[]- The reply to anything that is not in the script.
AGENT, INCIDENT{ name; role; service }, { id; title; sev; opened }- The header and the empty state.
Interactions
- Send a question: it settles near the top of the thread and the reply streams in under it.
- Scroll up while a reply streams: the thread stops following, and Jump to latest brings you back and resumes.
- Hover or focus a numbered citation to light up and open the tool output it came from.
- Open a reasoning step or a tool call to read it; earlier turns fold their tool calls away.
- Stop a reply, copy a finished one, or reset the conversation.
- When a reply ends, the field fills with the next scripted question; anything else gets the fallback.
Keyboard
- Enter
- Send the message.
- Shift+Enter
- Add a new line.
- Esc
- Stop the reply that is streaming.
- ↑orPageUporHome
- In the thread, scroll back; it stops following the reply.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- The thread is a log with aria-live polite and aria-busy while a reply streams.
- Reasoning and tool calls are buttons with aria-expanded; citations are buttons named Source 1, Source 2.
- Tool output is a real table with column headers.
- The field has a label; Send and Stop are named buttons, and Send is disabled while the field is empty.
- Half-typed markup never shows while a reply streams: an open bold or code span is closed as it types.
Motion
- A new question glides to its anchor; following the reply is instant, so the text never lags behind.
- Thinking shimmers, a running tool shows a spinner and a skeleton, and the caret blinks at the end of the reply.
- Reasoning and tool output open and fold with a short height ease; Jump to latest rises in.
- Reduced motion jumps instead of gliding, streams in larger steps and stops the shimmer, spinner, skeleton and caret.
Responsive
- The card is at most 760px wide and fills the window's height, with the thread scrolling inside it.
- At 640px and below the card goes nearly edge to edge, the incident title and Reset label hide, and replies use the full width.
- At 380px and below the agent's role and the severity hide from the header.
Performance
- Streaming is one 24ms interval that only runs while a reply is streaming.
- Following and the jump button read layout once per update; nothing animates on scroll.
- One local font file; no images.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every number in a reply taken from that turn's tool output, and cite it with [n] in tool order.
- The latest turn has a minimum height of the thread's height so its question can always reach the top; keep that when changing the layout.
- Every class is prefixed ks- and scoped under .ks; keep colours in the tokens at the top of post.css.
/p/kestrel-thread/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.