freesail
v0.3.0
Published
A2UI based Generative UI SDK
Maintainers
Readme
Freesail
Generative UI SDK - Enables AI Agents to drive user interfaces across any frontend framework.
Overview
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.
Architecture
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)
Packages
| 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 |
Quick Start
# Install dependencies
npm install
# Build all packages
npm run build
# Start the MCP server
npm run dev -w @freesail/gatewayKey Concepts
Schema-First Development
We write the Contract (catalog.json) first:
- Define a component in
catalog.json - The Agent immediately sees a new tool
- The React Developer implements the component
This ensures the Agent and UI never drift out of sync.
A2UI Protocol
A2UI (Agent-to-User Interface) is the JSON protocol for bi-directional communication:
Server → Client (SSE)
createSurface- Initialize UI containerupdateComponents- Stream UI componentsupdateDataModel- Push data updatesdeleteSurface- Remove a surface
Client → Server (HTTP POST)
action- Report user interactionserror- Report validation or runtime errors
Documentation
License
MIT
