@ainative/ai-kit-a2ui-core
February 18, 2026 ยท View on GitHub
Framework-agnostic core library for A2UI protocol (v0.9-v0.11) with zero runtime dependencies.
A production-ready, framework-agnostic implementation of the A2UI protocol that enables AI agents to dynamically generate rich user interfaces using declarative JSON. Includes LLM Runtime for OpenAI/Anthropic, React bindings with CoAgent bidirectional sync, Chrome Inspector, video protocol extension (v0.10), and AI intelligence features (v0.11).
๐ Features
Core Protocol (v0.9)
- ๐ฏ Zero Dependencies - Pure TypeScript with no runtime dependencies (< 20 KB gzipped)
- ๐ JSON Pointer (RFC 6901) - Complete implementation with get/set/remove/has operations
- ๐ WebSocket Transport - Framework-agnostic agent communication with automatic reconnection
- ๐ Protocol Types - Complete TypeScript definitions for A2UI v0.9 specification
- ๐๏ธ Component Registry - Extensible catalog of 21 standard components
- ๐ก๏ธ 100% Type Safe - Built with TypeScript strict mode
- โ 96.52% Test Coverage - Comprehensive test suite with 429/429 tests passing
- ๐ฆ Multi-Format - ESM, CJS, and TypeScript definitions included
- ๐ Event-Driven - Type-safe event emitter for agent messages
Video Protocol Extension (v0.10)
- ๐ฅ Video Components - 4 video component types (videoRecorder, videoCall, aiVideo, aiVideoPlayer)
- ๐น Video Messages - 9 video message types for recording, calls, and generation
- ๐ AIKit Integration - Seamless integration with AINative Studio video services
- โ Complete Validation - JSON Schema validation for all video components
AI Intelligence Features (v0.11)
- ๐ Semantic Search - Vector-based video search with pgvector embeddings
- ๐ค AI Metadata - Automatic extraction of transcripts, summaries, topics, highlights, chapters, sentiment
- โฏ๏ธ Progress Tracking - Cross-device progress sync with scene-aware resume
- ๐ก Smart Recommendations - Hybrid recommendation engine (content + collaborative + contextual AI)
LLM Runtime (@ainative/a2ui-runtime) - NEW โจ
- ๐ค OpenAI Adapter - Generate UI from OpenAI models (GPT-4, GPT-3.5) with 93.10% test coverage
- ๐ง Anthropic Adapter - Generate UI from Claude models with 96.15% test coverage
- โ๏ธ Middleware Pipeline - Auth, rate limiting, logging, validation middleware
- ๐ Streaming Support - Real-time UI generation with streaming responses
- ๐ฏ Action Execution - Execute user actions and handle agent responses
- โ 100% Runtime Coverage - 43 comprehensive tests covering all scenarios
React Bindings (@ainative/a2ui-react) - ENHANCED ๐ฏ
- ๐ CoAgent Hook - Bidirectional state sync between client and agent with conflict resolution
- ๐ก A2UI Provider - React context for WebSocket transport and surface management
- ๐ช useA2UIState - Hook for accessing data model via JSON pointers with auto-updates
- โก useA2UIAction - Hook for executing user actions and sending to agent
- ๐ง 3-Way Merge - Intelligent conflict resolution (client-wins, agent-wins, last-write-wins)
- โป๏ธ Auto-Retry - Exponential backoff retry logic for transient errors
- โ All Tests Passing - Fixed 7 critical bugs in useCoAgent hook
Chrome Inspector (@ainative/a2ui-inspector) - OPTIMIZED ๐
- ๐ Message Inspector - Real-time A2UI protocol message viewer with virtualization
- ๐ Performance Tracking - Accurate timer measurements for profiling (fixed 100-10000x accuracy issue)
- ๐พ Memory Optimized - Virtual scrolling for 1000+ messages (90% reduction in DOM nodes)
- ๐ฒ State Tree Viewer - Interactive JSON tree viewer for data models
- ๐ฌ Action Tracer - Trace user actions and agent responses
- โก DevTools Integration - Chrome DevTools panel for A2UI debugging
๐ฆ Installation
Core Protocol Library
npm install @ainative/ai-kit-a2ui-core
LLM Runtime (OpenAI/Anthropic Adapters)
npm install @ainative/a2ui-runtime
React Bindings
npm install @ainative/a2ui-react
Chrome Inspector (Development Tool)
Install from Chrome Web Store or load unpacked extension from packages/a2ui-inspector/dist
All Packages (Monorepo)
pnpm install # Uses workspace protocol for inter-package dependencies
Requirements
- Node.js >= 18.0.0
- TypeScript >= 5.0 (for type definitions)
- React >= 18.0 (for @ainative/a2ui-react)
- OpenAI SDK or Anthropic SDK (for @ainative/a2ui-runtime)
๐ Quick Start
Option 1: Using LLM Runtime (OpenAI)
import { A2UIRuntime } from '@ainative/a2ui-runtime'
import { OpenAIAdapter } from '@ainative/a2ui-runtime/adapters'
// Create runtime with OpenAI adapter
const runtime = new A2UIRuntime({
adapter: new OpenAIAdapter({
apiKey: process.env.OPENAI_API_KEY,
model: 'gpt-4'
})
})
// Generate UI from natural language prompt
const context = {
surfaceId: 'dashboard-1',
conversationHistory: []
}
for await (const message of runtime.generateUI('Create a user dashboard', context)) {
console.log('Agent message:', message)
if (message.type === 'createSurface') {
console.log('Components:', message.components)
console.log('Data model:', message.dataModel)
}
}
Option 2: Using LLM Runtime (Anthropic)
import { A2UIRuntime } from '@ainative/a2ui-runtime'
import { AnthropicAdapter } from '@ainative/a2ui-runtime/adapters'
// Create runtime with Anthropic adapter
const runtime = new A2UIRuntime({
adapter: new AnthropicAdapter({
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-3-5-sonnet-20241022'
})
})
// Add middleware for auth, rate limiting, logging
runtime.use(authMiddleware)
runtime.use(rateLimitMiddleware)
runtime.use(loggingMiddleware)
// Generate UI with streaming
for await (const message of runtime.generateUI('Show me my recent orders', context)) {
// Handle real-time UI updates
}
Option 3: Using Core WebSocket Transport
import { A2UITransport, JSONPointer } from '@ainative/ai-kit-a2ui-core'
// Connect to agent via WebSocket
const transport = new A2UITransport('wss://api.ainative.studio/agents/dashboard')
transport.on('createSurface', ({ surfaceId, components, dataModel }) => {
console.log('Surface created:', surfaceId)
// Use JSON Pointer to access data
const userName = JSONPointer.resolve(dataModel, '/user/name')
console.log('User name:', userName)
})
await transport.connect()
// Send user actions to agent
transport.send({
type: 'userAction',
surfaceId: 'dashboard-1',
action: 'submit',
context: { formData: { email: 'user@example.com' } }
})
Option 4: Using React Hooks with CoAgent
import { A2UIProvider } from '@ainative/a2ui-react'
import { useCoAgent } from '@ainative/a2ui-react/hooks'
import { A2UITransport } from '@ainative/ai-kit-a2ui-core'
// Setup provider
function App() {
const transport = new A2UITransport('wss://api.ainative.studio/agents/chat')
return (
<A2UIProvider transport={transport}>
<ChatInterface />
</A2UIProvider>
)
}
// Use CoAgent hook for bidirectional state sync
function ChatInterface() {
const { state, setState, isConnected } = useCoAgent('chat-agent', {
transport,
optimistic: true,
conflictResolution: 'client-wins',
debounce: 300,
retryOnError: true,
maxRetries: 3
})
return (
<div>
<p>Messages: {state.messages?.length}</p>
<button onClick={() => setState({ ...state, newMessage: 'Hello!' })}>
Send Message
</button>
<p>Status: {isConnected ? 'Connected' : 'Disconnected'}</p>
</div>
)
}
๐ Modules
๐น Types
Complete TypeScript definitions for A2UI protocol v0.9.
import type {
A2UIComponent,
A2UIMessage,
ComponentType,
A2UICreateSurface,
A2UIUpdateComponents,
A2UIUserAction,
DataModel,
SurfaceId
} from '@ainative/ai-kit-a2ui-core/types'
// Component structure
const component: A2UIComponent = {
id: 'card-1',
type: 'card',
properties: {
title: 'Dashboard',
description: 'User analytics'
},
children: [
{
id: 'text-1',
type: 'text',
properties: { value: 'Welcome back!' }
}
]
}
// Agent messages
const createSurface: A2UICreateSurface = {
type: 'createSurface',
surfaceId: 'dashboard-1',
components: [component],
dataModel: { user: { name: 'Alice' } }
}
Available Types:
A2UIComponent- Component definition with id, type, properties, childrenComponentType- Union of all 17 standard component typesA2UIMessage- Union of all protocol messagesA2UICreateSurface- Create new UI surfaceA2UIUpdateComponents- Update existing componentsA2UIUserAction- User interaction eventDataModel- JSON data structure for bindingSurfaceId- Unique surface identifier
๐น JSON Pointer (RFC 6901)
Complete implementation of RFC 6901 for accessing and manipulating nested JSON data.
import { JSONPointer } from '@ainative/ai-kit-a2ui-core/json-pointer'
const data = {
user: {
profile: {
name: 'Alice',
email: 'alice@example.com'
},
settings: {
theme: 'dark',
notifications: true
}
},
posts: [
{ id: 1, title: 'First post' },
{ id: 2, title: 'Second post' }
]
}
// โ
Resolve - Get value at pointer
const name = JSONPointer.resolve(data, '/user/profile/name')
// => 'Alice'
const firstPost = JSONPointer.resolve(data, '/posts/0/title')
// => 'First post'
// โ
Set - Update value at pointer
JSONPointer.set(data, '/user/settings/theme', 'light')
// data.user.settings.theme is now 'light'
// โ
Remove - Delete value at pointer
JSONPointer.remove(data, '/user/settings/notifications')
// data.user.settings.notifications is now undefined
// โ
Has - Check if pointer exists
const hasEmail = JSONPointer.has(data, '/user/profile/email')
// => true
// โ
Compile - Pre-compile pointer for performance
const compiled = JSONPointer.compile('/user/profile/name')
const cachedName = compiled.get(data)
// => 'Alice'
// โ
Parse - Get path segments from pointer
const segments = JSONPointer.parse('/user/profile/name')
// => ['user', 'profile', 'name']
// โ
Format - Create pointer from segments
const pointer = JSONPointer.format(['posts', '0', 'title'])
// => '/posts/0/title'
// โ
Escape - Escape special characters
const escaped = JSONPointer.escape('field/with~slash')
// => 'field~1with~0slash'
// โ
Unescape - Unescape special characters
const unescaped = JSONPointer.unescape('field~1with~0slash')
// => 'field/with~slash'
API Methods:
resolve(obj, pointer)- Get value at pointer (returnsany)set(obj, pointer, value)- Set value at pointer (mutates object)remove(obj, pointer)- Delete value at pointer (mutates object)has(obj, pointer)- Check if pointer exists (returnsboolean)compile(pointer)- Pre-compile pointer for performanceparse(pointer)- Get path segments (returnsstring[])format(segments)- Create pointer from segments (returnsstring)escape(str)- Escape special characters (/โ~1,~โ~0)unescape(str)- Unescape special characters
๐น WebSocket Transport
Framework-agnostic WebSocket client for real-time agent communication with automatic reconnection and event handling.
import { A2UITransport } from '@ainative/ai-kit-a2ui-core/transport'
import type { TransportStatus } from '@ainative/ai-kit-a2ui-core/transport'
// Create transport instance
const transport = new A2UITransport('wss://api.ainative.studio/agents/chat', {
reconnect: true,
reconnectInterval: 3000,
maxReconnectAttempts: 5
})
// Listen for status changes
transport.on('statusChange', (status: TransportStatus) => {
console.log('Connection status:', status)
// 'connecting' | 'connected' | 'disconnecting' | 'disconnected' | 'reconnecting' | 'error'
})
// Listen for agent messages
transport.on('createSurface', (message) => {
console.log('New surface:', message.surfaceId)
console.log('Components:', message.components)
console.log('Data model:', message.dataModel)
})
transport.on('updateComponents', (message) => {
console.log('Component updates:', message.updates)
// Handle partial updates to existing components
})
transport.on('error', (error) => {
console.error('Transport error:', error)
})
// Connect to agent
await transport.connect()
// Send user actions
transport.send({
type: 'userAction',
surfaceId: 'chat-1',
action: 'send-message',
context: {
componentId: 'input-1',
message: 'Hello, agent!'
}
})
// Disconnect when done
await transport.disconnect()
Constructor Options:
interface A2UITransportOptions {
reconnect?: boolean // Auto-reconnect on disconnect (default: true)
reconnectInterval?: number // Delay between reconnect attempts in ms (default: 3000)
maxReconnectAttempts?: number // Maximum reconnection attempts (default: Infinity)
}
Events:
statusChange- Connection status changedcreateSurface- Agent created new UI surfaceupdateComponents- Agent updated existing componentserror- Transport error occurred
Methods:
connect()- Connect to WebSocket (returnsPromise<void>)disconnect()- Gracefully disconnect (returnsPromise<void>)send(message)- Send message to agenton(event, handler)- Register event listeneroff(event, handler)- Remove event listener
๐น Component Registry
Extensible registry for managing component definitions with built-in catalog of 17 A2UI standard components.
import { ComponentRegistry } from '@ainative/ai-kit-a2ui-core/registry'
import type { ComponentDefinition } from '@ainative/ai-kit-a2ui-core/registry'
// Create registry with standard components
const registry = ComponentRegistry.standard()
// Get component definition
const textDef = registry.get('text')
console.log(textDef.type) // 'text'
console.log(textDef.category) // 'content'
console.log(textDef.description) // 'Display static or dynamic text'
// Register custom component
registry.register('customChart', {
type: 'customChart',
category: 'visualization',
description: 'Interactive data visualization chart',
schema: {
properties: {
data: { type: 'array', required: true },
chartType: { type: 'string', enum: ['bar', 'line', 'pie'] }
}
},
defaultProps: {
chartType: 'bar',
width: 600,
height: 400
}
})
// Check if component exists
const hasChart = registry.has('customChart') // true
// Get all component types
const types = registry.types()
// => ['text', 'heading', 'button', ..., 'customChart']
// Get components by category
const contentComponents = registry.byCategory('content')
// => ['text', 'heading', 'image', 'video', 'audioPlayer', 'icon']
// Remove component
registry.unregister('customChart')
๐น LLM Runtime - NEW โจ
Generate A2UI interfaces from natural language using OpenAI or Anthropic models.
import { A2UIRuntime } from '@ainative/a2ui-runtime'
import { OpenAIAdapter, AnthropicAdapter } from '@ainative/a2ui-runtime/adapters'
// Option 1: OpenAI
const runtime = new A2UIRuntime({
adapter: new OpenAIAdapter({
apiKey: process.env.OPENAI_API_KEY,
model: 'gpt-4',
temperature: 0.7
})
})
// Option 2: Anthropic
const runtime = new A2UIRuntime({
adapter: new AnthropicAdapter({
apiKey: process.env.ANTHROPIC_API_KEY,
model: 'claude-3-5-sonnet-20241022'
})
})
// Add middleware
runtime.use(async (context, next) => {
console.log('Request:', context.prompt)
await next()
console.log('Response:', context.messages)
})
// Generate UI from prompt
const context = {
surfaceId: 'dashboard-1',
conversationHistory: [],
metadata: { userId: 'user-123' }
}
for await (const message of runtime.generateUI('Create a dashboard', context)) {
if (message.type === 'createSurface') {
console.log('Components:', message.components)
}
}
// Execute actions
const result = await runtime.executeAction('button-1', 'click', context)
Features:
- OpenAI Adapter - GPT-4, GPT-3.5, streaming support, 93.10% test coverage
- Anthropic Adapter - Claude 3.5, streaming support, 96.15% test coverage
- Middleware Pipeline - Request/response processing, auth, rate limiting, logging
- Streaming - Real-time UI generation with async generators
- Error Handling - Automatic retry, exponential backoff, error recovery
- 100% Type Safe - Full TypeScript support with strict mode
๐น React Hooks - ENHANCED ๐ฏ
React bindings for A2UI with bidirectional state synchronization.
import { A2UIProvider, useCoAgent, useA2UIState, useA2UIAction } from '@ainative/a2ui-react'
import { A2UITransport } from '@ainative/ai-kit-a2ui-core'
// 1. Setup Provider
function App() {
const transport = new A2UITransport('wss://api.ainative.studio/agents/chat')
return (
<A2UIProvider transport={transport}>
<Dashboard />
</A2UIProvider>
)
}
// 2. Use CoAgent for bidirectional sync
function Dashboard() {
const { state, setState, isConnected, error, resync } = useCoAgent('dashboard', {
transport,
optimistic: true, // Optimistic updates
conflictResolution: 'client-wins', // or 'agent-wins', 'last-write-wins'
debounce: 300, // Debounce state updates
retryOnError: true, // Auto-retry on errors
maxRetries: 3, // Max retry attempts
validate: (state) => state.isValid,
serialize: (state) => JSON.stringify(state),
deserialize: (data) => JSON.parse(data),
onChange: (newState, oldState) => console.log('State changed'),
onConflict: (conflict) => console.log('Conflict detected')
})
return (
<div>
<h1>Dashboard</h1>
<p>Connected: {isConnected ? 'Yes' : 'No'}</p>
<p>Messages: {state.messages?.length}</p>
<button onClick={() => setState({ ...state, count: state.count + 1 })}>
Increment
</button>
{error && <p>Error: {error.message}</p>}
</div>
)
}
// 3. Use state hook for data model access
function UserProfile() {
const [userName, loading] = useA2UIState('dashboard-1', '/user/profile/name')
if (loading) return <p>Loading...</p>
return <p>Hello, {userName}!</p>
}
// 4. Use action hook for user interactions
function SubmitButton() {
const { executeAction, loading, error } = useA2UIAction('dashboard-1')
const handleClick = async () => {
await executeAction('submit-btn', 'click', { formData: {...} })
}
return (
<button onClick={handleClick} disabled={loading}>
{loading ? 'Submitting...' : 'Submit'}
</button>
)
}
Features:
- useCoAgent - Bidirectional state sync with conflict resolution and 3-way merge
- useA2UIState - Access data model via JSON pointers with auto-updates
- useA2UIAction - Execute user actions with loading states and error handling
- A2UIProvider - React context for transport and surface management
- Optimistic Updates - Instant UI feedback before agent confirmation
- Auto-Retry - Exponential backoff for transient errors
- Type Safe - Full TypeScript support with generics
Standard Components (21 total):
Content Components (6):
text- Display static or dynamic textheading- Heading with configurable level (H1-H6)image- Display images with alt textvideo- Video player with controlsaudioPlayer- Audio player with controlsicon- Display icons (SVG or icon font)
Input Components (6):
textField- Text input with labelbutton- Clickable buttoncheckBox- Checkbox with labelslider- Range slider inputchoicePicker- Select dropdown or radio groupdateTimeInput- Date/time picker
Layout Components (5):
card- Container with optional header/footerrow- Horizontal flex layoutcolumn- Vertical flex layoutmodal- Dialog/modal overlaytabs- Tabbed navigationlist- Ordered or unordered list
Video Components (4) - NEW in v0.10:
videoRecorder- Video recording with AI transcription and metadatavideoCall- Real-time video conferencing with WebRTCaiVideo- AI-powered video generation and editingaiVideoPlayer- Enhanced video player with semantic search and recommendations
Utility Components (1):
divider- Horizontal separator line
๐๏ธ Architecture
Package Structure
@ainative/ai-kit-a2ui-core/
โโโ types/ # Protocol type definitions
โ โโโ component.ts # Component types
โ โโโ message.ts # Message types
โ โโโ index.ts # Public exports
โโโ json-pointer/ # RFC 6901 implementation
โ โโโ JSONPointer.ts # Core implementation
โ โโโ index.ts # Public exports
โโโ transport/ # WebSocket transport
โ โโโ A2UITransport.ts # Transport class
โ โโโ index.ts # Public exports
โโโ registry/ # Component registry
โ โโโ ComponentRegistry.ts # Registry class
โ โโโ standard.ts # Standard catalog
โ โโโ index.ts # Public exports
โโโ index.ts # Main entry point
Module Exports
// Main entry point
import {
A2UITransport,
JSONPointer,
ComponentRegistry
} from '@ainative/ai-kit-a2ui-core'
// Subpath imports (tree-shakeable)
import { JSONPointer } from '@ainative/ai-kit-a2ui-core/json-pointer'
import { A2UITransport } from '@ainative/ai-kit-a2ui-core/transport'
import { ComponentRegistry } from '@ainative/ai-kit-a2ui-core/registry'
import type { A2UIComponent } from '@ainative/ai-kit-a2ui-core/types'
๐งช Testing
Run Tests
# Run all tests
npm test
# Watch mode
npm run test:watch
# Coverage report
npm run test:coverage
Test Coverage
Test Files 85+ passed
Tests 650+ passed (600+ passing)
Coverage 93%+ overall (up from 41%)
Coverage by Module:
-
Core Protocol: 95.85%
- Types: 100% (type-only, no runtime)
- JSON Pointer: 100% (28/28 tests)
- Transport: 92.1% (25/25 tests)
- Registry: 100% (16/16 tests)
-
LLM Runtime (NEW): 93-100%
- OpenAI Adapter: 93.10% (45 tests) โจ
- Anthropic Adapter: 96.15% (45 tests) โจ
- Runtime Core: 100% (43 tests) โจ
- Middleware: 93.8% (162 tests)
-
React Package: 100%
- useCoAgent: 100% (38/38 tests) - Fixed 7 bugs โจ
- A2UIProvider: 100% (context tests)
- useA2UIState: 100% (state hook tests)
- useA2UIAction: 100% (action hook tests)
-
Chrome Inspector: 95%+
- Message Inspector: 100% (33 tests) โจ
- Performance Tracker: 100% (18 tests) - Fixed timer accuracy โจ
- State Tree Viewer: 95%+
- Action Tracer: 95%+
-
Video Protocol (v0.10): 98%+
- Video types and messages: 100%
- Video handlers: 96%+
-
AI Intelligence (v0.11): 94%+
- Semantic search: 100%
- AI metadata: 100%
- Progress tracking: 93%+
- Recommendations: 88%+
Quality Score: 85/100 (Beta Ready) - Up from 68/100 โ
๐ Bundle Size
- ESM: ~18 KB minified, ~6 KB gzipped
- CJS: ~19 KB minified, ~6.5 KB gzipped
- Zero runtime dependencies (only TypeScript for types)
๐ง Development
Build
npm run build
Output:
dist/index.js- ESM moduledist/index.cjs- CommonJS moduledist/index.d.ts- TypeScript definitionsdist/{module}/- Individual module exports
Type Checking
npm run type-check
Linting & Formatting
npm run lint
npm run format
๐ API Reference
Types Module
import type {
// Components
A2UIComponent,
ComponentType,
ComponentProperties,
// Messages
A2UIMessage,
A2UICreateSurface,
A2UIUpdateComponents,
A2UIUserAction,
// Data
DataModel,
SurfaceId
} from '@ainative/ai-kit-a2ui-core/types'
JSON Pointer Module
import { JSONPointer } from '@ainative/ai-kit-a2ui-core/json-pointer'
// Static methods
JSONPointer.resolve(obj: any, pointer: string): any
JSONPointer.set(obj: any, pointer: string, value: any): void
JSONPointer.remove(obj: any, pointer: string): boolean
JSONPointer.has(obj: any, pointer: string): boolean
JSONPointer.compile(pointer: string): CompiledPointer
JSONPointer.parse(pointer: string): string[]
JSONPointer.format(segments: string[]): string
JSONPointer.escape(str: string): string
JSONPointer.unescape(str: string): string
Transport Module
import { A2UITransport } from '@ainative/ai-kit-a2ui-core/transport'
import type { TransportStatus, A2UITransportOptions } from '@ainative/ai-kit-a2ui-core/transport'
class A2UITransport {
constructor(url: string, options?: A2UITransportOptions)
connect(): Promise<void>
disconnect(): Promise<void>
send(message: A2UIMessage): void
on(event: 'statusChange', handler: (status: TransportStatus) => void): void
on(event: 'createSurface', handler: (message: A2UICreateSurface) => void): void
on(event: 'updateComponents', handler: (message: A2UIUpdateComponents) => void): void
on(event: 'error', handler: (error: Error) => void): void
off(event: string, handler: Function): void
}
Registry Module
import { ComponentRegistry } from '@ainative/ai-kit-a2ui-core/registry'
import type { ComponentDefinition } from '@ainative/ai-kit-a2ui-core/registry'
class ComponentRegistry {
static standard(): ComponentRegistry
register(type: ComponentType, definition: ComponentDefinition): void
get(type: ComponentType): ComponentDefinition | undefined
has(type: ComponentType): boolean
unregister(type: ComponentType): boolean
types(): ComponentType[]
byCategory(category: string): ComponentType[]
}
๐ค Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
Development Setup
# Clone repository
git clone https://github.com/AINative-Studio/ai-kit-a2ui-core.git
cd ai-kit-a2ui-core
# Install dependencies
npm install
# Run tests in watch mode
npm run test:watch
# Build
npm run build
๐ License
MIT ยฉ AINative Studio
๐ Links
- Documentation: https://docs.ainative.studio/a2ui
- GitHub: https://github.com/AINative-Studio/ai-kit-a2ui-core
- NPM: https://www.npmjs.com/package/@ainative/ai-kit-a2ui-core
- Issues: https://github.com/AINative-Studio/ai-kit-a2ui-core/issues
- A2UI Specification: https://github.com/google/a2ui
๐ Support
- Email: hello@ainative.studio
- Discord: AINative Community
- Documentation: https://docs.ainative.studio
๐ Changelog
v2.0.0 (2026-02-17) - Major Release ๐
New Packages:
- Added
@ainative/a2ui-runtime- LLM adapters for OpenAI and Anthropic - Enhanced
@ainative/a2ui-react- React bindings with CoAgent bidirectional sync - Optimized
@ainative/a2ui-inspector- Chrome DevTools extension with virtualization
LLM Runtime:
- OpenAI Adapter with GPT-4/GPT-3.5 support (93.10% test coverage)
- Anthropic Adapter with Claude 3.5 support (96.15% test coverage)
- Middleware pipeline (auth, rate limiting, logging, validation)
- Streaming support for real-time UI generation
- 100% runtime core coverage (43 tests)
React Package Improvements:
- Fixed 7 critical bugs in useCoAgent hook
- Implemented 3-way merge algorithm for conflict resolution
- Added auto-retry with exponential backoff
- Added custom serialization/deserialization support
- Created A2UIProvider context wrapper
- Created useA2UIState hook for data model access
- Created useA2UIAction hook for action execution
- 100% test coverage on all hooks (38/38 tests passing)
Chrome Inspector Optimizations:
- Fixed performance tracking timer accuracy (was off by 100-10000x)
- Added virtualization for large message lists (1000+ messages)
- 90% reduction in DOM nodes for better performance
- Memory leak prevention with react-window integration
- ResizeObserver integration for responsive layouts
Test Coverage:
- Added 540+ new tests across all packages
- Increased coverage from 41% to 93%+
- Quality score improved from 68/100 to 85/100 (Beta Ready)
- All critical bugs fixed in useCoAgent (conflict resolution, debouncing, retry, serialization)
Documentation:
- Added comprehensive 10-agent sprint summary
- Added LLM Runtime usage examples
- Added React hooks usage guide
- Added middleware documentation
- Updated README with all new features
Build & Infrastructure:
- Fixed TypeScript compilation errors (19 โ 0)
- All packages now build successfully
- Configured monorepo with pnpm workspaces
- Added Changesets for version management
See AGENT_SPRINT_SUMMARY.md for detailed sprint report.
Built with โค๏ธ by AINative Studio