clm-kernel
v0.0.1
Published
CLM Kernel Core JavaScript & TypeScript Implementation
Readme
clm-kernel
Cubical Logic Model (CLM) Kernel Core — JavaScript & TypeScript Substrate.
clm-kernel is the native TypeScript/JavaScript kernel for the Card Lifecycle Manager (CLM). It provides dual CommonJS and ECMAScript Module (ESM) distributions with subpath exports for all architectural layers.
Installation
npm install clm-kernelSubpath Exports
The package exports both modular subpaths and a unified root entry point:
| Subpath | Purpose |
| :--- | :--- |
| clm-kernel | Unified entry point (MCard, ContentHash, TriDatabaseManager, etc.) |
| clm-kernel/layer0 | Storage backends (Memory, Node SQLite, SQL.js), Merkle DAG, Vector Clock |
| clm-kernel/layer1 | MCard AST and JSON Schema validation |
| clm-kernel/layer2 | CPN-VM reactive graph and Petri Net execution |
| clm-kernel/layer3 | Cordis Fiber runtime, DisposableList, and SavepointGuard |
| clm-kernel/layer4 | Sovereign Executor, CLI runtime, and Triad Gateway |
| clm-kernel/gateway | Triad Gateway for SSR frameworks (Astro, Next.js, Vite) |
| clm-kernel/client | Lightweight browser client for WebSocket and RPC communication |
Quick Start
TypeScript / ES Modules
import { MCard, MemoryBackend, MCardFileSystem } from 'clm-kernel';
// Initialize in-memory storage backend
const storage = new MemoryBackend();
const fs = new MCardFileSystem(storage);
// Create an MCard
const card = new MCard({
id: "card-001",
name: "agent-state",
data: { status: "active" }
});
await fs.writeCard(card);
console.log(`Stored card: ${card.id}`);CommonJS
const { MCard, MemoryBackend } = require('clm-kernel');Dual Build Bundles
- ESM:
./dist/index.js(with type definitions./dist/index.d.ts) - CJS:
./dist/index.cjs(with type definitions./dist/index.d.ts)
License
MIT License. See LICENSE for details.
Monorepo & Documentation
Source code, formal proofs, and multi-language kernels (Rust, Python, WASM) are maintained in the main CLM Repository.
