npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@uix-ai/adapter-a2ui

v0.0.2

Published

Adapter to convert Google A2UI protocol payloads to UIX Lucid IR format

Downloads

23

Readme

@uix-ai/adapter-a2ui

Adapter to convert Google A2UI protocol payloads to UIX Lucid IR format.

Experimental. A2UI is an early-stage protocol and its specification may change. This adapter tracks the latest available version (v0.10).

Install

pnpm add @uix-ai/adapter-a2ui

Peer dependency: @uix-ai/core

Quick Start

import { fromA2UIPayload, toA2UIPayload } from '@uix-ai/adapter-a2ui'

// A2UI -> UIX Lucid IR
const conversation = fromA2UIPayload(a2uiPayload)

// UIX Lucid IR -> A2UI
const payload = toA2UIPayload(conversation)

fromA2UIPayload(payload, options?)

Converts an A2UI updateComponents payload into a LucidConversation. The A2UI component tree is flattened into a linear sequence of LucidBlock items. Container components (Row, Column, Card, etc.) are traversed but not emitted as blocks.

Returns null if the payload does not contain updateComponents.

import { fromA2UIPayload } from '@uix-ai/adapter-a2ui'
import type { A2UIPayload } from '@uix-ai/adapter-a2ui'

const payload: A2UIPayload = {
  version: 'v0.10',
  updateComponents: {
    surfaceId: 'form_1',
    components: [
      { id: 'root', component: 'Column', children: ['title', 'img'] },
      { id: 'title', component: 'Text', text: 'Hello World' },
      { id: 'img', component: 'Image', url: 'https://example.com/photo.png' },
    ],
  },
}

const conversation = fromA2UIPayload(payload)
// conversation.blocks[0] -> text block "Hello World"
// conversation.blocks[1] -> image block

Batch conversion

import { fromA2UIPayloads } from '@uix-ai/adapter-a2ui'

const conversations = fromA2UIPayloads(payloadArray)

toA2UIPayload(conversation, surfaceId?, version?)

Converts a LucidConversation back to an A2UI updateComponents payload. All blocks are wrapped in a root Column layout.

import { toA2UIPayload } from '@uix-ai/adapter-a2ui'

const payload = toA2UIPayload(conversation)
// payload.updateComponents.components -> [Column root, Text, Image, ...]

Supported Component Types

Display Components

| A2UI Component | UIX Block Type | Notes | |----------------|----------------|-------| | Text | text | Direct mapping | | Image | image | Direct mapping | | Icon | text | Rendered as [Icon: name] | | Video | text | Rendered as [Video: url] | | AudioPlayer | text | Rendered as [Audio: url] |

Container Components (traversed, not emitted)

Row, Column, Card, List, Tabs, Modal

Containers are walked to collect child components but do not produce blocks themselves. Tabs children are emitted with bold tab titles.

Input Components

| A2UI Component | UIX Block Type | Notes | |----------------|----------------|-------| | TextField | text | [TextField: label] | | CheckBox | text | [CheckBox: label] | | DateTimeInput | text | [DateTimeInput: label] | | ChoicePicker | text | [ChoicePicker: label] options=[...] | | Slider | text | [Slider: label] range=[min, max] |

Interactive Components

| A2UI Component | UIX Block Type | Notes | |----------------|----------------|-------| | Button | text | [Button: label] (action:name) | | Divider | text | Rendered as --- |

Conversion Options

import type { A2UIConversionOptions } from '@uix-ai/adapter-a2ui'

const options: A2UIConversionOptions = {
  generateConversationId: (surfaceId) => `my-${surfaceId}`,
  generateBlockId: (componentId) => `blk-${componentId}`,
  resolveValue: (dynamic) => {
    // Resolve data-binding expressions against your data model
    if (typeof dynamic === 'object' && 'path' in dynamic) {
      return lookupPath(dynamic.path)
    }
    return String(dynamic)
  },
}

Dynamic Values

A2UI supports dynamic data bindings. Without a resolveValue function, bindings are rendered as placeholders:

  • Path binding: { path: "user.name" } renders as {{user.name}}
  • Function call: { call: "formatDate", args: {...} } renders as {{formatDate(...)}}

Provide a resolveValue callback to resolve these against your application's data model.

Links