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

@miadi/attention-core

v0.1.1

Published

Chronicle ATTENTION without a framework: the item vocabulary, the panel's behaviour as plain functions, its visual specification, an HTML-string renderer for servers, and a vanilla DOM mount. @miadi/attention-ui is the React host over the same core. Nothi

Readme

@miadi/attention-core

A panel of questions that wait for a person's answer, without a framework.

In the Miadi stack, an attention item is a question raised inside an episode (by an agent or a person) that the work cannot settle alone: a decision, a consent, a choice between two readings. This package shows those items and collects the answers. It is one of the places where a person's judgment enters the record.

Works with:

  • @miadi/attention-ui: the React host over this core.
  • @miadi/inquiry-weave: reads an episode's attention items and records answers.

One panel, three ways to put it on a page, and every one of them renders the same markup:

| host | entry | what it gives | |---|---|---| | a server that renders HTML | renderAttentionPanelHtml(input) | the panel as a string | | a page with no framework | mountAttentionPanel(root, options) from @miadi/attention-core/dom | disclosure, drafts, validation, submit lifecycle | | React | @miadi/attention-ui | the React host over this core |

The package owns the item vocabulary, the panel's behaviour as plain functions (resolveView, toggleLabel, validateAnswer, initialPanelState …), its visual specification (attentionStyles), and the stylesheet. It owns no transport: nothing here fetches, holds a token, or knows a URL, a filesystem root, or a medicine-wheel address. The host passes items and an onAnswer callback; @miadi/inquiry-weave is the usual source of both.

Server-rendered, then taken over in the browser

// server (Node, CommonJS or ESM)
const { renderAttentionPanelHtml } = require("@miadi/attention-core");
const html = renderAttentionPanelHtml({
  items,                       // from @miadi/inquiry-weave readEpisodeAttention
  initialOpenId: req.query.attention,
  instanceId: "episode-attention",
});
<link rel="stylesheet" href="/vendor/attention-core/attention-panel.css">
<div id="attention">${html}</div>
<script type="module">
  import { mountAttentionPanel } from "/vendor/attention-core/dom.js";
  mountAttentionPanel(document.getElementById("attention"), {
    items, initialOpenId, instanceId: "episode-attention",
    onAnswer: async (item, answer) => {
      const r = await fetch(`/api/episodes/${item.episode}/attention/${item.id}`, {
        method: "POST", headers: { "content-type": "application/json" },
        body: JSON.stringify({ answer }),
      });
      if (!r.ok) throw new Error((await r.json()).error);
      return { tone: "ok", message: "Answer recorded." };
    },
  });
</script>

dist/ has no dependencies and uses relative .js imports, so a host can serve it as static files and a browser loads it with no bundler. The mount re-renders the HTML the server sent, so the panel is taken over in place.

A global inbox, where rows come from different episodes, passes episodeLinks: (item) => [{ href, label }]; the package escapes them and renders them beside the row, never inside its disclosure button.

One panel, not two

@miadi/attention-ui renders its React tree from the same style functions and model, and its parity test renders both for the same input and compares every element, attribute, inline style and text node. A change to the panel is made here, once.