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

@surprisal/hyperchart

v0.6.0

Published

Durable, typed statechart workflows for agents and scripts

Readme

@surprisal/hyperchart

Host-neutral Hyperchart authoring, machine, replay, runtime, and inspector models.

Install

npm install @surprisal/hyperchart

Requires Node.js 22.19 or newer.

Create a chart

import { chart, final, script } from "@surprisal/hyperchart";

export default chart({
  kind: "chart",
  id: "hello",
  args: {
    message: { description: "Text to print", default: "hello" },
  },
  initial: "run",
  states: {
    run: {
      kind: "state",
      action: script("node", ["-e", "console.log('done')"]),
      transitions: { DONE: "done" },
    },
    done: final(),
  },
});

Optional chart-level args metadata gives hosts serializable descriptions and JSON defaults for on-demand launch forms; it is inspection metadata, not executable validation or automatic runtime input. refs<Args>().chart() accepts subset or empty metadata and rejects every key outside Args, including typos mixed with valid keys. A script with one successful transition may select it implicitly on exit code 0. Top-level final() and failed() terminals explicitly select complete or failed run outcome; optional terminal notifications can append a scoped prompt and authoritative paths for declared artifacts. Runner/host delivery uses a persist-once outbox and per-session receipts.

Entry points

| Import | Purpose | |---|---| | @surprisal/hyperchart | DSL, types, parsing, inspection, machine, projection, replay | | @surprisal/hyperchart/runtime | generic runtime, log stores, scripts, guards, artifacts | | @surprisal/hyperchart/host | canonical chart/run models and adapters | | @surprisal/hyperchart/react | optional React inspector and run surfaces | | @surprisal/hyperchart/react/styles.css | required inspector stylesheet | | @surprisal/hyperchart/package.json | package metadata | | @surprisal/hyperchart/inspect | run inspection, inspector server, and session transcripts | | @surprisal/hyperchart/sessions | session progress, steering, and run status |

The host runtime overlay distinguishes map actions held behind a concurrency gate as waiting; admitted or invoked actions remain running. In the React inspector, agent cards show declared role/toolset metadata and resolved model/tool configuration, while a selected run state's Runtime section owns its live-session controls and actual launch-plan summary. HyperchartRunStrip accepts the lightweight chart/run summaries from readSessionSnapshot() directly and hides progress when its three summary progress fields are omitted or incomplete.

The core package has no Pi dependency. React integrations use the optional peer dependencies declared by the package.

Documentation

Explicit actors

The core package includes statically placed, event-sourced actors with explicit receive(), FIFO send, typed call, and graph-inferred reply(). See the canonical explicit actor guide.

MIT · experimental 0.6.0

Static actor pools are available through actorPool(). Use singleton send()/call() or explicit non-empty sendBatch()/callBatch(); actor templates may target their current endpoint with send-only self(). See the canonical explicit actors guide.

Branch storage

The runtime exports v2 storage mutation/branch types, normalized tree queries, JsonlLogStore, listHyperchartBranches, getHyperchartBranch, forkHyperchartRun, and append-only rewindHyperchartRun. Every runner/inspection uses an explicit branch handle. Detached runners distinguish the owning repository projectDir from each isolated <runDir>/workspaces/<branchId> action cwd; scripts receive both as HYPERCHART_PROJECT_DIR and HYPERCHART_BRANCH_WORKSPACE.