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

clm-kernel

v0.0.22

Published

CLM Kernel Core JavaScript & TypeScript Implementation

Readme

clm-kernel (0.0.22, TypeScript and JavaScript)

clm-kernel is the TypeScript and JavaScript implementation of the Cubical Logic Model (CLM). It ships dual ESM and CommonJS bundles alongside a zero-Node browser entry point (clm-kernel/browser) and modular subpaths for Layers 0 through 4.

Installation

Requires Node.js 22+ for server and CLI targets, or any modern ES2022 browser runtime for clm-kernel/browser.

npm install clm-kernel

Subpath exports

package.json defines 21 public export entry points:

| Subpath | Layer and scope | | :--- | :--- | | clm-kernel | Unified root entry point (MCard, ContentHash, MemoryBackend, MCardFileSystem, PlaceTypeLattice, ColoredPetriVM) | | clm-kernel/bin/clmEval | CLI entry point for manifest evaluation, conformance vectors, and formal runtime dispatch | | clm-kernel/layer0 | MCard, PCard, VCard, BLAKE3 hashing, canonical JSON, TypeLattice, MemoryBackend, NodeSqliteBackend, SqlJsBackend, IndexedDbBackend | | clm-kernel/layer1 | TokenMCard, PlaceMCard, TransitionMCard, PlaceTypeLattice, ColoredPetriVM, formalWitness | | clm-kernel/layer2 | MCardCollection, MCardFileSystem, DirectoryManifest, ChunkManifest, PetriProcessPCard, OpenPetriNet, sheafCohomology, bisimulation | | clm-kernel/layer3 | Cordis Context, DisposableList, SavepointGuard, Satori speech-act envelopes, mesh transport | | clm-kernel/layer4 | Sovereign CLI runtime, ViewPlaceMCard, NavigationTransitionPCard, presentation adapters | | clm-kernel/shared | Shared URI, canonicalization, and typed error helpers | | clm-kernel/membrane | Pluggable presentation membrane SPI | | clm-kernel/gateway | JSON-RPC 2.0 and WebSocket Triad Gateway for SSR hosts (Astro, Next.js, Vite) | | clm-kernel/tui | Terminal dashboard components | | clm-kernel/chatbot | Conversational agent session helpers | | clm-kernel/client | Browser and Node WebSocket RPC client | | clm-kernel/drivers/s3 | S3-compatible object storage adapter | | clm-kernel/drivers/ipfs | IPFS content-addressed block adapter | | clm-kernel/primitives | Lightweight MCard, ContentHash, g_time, and TypedValue bundle | | clm-kernel/cel | Hermetic Common Expression Language (CEL) evaluator | | clm-kernel/vcard | VCard identity, AgentDid, and Pre-VCard / Post-VCard boundary guards | | clm-kernel/pcard | PCard morphism definitions, PrimitivePCard, BooleanPCard, and DynamicPCard | | clm-kernel/browser | Browser-safe bundle (MCard, MCardCollection, MemoryBackend, SqlJsBackend, IndexedDbBackend, SyncService) with zero node:* imports | | clm-kernel/sync | SyncContract v1 (types, codec, petri, service) for MCard delta synchronization | | clm-kernel/browser/process | Browser-safe process and fibration runtime (PtrCordisEngine, PetriProcessPCard, FiberLifecycle, ProcessFibration, ColoredPetriVM, CodecRegistryService, createBrowserProcessContext) with zero node:* imports | | clm-kernel/api-surface.json | Generated public type and value exports, with stability and module-format information | | clm-kernel/published-capabilities.json | Capability register and versioned conformance cases |

The package also contains CHANGELOG.md at its root, synchronized from the repository changelog.

In the TypeScript CEL evaluator, a comparison's right-hand side is a literal by default, including a bare $threshold. To compare against a field, opt in with evaluateCelExpression('score >= $threshold', context, { fieldReferences: true }). In dispatch, set celFieldReferences: true in the dispatchWithHoare options. Field-to-field comparisons read own fields on both sides; input. and output. select that card without falling back to the other. A missing field causes the comparison to bail, and unmatched terms in a compound expression fail closed in this mode. Quote a string such as '$threshold' to compare it literally even with the opt-in enabled.

Quick start

TypeScript and ES modules

import { MCard, MemoryBackend, MCardFileSystem } from 'clm-kernel';

const storage = new MemoryBackend();
const fs = MCardFileSystem.withBackend(storage);

const payload = JSON.stringify({ status: 'active' });
const card = MCard.create(payload, 'did:clm:example');
const stored = fs.writeFile('/agents/card-001.json', payload, 'did:clm:example');
const fetched = fs.readFile('/agents/card-001.json');

console.log(`Card hash: ${card.hash.hex}`);
console.log(`Stored URI: ${stored.uri} (${fetched.payload.kind})`);

CommonJS

const { MCard, MemoryBackend, MCardFileSystem } = require('clm-kernel');

Contract parameters and generated vocabulary

Inside the kernel, contract-owned values come from modules generated from the CLM runtime contract: src/layer0/vocabulary.ts, vocabularyEnv.ts, vocabularyTypes.ts, vocabularyIdentities.ts, signatureDefaults.ts, and parameterContext.ts, plus src/vcard/dispatchCatalog.ts for dispatch catalog ids. The build inlines the vocabulary constants (see tsup.config.ts), so they add no runtime imports and leave the bundle tree-shakable ("sideEffects": false). parameterContext.ts resolves CLI over environment (CLM_* names) over a signed card override over the contract default, and throws ParameterBoundaryError for a value outside its refinement.

In 0.0.21 these modules, providerProfiles.ts, and the functional.ts combinators (identity, compose, pipe) are internal: no subpath above exports them, so the public API is unchanged.

Build outputs

  • ESM: ./dist/index.js (./dist/index.d.ts)
  • CommonJS: ./dist/index.cjs (./dist/index.d.ts)
  • Browser: ./dist/browser/index.js (./dist/browser/index.d.ts)

License

MIT License. Source code, formal proofs, and Python and Rust kernels live in the CLM repository.