A2UI based Generative UI SDK
npm install freesailGenerative UI SDK - Enables AI Agents to drive user interfaces across any frontend framework.
Freesail enables AI Agents to stream UI to supported clients using the A2UI Protocol. This allows agents to render interfaces remotely without generating raw HTML or framework-specific code.
Freesail operates on a "Triangle Pattern" with three nodes:
- Agent (Orchestrator): The AI layer that decides what to show
- Freesail Server (Bridge): Translation and streaming engine
- Frontend (Renderer): Presentation layer (React, Web Components)
| Package | Description |
|---------|-------------|
| @freesail/core | Pure TypeScript logic - protocol definitions, parser, transport |
| @freesail/react | React implementation of the Renderer |
| @freesail/gateway | Node.js MCP bridge server |
``bashInstall dependencies
npm install
Key Concepts
$3
We write the Contract (
catalog.json) first:1. Define a component in
catalog.json
2. The Agent immediately sees a new tool
3. The React Developer implements the componentThis ensures the Agent and UI never drift out of sync.
$3
A2UI (Agent-to-User Interface) is the JSON protocol for bi-directional communication:
Server → Client (SSE)
-
createSurface - Initialize UI container
- updateComponents - Stream UI components
- updateDataModel - Push data updates
- deleteSurface - Remove a surfaceClient → Server (HTTP POST)
-
action - Report user interactions
- error` - Report validation or runtime errors- Freesail Architecture
- A2UI Protocol
- Agents
MIT