An adapter turns what your agent SDK streams into run events, so every Knowns UI view shows the live run. The event model and the run store are Free; the adapters are Pro.
On this page
The event model
Every view reads one run store. An adapter's only job is to turn what your agent SDK streams into run events: actor for each agent and tool, span.start / span.end for each call, task.start / task.end for larger steps, and approval.request when the agent asks before it acts. Decisions made in the browser come back as approval.resolve.
What ships
| Item | Tier | What it does |
|---|---|---|
| adapter-stream | Pro | Streams run events from a server route to the browser (NDJSON or SSE), reads them into a run, and sends Allow / Deny back. Shared tool labels and model pricing. |
| adapter-claude-agent-sdk | Pro | The Claude Agent SDK's query() stream as run events: subagents, tool calls, permission requests and cost. |
| adapter-ai-sdk | Pro | An AI SDK stream (streamText or ToolLoopAgent parts, or UI message chunks) as run events: steps, tool calls, approvals, usage and sub-agents. |
| adapter-openai-agents | Pro | An OpenAI Agents SDK stream as run events: agent updates, handoffs, tool calls, approvals and resumes, guardrail tripwires and usage. |
Wiring for each SDK: Claude Agent SDK, Vercel AI SDK, OpenAI Agents.
Stream to the browser
Every adapter turns SDK messages into run events on the server. adapter-stream carries them to the browser: the server writes one event per line, the client reads them into a run, and decisions made in the browser go back with forwardDecisions.
// Browser: read a stream of run events into a run, and send Allow / Deny back.
import { useEffect } from "react";
import { useAgentRun } from "@/lib/knowns/run";
import { connectEventStream, forwardDecisions } from "@/lib/knowns/adapters/stream";
import { AgentGraph } from "@/components/ui/knowns/agent-graph/agent-graph";
export function LiveRun({ runId }: { runId: string }) {
const run = useAgentRun();
useEffect(() => {
const ctrl = new AbortController();
void connectEventStream(run, `/api/runs/${runId}/events`, { signal: ctrl.signal });
const stop = forwardDecisions(run, `/api/runs/${runId}/decisions`);
return () => {
ctrl.abort();
stop();
};
}, [run, runId]);
return <AgentGraph run={run} />;
}The adapters install from the Pro registry. Set it up once (see Installing Pro), then add the one you need. Each SDK adapter brings the stream adapter with it.
npx shadcn@latest add @knowns-ui-pro/adapter-stream