agent-webkit
A typed JS SDK + Python server library for driving the Claude Agent SDK over HTTP+SSE.
agent-webkit is the bridge between the Claude Agent SDK and the web. It ships:
@agent-webkit/core— isomorphic JS transport (browser, Node, Deno, Bun). TypedPOSThelpers + an SSE async-iterable with auto-reconnect viaLast-Event-ID.@agent-webkit/react—useAgentSession()React hook with delta reconciliation, permission UI states,AskUserQuestionrouting, and reconnect.agent-webkit-server— Python library that holds long-livedClaudeSDKClients, fans out SSE to subscribers, routes permission RPC, and ships with FastAPI + Postgres adapters.
What you get out of the box
- Real-time streaming of assistant messages and tool use.
can_use_toolturned into a clean SSE event + first-reply-wins race semantics. No more wrapping the SDK callback yourself.AskUserQuestionrouted through a dedicated event so your UI can render a typed answer dialog.- Multi-subscriber fan-out — multiple browser tabs can attach to the same session, each with its own cursor.
- Resume after disconnect via
Last-Event-ID, backed by a bounded ring buffer of past events. - Pluggable session storage — local JSONL by default, Postgres adapter for multi-host deployments.
Where to next
- New here? Get started — five-minute walkthrough from
pip installto a working chat. - React app? Jump to the React guide.
- Vue / Svelte / Node? Vanilla JS guide.
- Backend dev? FastAPI guide or build a custom adapter.
- Need to understand the wire? Concepts or the protocol reference.
Status
v0.2.0 — public alpha. Wire protocol pinned at 1.0. Pre-1.0 packages may have breaking JS/Python API changes between minors; the wire stays stable.