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

@pixell/agent-ui

v0.1.2

Published

Reactive, JSON-spec driven UI renderer for agent-style applications. Provide a UI Spec object and this package renders a complete interactive UI using React 18 with a rich set of components.

Readme

@pixell/agent-ui

Reactive, JSON-spec driven UI renderer for agent-style applications. Provide a UI Spec object and this package renders a complete interactive UI using React 18 with a rich set of components.

Install

npm install @pixell/agent-ui
# peer deps
npm install react react-dom

Quick start

import { renderUISpec, type UISpecEnvelope } from '@pixell/agent-ui'

const spec: UISpecEnvelope = {
  manifest: { id: 'demo', name: 'Demo App', version: '0.1.0' },
  data: { user: { name: 'Alex' }, items: [{ id: 1, name: 'Alpha' }] },
  actions: {
    openDocs: { kind: 'open_url', url: 'https://example.com/docs' }
  },
  view: {
    type: 'page',
    props: { title: 'Welcome, {{ user.name }}' },
    children: [
      { type: 'text', props: { content: 'Here is your list:' } },
      { type: 'list', props: { data: '@items', item: { type: 'text', props: { content: '{{ name }}' } } } },
      { type: 'button', props: { label: 'Docs', onPress: { action: 'openDocs' } } }
    ]
  }
}

const container = document.getElementById('root')!
const { unmount } = renderUISpec(container, spec, {
  onOpenUrl: url => window.open(url, '_blank')
})

Core API

  • renderUISpec(container, spec, options?) → { unmount() }: Renders a UISpecEnvelope into a DOM container.
  • applyPatch(spec, ops) → spec: Apply whitelisted JSON patch operations to /data and /view.

Types

  • UISpecEnvelope: { manifest, data?, actions?, view, theme? }
  • UISpecNode: { type: string, props?, children? }
  • RenderOptions:
    • onOpenUrl?: (url) => void
    • onHttp?: (req) => Promise<{ status, body?, headers? }>
    • intentClient?: { invokeIntent(event, payload?): Promise<{ ok, data?, error? }> }
    • capabilitySet?: { components: string[]; features?: string[] }

Data binding

  • Strings support {{ key.path }} template interpolation from current item scope, then from spec.data.
  • Any string starting with @ is treated as a direct binding to spec.data path (e.g., "@items").
  • Objects/arrays are resolved recursively.

Events and actions

  • Use onPress: { action: 'name' }, onSubmit, onChange, onOpenChange in component props.
  • Actions are defined in spec.actions:
    • open_url: delegates to options.onOpenUrl(url).
    • http: delegates to options.onHttp({ method, url, body, headers }). Extended methods (PUT/PATCH/DELETE) require capabilitySet.features to include "http.extended".
    • state.set: local UI state sync (handled internally).
    • emit: calls options.intentClient.invokeIntent(event, payload) if provided.

Theming

Provide spec.theme.tokens as a map of CSS custom properties. They are applied to the document root, e.g. { "color-primary": "#4f46e5" } becomes --color-primary: #4f46e5.

Available components

The default registry includes the following type values:

  • Layout/Page: page, container, form, formField
  • Text & Links: text, link
  • Inputs: textInput, textarea, select, checkbox, radioGroup, switch, numberInput
  • Buttons & Actions: button
  • Lists & Tables: list, table
  • Overlays: modal, drawer, popover
  • Navigation: tabs, accordion, breadcrumb, pagination
  • Feedback: spinner, skeleton, progress, alert, toast, emptyState
  • Data Display: card, badge, chip, avatar, tooltip, image, icon
  • Fallback: unknown

Notes:

  • list: expects props.data (binding or array). Optional props.item is a nested UISpecNode used to render each row. When capabilitySet.components excludes table, a table node is auto-downgraded to a list.
  • Some components accept embedded nodes: tabs.items[].content, card.header, card.footer, popover.trigger, popover.content can be nested UISpecNode objects.

Capability sets

Pass options.capabilitySet to control availability:

  • components: restrict which component types can render.
  • features: feature toggles, e.g., http.extended to allow PUT/PATCH/DELETE.

Building locally

cd packages/agent-ui
npm run clean && npm run build

Publishing to npm

Prereqs:

  • Ensure the package name is available and scoped (@pixell/agent-ui).
  • You must be logged in to npm and have publish rights for the scope.

Steps:

cd packages/agent-ui
# 1) bump version in package.json
npm version patch   # or minor/major

# 2) build artifacts
npm run clean && npm run build

# 3) publish (scoped package, public access configured)
npm publish --access public

If you see 403 errors, confirm:

  • You are authenticated: npm whoami
  • Scope permissions are correct: npm access ls-collaborators @pixell/agent-ui

Example

See examples/simple/index.html in this repo for a minimal usage example embedding a script bundle.

License

MIT