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

@fiberfx/devtools

v4.1.1

Published

Native Mercury DevTools, the Mercury Inspector: a development-only collector over Hypergraph's public inspect (./connect), with bounded, detached protocol-2 records of scoped work, a headless recorder for screen tests (./test), a review-desk export, and i

Readme

@fiberfx/devtools: the Mercury Inspector

Development-only inspection of a Mercury app's Hypergraph, on protocol 2. One collector, three surfaces: a dock in the page, a headless recorder for screen tests, and a review-desk export. It reads only Hypergraph's public surface (@fiberfx/hypergraph/inspect, watch, a scoped getState) and never writes the app's graph, calls an event or writes a store.

Attach: mx dev --inspect

mx dev --inspect          # or "inspect": true in the app's mx.json

mx dev puts the Inspector's attach before the app's entry, so it observes declarations before any model evaluates, and mounts the dock (Ctrl/⌘+Shift+I). The app must resolve @fiberfx/devtools like its other members (a require and a replace by directory in its mx.mod, or a workspace that has it); mx dev refuses otherwise and says so. A forked scope joins with one dev-only line, a no-op without the Inspector:

const release = globalThis.__MERCURY_INSPECTOR__?.registerScope({ id: "taskdesk", scope });
// …in the cleanup, beside dispose(scope):
release?.();

The collector: @fiberfx/devtools/connect

import { connect } from "@fiberfx/devtools/connect";

const session = connect({ appId: "taskdesk" });          // one session per app id
session.observeDeclarations();                           // before the model loads: declarations are never replayed
const release = session.registerScope({ id: "desk", label: "taskdesk", scope, stores: { draft: $draft } });
session.records();                                       // detached protocol-2 records, oldest first
session.detach();                                        // every subscription released; idempotent
  • Records. unit.declared/unit.new (with a module from the sid), unit.observed, unit.skipped, unit.error, unit.reset (with Hypergraph's own describe text), effect.perform/effect.settle, store.snapshot, generation.commit, capture.gap. Each carries gen, cause, tx and its scope label.
  • Transactions. A call from outside is a root; the updates it caused join its transaction (tx) by cause.
  • Exact scopes. One subscription per registered scope; global work only through registerGlobal.
  • Bounded at scale. 2,000 records, 1,000 per scope (a noisy window evicts its own history, not a quiet one's), 4 MiB of previews, 32 scopes, 512 scope–store pairs; counters name every eviction and drop.
  • Safe previews. Primitives as text, an Error as its message, anything else opaque unless previewPolicy.project returns plain data.

Screen tests: @fiberfx/devtools/test

import { recordSession } from "@fiberfx/devtools/test";

const s = recordSession({ scope, label: "taskdesk", stores: { decisions: $decisions } });
// …render and interact…
s.updates("draft");            // observed updates of a unit (by id, or its last segment)
s.causeChain("draft");         // from the root call to the unit's last update
s.snapshots("decisions");      // a registered store followed by its registry key
s.transactions(); s.declared(); s.resets(); s.errors(); s.lines();
s.detach();                    // s.handles is 0 afterwards

A refused registration throws and leaves nothing behind.

Review desk: exportReview

session.exportReview({ tx } | { unit, scope? } | { seqs, scope? }) returns a serializable mercury-inspector-review/1 payload: scope (or mixed with every scope listed), gen, unit, transaction, up to 50 records, omitted, a summary within 280 characters for a note's human text, capturedAt, and a plain-text brief. The evidence travels beside a review note; it never replaces the note's own words. A reader of saved exports checks them against REVIEW_SCHEMA, REVIEW_RECORDS and REVIEW_SUMMARY_CHARS rather than copies of them, from @fiberfx/devtools/review: that entry reaches the protocol and nothing of the live collector, so a production reader can import it (./connect re-exports the same names for a page that has a session).

The dock: @fiberfx/devtools/panel

mountInspectorDock(session) (what mx dev --inspect uses) or mountDevtoolsPanel(element, session). Views: Timeline, Transactions (by cause, indented), Units (by module), Stores, Session. Copy for review copies an export and reports success only after the clipboard took it; otherwise it shows the evidence as selectable text. Escape and Close close it; text only, never markup.

The dock wears the page's theme class (dark-theme or light-theme) and follows it as it changes. It reads it from <html>, or, when the theme sits on an inner element, from the element a page names with <meta name="mercury-inspector-theme-from" content=".practice">; mountInspectorDock(session, { themeFrom }) takes an element or a selector directly. A selector is looked up again as the page changes, so an element that mounts after the dock, or is replaced, is followed; until one matches, the dock follows <html> (with one console note).

Commands

| Command | Covers | |---|---| | mx test --root devtools (from fiberfx/) | The collector, recorder, export and dock rows, in headless Chromium against the real Hypergraph | | Native library build | mx build --package: every public entry built, peers external, declarations generated, mx.sum kept. No Node build tooling here |

Limits. Declarations are seen from attachment only (Hypergraph has no replay). Until H1's compiler names units, events show run-time ids. Hypergraph has no public ./hmr yet, so the reset row runs through an injected engine.