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

@sutraa/kalpa-runtime

v0.1.1

Published

Deterministic semantic-experience runtime for Kalpa manifests.

Readme

@sutraa/kalpa-runtime

@sutraa/kalpa-runtime runs a canonical Kalpa manifest as a deterministic in-memory command state machine. It owns logical time, ordered events, state snapshots, command rejection diagnostics, reset, and replay. It does not render UI or interpret behavior.effect strings.

npm install @sutraa/kalpa-runtime

Create a runtime

Pass a valid canonical ExperienceManifest, preferably one returned by compileManifest from @sutraa/kalpa-compiler.

import { createKalpaRuntime } from "@sutraa/kalpa-runtime";

const runtime = createKalpaRuntime(manifest);
console.log(runtime.getState());
// { selectedEntityId: null, inspectedEntityId: null, inspectionOpen: false, logicalTime: 0 }

Dispatch commands

Every command includes a declared source: dom, canvas, cli, or agent. dispatch returns an accepted result with an optional committed event, or a rejected result with a diagnostic. Existing state is never mutated in place; getter methods return snapshots.

| Command | Preconditions | Accepted state change | Event | | --- | --- | --- | --- | | select-entity | entity exists and declares selectable | sets selectedEntityId | entity-selected | | inspect-entity | entity exists and declares inspectable | selects entity, opens inspection | inspection-opened | | reset-experience | none | restores initial state | experience-reset |

const selected = runtime.dispatch({
  type: "select-entity",
  entityId: "pump",
  source: "cli",
});

if (!selected.accepted) {
  console.error(selected.diagnostic);
} else {
  console.log(selected.event?.sequence); // 1
}

runtime.dispatch({ type: "inspect-entity", entityId: "pump", source: "cli" });
console.log(runtime.getState().inspectedEntityId); // "pump"
console.log(runtime.getEvents());                  // ordered events, logical times 1 then 2

Rejection diagnostics

The runtime rejects invalid interaction commands deterministically. The diagnostic codes are ENTITY_NOT_FOUND, CAPABILITY_UNAVAILABLE, and COMMAND_UNSUPPORTED. Rejections are returned from dispatch; they are also retained by getDiagnostics().

const result = runtime.dispatch({
  type: "inspect-entity",
  entityId: "unknown-pump",
  source: "agent",
});

if (!result.accepted) {
  console.log(result.diagnostic?.code); // "ENTITY_NOT_FOUND"
}

Replay a command list

replay creates a fresh runtime from the same manifest and applies commands in order. It does not alter the current runtime. This is useful when a host or test needs to check that the same command sequence produces the same state and events.

const replay = runtime.replay([
  { type: "select-entity", entityId: "pump", source: "cli" },
  { type: "inspect-entity", entityId: "pump", source: "cli" },
]);

console.log(replay.state.inspectionOpen); // true
console.log(replay.events.length);        // 2

What this package does not do

The runtime does not load files, validate every manifest reference, render a representation, persist state, schedule work, or run arbitrary behavior strings. Use @sutraa/kalpa-compiler for validation and file/artifact operations; provide your own host or renderer around the runtime.

License

MIT. Requires Node.js 18 or later.