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-compiler

v0.1.1

Published

Kalpa semantic-manifest validation, composition normalization, and Node artifact tooling.

Readme

@sutraa/kalpa-compiler

@sutraa/kalpa-compiler validates canonical manifests and provides a Node-only subpath for loading files, normalizing supported multi-file composition, and building portable JSON artifacts. The root entry point is framework-neutral; @sutraa/kalpa-compiler/node uses synchronous Node.js filesystem APIs.

npm install @sutraa/kalpa-compiler

Root API: validate an in-memory manifest

compileManifest(input, options?) accepts unknown input. It checks the schema, duplicate IDs, unresolved semantic references, and whether every behavior command is declared by its target capability.

import { compileManifest } from "@sutraa/kalpa-compiler";

const result = compileManifest(input, {
  source: { file: "experience.kalpa.json", line: 1, column: 1 },
});

if (!result.ok || !result.manifest) {
  for (const diagnostic of result.diagnostics) {
    console.error(diagnostic.code, diagnostic.path, diagnostic.message);
  }
} else {
  console.log(result.summary);
}

| Result field | Meaning | | --- | --- | | ok | true only when no compiler diagnostic exists. | | manifest | validated canonical manifest when ok is true. | | summary | entity, relationship, capability, behavior, and representation counts. | | diagnostics | structured errors with code, path, message, and optional source. |

Node API: files, composition, and artifacts

Import Node-only helpers from the explicit subpath.

import {
  buildProjectArtifact,
  compileManifestFile,
  compileProjectFile,
  loadProjectArtifact,
} from "@sutraa/kalpa-compiler/node";

Use compileManifestFile for a single canonical JSON manifest. Use compileProjectFile for either a canonical manifest or a supported composition entry. The latter normalizes valid fragments into a canonical manifest before returning it.

const project = compileProjectFile("./manifests/equipment.kalpa.json");
if (!project.ok) throw new Error(JSON.stringify(project.diagnostics));

const built = buildProjectArtifact(
  "./manifests/equipment.kalpa.json",
  "./dist/equipment.artifact.json",
);
if (!built.ok) throw new Error(JSON.stringify(built.diagnostics));

const loaded = loadProjectArtifact("./dist/equipment.artifact.json");
if (loaded.ok) console.log(loaded.artifact?.summary);

Supported composition model

Composition is authoring input, not renderer or runtime input. A composition entry owns the experience declaration and relationships; fragments each own exactly one or more of the required semantic collections. Every required collection must have one owner: entities, capabilities, behaviors, and representations.

{
  "compositionVersion": "0.1",
  "experience": { "id": "pump-demo", "name": "Pump demo", "purpose": "Inspect a pump", "defaultRepresentation": "dom" },
  "relationships": [],
  "fragments": ["./entities.kalpa.json", "./interaction.kalpa.json"]
}
{
  "fragmentVersion": "0.1",
  "owns": ["entities"],
  "entities": []
}

| Rule | Consequence | | --- | --- | | A fragment reference appears twice | deterministic COMPOSITION_CONFLICT diagnostic. | | Two fragments own the same collection | deterministic COMPOSITION_CONFLICT diagnostic. | | A required collection has no owner | COMPOSITION_INVALID diagnostic. | | Raw composition is sent to a runtime or renderer | unsupported contract use; compile first. |

The normal boundary is: raw composition → compileProjectFile → canonical manifest → runtime / renderer / artifact.

Artifact contents

buildProjectArtifact writes a JSON artifact with version, source provenance, semantic summary, canonical manifest, and graph snapshot. loadProjectArtifact reparses and revalidates that canonical manifest before returning it. Artifacts are designed for portable structured processing, not as an executable bundle.

License

MIT. Requires Node.js 18 or later.