agent-webkit

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). Typed POST helpers + an SSE async-iterable with auto-reconnect via Last-Event-ID.
  • @agent-webkit/reactuseAgentSession() React hook with delta reconciliation, permission UI states, AskUserQuestion routing, and reconnect.
  • agent-webkit-server — Python library that holds long-lived ClaudeSDKClients, 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_tool turned into a clean SSE event + first-reply-wins race semantics. No more wrapping the SDK callback yourself.
  • AskUserQuestion routed 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

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.

On this page