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

@workglow/a2ui

v0.6.11

Published

Agent-to-UI (A2UI) protocol types, validation and surface state for Workglow.

Readme

@workglow/a2ui

A2UI (Agent-to-UI) protocol support for Workglow: the wire types, the checks that make an agent-authored surface safe to draw, and a task that draws one.

A2UI lets an agent send a declarative description of an interface — a flat list of components addressed by id, plus a JSON data model they read through — which the host renders with its own widgets. Nothing the agent sends executes.

What is here

| Subpath | What it holds | | --- | --- | | ./protocol | The v0.9 wire types, batch validation, JSON-pointer data model patching, the fold from a message stream to surface state, and the binding layer a renderer resolves values through | | ./catalog | The component allowlist, the check that enforces it, the client-side functions it declares, and the prompt text that teaches an agent to write against it | | ./tasks | A2UISurfaceTask, and the IA2UIConnector seam a host implements |

There is no renderer here, on purpose: a renderer is a framework choice, and every one of them needs the same things above. What is here is everything a renderer needs that is not a framework choice — including the part that is easy to get subtly wrong:

import { expandChildren, resolveValue } from "@workglow/a2ui/protocol";

// A template drawn once per item, each copy reading its own item.
const slots = expandChildren(component.children, { dataModel, basePath: "" });
for (const slot of slots) {
  const props = resolveProps(byId(slot.componentId), { dataModel, basePath: slot.basePath });
}

basePath is what makes a repeated row read the Nth item rather than the first. A renderer that resolves every path against the root renders a list where every row shows the same data — which looks like a rendering bug and is a resolution one.

Drawing a surface

import { A2UI_BASIC_CATALOG_ID } from "@workglow/a2ui/catalog";
import { A2UI_CONNECTOR, A2UISurfaceTask } from "@workglow/a2ui/tasks";

registry.registerInstance(A2UI_CONNECTOR, myRenderer);

const result = await new A2UISurfaceTask().run({
  messages: [
    { version: "v0.9", createSurface: { surfaceId: "s1", catalogId: A2UI_BASIC_CATALOG_ID } },
    {
      version: "v0.9",
      updateComponents: {
        surfaceId: "s1",
        components: [
          { id: "root", component: "Column", children: ["hello"] },
          { id: "hello", component: "Text", text: "Hello" },
        ],
      },
    },
  ],
});
// result.status, result.eventName, result.context

Offering it to an agent

import {
  A2UI_BASIC_CATALOG,
  A2UI_RENDER_TOOL_NAME,
  a2uiRenderToolInputSchema,
  describeA2UICatalog,
} from "@workglow/a2ui/catalog";

systemPrompt += `\n\n${describeA2UICatalog(A2UI_BASIC_CATALOG)}`;
tools.push({
  name: A2UI_RENDER_TOOL_NAME,
  description: A2UI_RENDER_TOOL_DESCRIPTION,
  inputSchema: a2uiRenderToolInputSchema(A2UI_BASIC_CATALOG),
});

The prompt text is generated from the same table the validator enforces, so an agent is never told about a property that would be refused.

Two properties worth knowing

The catalog is the allowlist, and something has to enforce it. A2UI is safe because an agent may only name components the host already implements — which is only true where a host refuses the ones it does not. batchCatalogIssues is that refusal: unknown components, unknown properties, values outside a closed set, child ids nothing defines, and URL schemes a renderer must not fetch. A renderer that silently skips an unknown component makes an over-reaching agent look like a quiet one.

A function the catalog does not declare is refused too. A call can sit at any depth — a button's action context, one option's label, an argument of another call — so the check walks rather than reading the top level. Unchecked, such a call resolves to nothing and draws an empty label, which reads as missing data rather than as a surface asking for something no host implements.

A batch is checked after folding, never per message. The protocol's own incremental idiom defines a container before the children it names and patches a data model at a path nothing has written yet, so a per-message check reports every well-formed batch as broken.