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

@warp-lang/commerce-viz

v0.1.0

Published

Read-only visualizer of the Warp Commerce Model: renders the real state-transition table (schema/behavior/transitions.json) as a state graph (SVG or self-contained HTML). It draws the model derived from the frozen schema; it is not a no-code platform and

Readme

@warp-lang/commerce-viz

A read-only visualizer of the Warp Commerce Model. It renders the model's real state-transition table as a state graph — nodes are states, arrows are legal transitions — as an SVG (one per primitive) or a single self-contained HTML page.

Honest scope

This package reads and draws the model. That is all it does.

  • It is read-only. Phase 1 (this package) renders; it does not edit.
  • It is not a no-code platform and not a workflow builder.
  • It does not execute, validate, authorize, settle, or simulate any commerce action. For structural validation use @warp-lang/commerce-types; to expose that validation to an agent use @warp-lang/commerce-mcp.
  • The graph is derived from the frozen schema, never hardcoded. If the schema changes, the rendered graph changes with it.

How the graph is derived from the model

The renderer reads the real transition table at schema/behavior/transitions.json — the machine-readable form of the model's State Monotonicity invariant — and builds a graph per primitive (commitment, intent, fulfillment) from it:

  • Nodes — every state that appears in the table, either as a source key or as a transition target.
  • Edges — one directed edge for every source → target pair listed in the table. A pair not listed is not drawn (the table is exhaustive).
  • Terminal states — a state whose row is an empty list is drawn with a red border.

Nothing about the states or edges is written into this package's code. The loader (src/transitions.ts) parses the JSON; the renderer (src/render.ts) lays it out. The layout is a deterministic layered placement, so the same table always produces the same artifact (useful for committing and diffing a sample).

Note: the table documents one special case in notes.fulfillment_failed_recovery — a Failed fulfillment may return to Planned only when its recoverable flag is true. That is a runtime, data-dependent edge, not a static table entry, so it is not drawn as a fixed arrow. The static graph shows the table as written, where Failed is an empty (terminal) row.

Run it

npm install
# render every primitive to ./out as SVG + a combined HTML page
npm run render
# or regenerate the committed sample under ./examples
npm run sample
# build the bundled CLI/library to ./dist
npm run build

CLI:

warp-commerce-viz [--out <dir>] [--format svg|html|both]
  • --out <dir> output directory (default out)
  • --format svg (one file per primitive), html (one combined page), or both (default)

Sample output

A committed sample lives in examples/: one SVG per primitive plus a combined examples/index.html. Open the HTML in any browser straight from disk — no server, no external assets.

Tests

npm test renders each graph, parses the rendered SVG/HTML back out, and asserts the nodes and edges match schema/behavior/transitions.json — the expectations are read from that file at test time, so they are derived from the model rather than hardcoded.

Phase 2 (future, not in this package)

A later phase could let a user edit a graph and emit a model (a transition table or a higher-level workflow description) from the edited graph, with the edits validated against the frozen invariants before anything is emitted. That write path is out of scope here; this package is the read-only viewer it builds on.