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

@openuidev/a2ui

v0.4.1

Published

A2UI v1.0 protocol support with OpenUI Lang component updates and React rendering

Readme

@openuidev/a2ui

An experimental A2UI v1.0 profile that keeps the protocol lifecycle and envelopes intact while representing component lists as OpenUI Lang statements.

{
  "version": "v1.0",
  "updateComponents": {
    "surfaceId": "main",
    "components": ["root = Stack([title])", "title = TextContent(\"Hello\")"]
  }
}

updateDataModel, deleteSurface, actions, callRendererFunction, agentFunctionResponse, callAgentFunction, rendererFunctionResponse, errors, capabilities, and renderer data-model metadata retain their A2UI v1.0 shapes. For v1.0 single-message creation, optional createSurface.components uses the same Lang statement array as updateComponents.components, so there is exactly one component representation on the wire.

Incoming protocol messages are validated with the exported Zod schemas in the package. The public TypeScript message types are inferred from the same definitions, so runtime validation and static types stay aligned.

Installation

Install the framework-neutral protocol client with its runtime schema peer:

npm install @openuidev/a2ui zod

The React adapter is optional. Install its peers only when importing @openuidev/a2ui/react:

npm install react @openuidev/react-lang

How updates work

Each array item is one complete OpenUI Lang statement (a multiline statement block is also accepted). Repeated messages are merged by statement ID and the resulting source is parsed by @openuidev/lang-core. A newer assignment replaces the previous statement, and statementId = null deletes it. The root statement remains the surface root.

Usage

import { createA2UIClient } from "@openuidev/a2ui";
import { A2UIRenderer } from "@openuidev/a2ui/react";
import { openuiLibrary } from "@openuidev/react-ui";

const client = createA2UIClient({
  schema: openuiLibrary.toJSONSchema(),
  rootName: openuiLibrary.root,
  rendererCapabilities: {
    "v1.0": { supportedCatalogIds: ["com.example:openui"] },
  },
  onMessage(message, metadata) {
    transport.send(message, metadata);
  },
});

await client.process({
  version: "v1.0",
  createSurface: {
    surfaceId: "main",
    catalogId: "com.example:openui",
    dataModel: { user: { name: "Alice" } },
  },
});

await client.process({
  version: "v1.0",
  updateComponents: {
    surfaceId: "main",
    components: ["root = Stack([greeting])", 'greeting = TextContent("Hello, " + $user.name)'],
  },
});

export function Surface() {
  return (
    <A2UIRenderer
      client={client}
      surfaceId="main"
      library={openuiLibrary}
      isStreaming={transport.isStreaming}
      mapAction={(event) => ({ name: event.type })}
    />
  );
}

The client is framework-neutral: it owns surface lifecycle, runtime envelope validation, Lang parsing and merging, data-model patches, actions, RPC, and protocol errors. A2UIRenderer is the React adapter; it subscribes to one surface and delegates the parsed OpenUI Lang UI to @openuidev/react-lang.

When sendDataModel is enabled, the second onMessage argument contains a2uiRendererDataModel metadata filtered to opted-in surfaces. Configured renderer capabilities are exposed in the same metadata object. The host transport decides where to attach this metadata.

Renderer functions can be registered as a direct function shorthand or as { handler, catalogId, allowedCallers }. Explicit registrations default to rendererOnly; incoming callRendererFunction messages are accepted only when the catalog ID matches and allowedCallers is agentOnly or rendererOrAgent.

When no toolProvider is passed to A2UIRenderer, OpenUI Lang Query() and Mutation() calls automatically use A2UI callAgentFunction and settle from the matching agentFunctionResponse. Pass a toolProvider to handle those calls locally instead.

Use mapAction to provide sourceComponentId when the host renderer does not include one in its action event. Otherwise actions fall back to the surface root ID.

Development

The check:attw script intentionally ignores the no-resolution rule. ./react is exported through modern package exports; attw reports no-resolution only for legacy Node 10 resolution, which this package does not support.