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

@nano-ui-kit/a2ui-utils

v0.0.2

Published

A2UI runtime — JSON → DOM renderer, surface manifest + wiring engine, and SSE/WS/MCP stream adapters. Framework-agnostic: emits tag names for any A2UI-conformant component set.

Readme

@nano-ui-kit/a2ui-utils

A2UI runtime — takes an A2UI (Agent-to-UI) JSON tree and stamps DOM nodes. Framework-agnostic leaf: no runtime dependency on any particular component set.

Pairs naturally with @nano-ui-kit/web-components, which registers the *-n custom elements the default registry maps to. Works just as well with your own components — swap the registry via registerType().

Install

npm install @nano-ui-kit/a2ui-utils
# optional: default component set
npm install @nano-ui-kit/web-components

Render A2UI JSON into a DOM node

import { A2UIRenderer, registry } from '@nano-ui-kit/a2ui-utils';
import '@nano-ui-kit/web-components';   // registers card-n, button-n, …

const target = document.getElementById('canvas');
const renderer = new A2UIRenderer(target, registry);

renderer.update([
  { id: 'root', component: 'Card', children: ['sec'] },
  { id: 'sec',  component: 'Section', children: ['btn'] },
  { id: 'btn',  component: 'Button', text: 'Hello', variant: 'primary' },
]);

Connect to a live stream

import { A2UIRenderer, registry, sseStream } from '@nano-ui-kit/a2ui-utils';

const renderer = new A2UIRenderer(document.body, registry);

for await (const msg of sseStream('/api/agent')) {
  renderer.apply(msg);   // updateComponents / patchComponents / removeComponents
}

Stream adapters: sseStream, wsStream, jsonlStream, mcpStream, mockStream.

Use a different component set

Override the registry before rendering:

import { A2UIRenderer, registerType } from '@nano-ui-kit/a2ui-utils';

registerType('Card', 'my-card');
registerType('Button', 'my-button');

const renderer = new A2UIRenderer(target);
renderer.update(tree);

Wire handlers + data sources (Tier 2)

import { SurfaceManifest } from '@nano-ui-kit/a2ui-utils';

const manifest = new SurfaceManifest({
  actions: [
    { event: { event: 'press', target: 'save-btn' },
      handler: 'submit-resource',
      config: { uri: 'api://users', method: 'POST' } },
  ],
  dataSources: [{ id: 'users', uri: 'api://users' }],
});

SurfaceManifest is the declarative config object. Runtime activation against a live surface — resolving handlers, provisioning data sources, binding controllers — is driven by the consumer. @nano-ui-kit/a2ui-compose ships a reference runtime; roll your own against the same manifest shape if you need alternate handler resolution or async semantics.

What's NOT here

  • Custom elements themselves — pull from @nano-ui-kit/web-components or any other A2UI-conformant set.
  • <nano-a2ui-root> convenience element — lives in @nano-ui-kit/web-components/patterns/a2ui-root so this package stays a framework-agnostic leaf.
  • Pattern retrieval, validation, feedback scoring — those are gen-UI concerns and live in @nano-ui-kit/a2ui-compose (private/workspace-only).

License

MIT © Kim Granlund