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

@kuhul/ts

v1.0.1

Published

KUHUL TypeScript - TypeScript syntax with KUHUL deterministic semantics

Readme

🏛️ KUHUL TypeScript (KUHUL-TS)

A domain-agnostic semantic graph runtime with TypeScript syntax

npm License


🎯 The Critical Insight

Can the runtime exist before AI?

Answer: YES

KUHUL Kernel v1.0 answers only four questions:

1. What Fold is active?
2. Which Nodes belong to that Fold?
3. How is the Graph transformed?
4. Which Fold is legal next?

Everything else is installed via plugins.


🏛️ Architecture

┌─────────────────────────────────────────────────────────────┐
│  K'UHUL Kernel v1.0 (Domain-Agnostic)                       │
│  • Folds: Pop, Wo, Sek, Chen, Xul                           │
│  • Nodes: Active transformations                            │
│  • XCFE: Transition engine                                  │
│  • Graphs: Data structure                                   │
└─────────────────────────────────────────────────────────────┘
                            ↓
┌─────────────────────────────────────────────────────────────┐
│  Graph IR (Serialization Layer)                             │
│  • SCXQ2 → Backend compilation                              │
│  • JSON  → Interchange, debugging                           │
│  • DOT   → Visualization (Graphviz)                         │
│  • LLVM  → Further compilation                              │
└─────────────────────────────────────────────────────────────┘
                            ↓
┌─────────────────────────────────────────────────────────────┐
│  Plugins (Capability-Specific)                              │
│  • TransformerPlugin - Self-attention                       │
│  • LoRAPlugin - Low-rank adaptation                         │
│  • MoEPlugin - Mixture of experts                           │
│  • PhysicsPlugin - N-body simulation                        │
│  • SVGPlugin - Vector graphics                              │
│  • DatabasePlugin - Data persistence                        │
└─────────────────────────────────────────────────────────────┘

🚀 Quick Start

Installation

npm install @kuhul/ts

Basic Usage

import { KuhulKernel, createNode } from '@kuhul/ts';

// Create kernel
const kernel = new KuhulKernel({
  deterministic: true,
  replayEnabled: true,
  maxCycles: 10
});

// Run cycles
const graph = await kernel.run(3);

console.log(graph);
// { name: 'HashedGraph', nodes: [...], edges: [...] }

With Transformer Plugin

import { KuhulKernel } from '@kuhul/ts';
import { createTransformerPlugin } from '@kuhul/ts/plugins';

const kernel = new KuhulKernel();

// Install transformer capability
kernel.installPlugin(createTransformerPlugin());

// Run transformer inference
const graph = await kernel.run(1);

// Graph now contains:
// - Q/K/V projections
// - Attention computation
// - Softmax, residual, layer norm

With Multiple Plugins

import { createTransformerPlugin } from '@kuhul/ts/plugins';
import { createLoRAPlugin } from '@kuhul/ts/plugins';
import { createMoEPlugin } from '@kuhul/ts/plugins';

const kernel = new KuhulKernel();

// Install multiple capabilities
kernel.installPlugin(createTransformerPlugin());
kernel.installPlugin(createLoRAPlugin());
kernel.installPlugin(createMoEPlugin());

// Run MoE architecture with LoRA adaptation
const graph = await kernel.run(3);

📐 Key Concepts

Folds (Semantic State Containers)

// 5 semantic folds
const folds = ['Pop', 'Wo', 'Sek', 'Chen', 'Xul'];

// Each fold holds nodes
// Pop   → Load/Input
// Wo    → Store/Build structures
// Sek   → Execute/Compute
// Chen  → Collapse/Emit
// Xul   → Terminate/Store

Nodes (Active Transformations)

import { createNode } from '@kuhul/ts';

// Create a custom node
const myNode = createNode('my_transform', (graph) => {
  return {
    ...graph,
    name: 'TransformedGraph',
    nodes: [...graph.nodes, 'my_data']
  };
});

XCFE (Transition Engine)

// Deterministic transitions
Pop → Wo → Sek → Chen → Xul → Pop → ...

// Kernel manages transitions
// No manual fold switching needed

Graphs (Data Structure)

interface Graph {
  name: string;
  nodes: string[];
  edges: Array<[string, string]>;
  data?: Map<string, any>;
}

// Flows through folds
// Transformed by nodes
// Serialized via Graph IR

🔌 Plugin System

Capability-Specific Plugins

The kernel is domain-agnostic. Plugins add domain knowledge:

// Transformer Plugin
import { createTransformerPlugin } from '@kuhul/ts/plugins';

kernel.installPlugin(createTransformerPlugin());
// Adds: Q/K/V projections, attention, softmax, residual, layer norm

// LoRA Plugin
import { createLoRAPlugin } from '@kuhul/ts/plugins';

kernel.installPlugin(createLoRAPlugin());
// Adds: LoRA A/B matrices, adaptation

// Physics Plugin
import { createPhysicsPlugin } from '@kuhul/ts/plugins';

kernel.installPlugin(createPhysicsPlugin());
// Adds: Bodies, fields, forces, collisions

Custom Plugins

import { createPlugin, createNode } from '@kuhul/ts';

const myPlugin = createPlugin('MyPlugin', new Map([
  ['Wo', [
    createNode('my_setup', (g) => {
      // Custom transformation
      return { ...g, nodes: [...g.nodes, 'my_data'] };
    })
  ]],
  ['Sek', [
    createNode('my_compute', (g) => {
      // Custom computation
      return { ...g, edges: [...g.edges, ['a', 'b']] };
    })
  ]]
]));

kernel.installPlugin(myPlugin);

📊 Graph IR (Serialization Layer)

The kernel produces Graphs. Graph IR serializes them to multiple formats:

import { graphToGraphIR, GraphIRCompiler } from '@kuhul/ts/graph-ir';

// Convert kernel graph to Graph IR
const graphIR = graphToGraphIR(graph, cycleCount);

// Compile to multiple formats
const compiler = new GraphIRCompiler();

// SCXQ2 (backend compilation)
const scxq2 = compiler.compile(graphIR, 'SCXQ2');

// JSON (interchange, debugging)
const json = compiler.compile(graphIR, 'JSON');

// DOT (Graphviz visualization)
const dot = compiler.compile(graphIR, 'DOT');

// LLVM (further compilation)
const llvm = compiler.compile(graphIR, 'LLVM');

Example: JSON Output

{
  "name": "graph_ir_cycle_1",
  "version": "1.0.0",
  "nodes": [
    {
      "id": "node_0",
      "type": "generic",
      "attributes": {"original_name": "root"},
      "inputs": [],
      "outputs": []
    },
    {
      "id": "node_8",
      "type": "attention",
      "attributes": {"original_name": "QKAttentionGraph"},
      "inputs": ["q_proj", "k_proj"],
      "outputs": ["attn_probs"]
    }
  ],
  "edges": [
    {"source": "q_proj", "target": "k_proj", "type": "data"}
  ]
}

🏗️ Project Structure

my-kuhul-app/
├── src/
│   ├── main.ts              # Entry point
│   ├── kernel.ts            # Kernel setup
│   ├── plugins/             # Custom plugins
│   │   ├── transformer.ts
│   │   └── custom.ts
│   └── graph_ir/            # Graph IR configs
├── dist/
│   ├── bundle.js            # Compiled output
│   ├── graph_ir.json        # Graph IR JSON
│   └── graph_ir.dot         # Graphviz visualization
├── package.json
└── kuhul.config.json        # Configuration

Configuration

{
  "kernel": {
    "deterministic": true,
    "replayEnabled": true,
    "maxCycles": 100
  },
  "plugins": [
    "transformer",
    "lora",
    "moe"
  ],
  "graphIR": {
    "formats": ["SCXQ2", "JSON", "DOT"],
    "outputDir": "./dist"
  }
}

🎓 The Linux Analogy

Linux Kernel

Linux Kernel:
  • Processes, Memory, Files, Scheduling
  
Does NOT know:
  ✗ Photoshop
  ✗ Blender
  ✗ Chrome

Applications install on top.

K'UHUL Kernel

K'UHUL Kernel:
  • Folds, Nodes, XCFE, Graphs
  
Does NOT know:
  ✗ Transformers
  ✗ LoRA
  ✗ MoE
  ✗ Physics
  ✗ SVG

Plugins install on top.

📚 Documentation


🔮 Roadmap

Phase 1: Kernel v1.0 ✅ Complete

  • [x] Domain-agnostic kernel
  • [x] Folds, Nodes, XCFE, Graphs
  • [x] Plugin system
  • [x] Graph IR layer
  • [x] Multiple serializers (SCXQ2, JSON, DOT, LLVM)

Phase 2: Plugins (In Progress)

  • [x] TransformerPlugin
  • [x] LoRAPlugin
  • [x] MoEPlugin
  • [x] PhysicsPlugin
  • [ ] SVGPlugin
  • [ ] DatabasePlugin
  • [ ] NetworkingPlugin

Phase 3: Production

  • [ ] VS Code extension
  • [ ] CLI tools
  • [ ] Performance benchmarks
  • [ ] Example applications
  • [ ] Documentation website

🤝 Contributing

Building a Plugin

import { createPlugin, createNode } from '@kuhul/ts';

export function createMyPlugin() {
  return createPlugin('MyPlugin', new Map([
    ['Wo', [
      createNode('my_setup', (g) => {
        // Your transformation
        return g;
      })
    ]],
    ['Sek', [
      createNode('my_compute', (g) => {
        // Your computation
        return g;
      })
    ]]
  ]));
}

Adding a Serializer

import { GraphIRSerializer, GraphIRModule } from '@kuhul/ts/graph-ir';

export class MySerializer implements GraphIRSerializer {
  readonly name = 'MyFormat';
  
  serialize(module: GraphIRModule): string {
    // Your serialization logic
    return '...';
  }
}

📜 License

MIT


🏛️ The Specification

The K'UHUL Kernel is domain-agnostic. It defines semantic folds, node execution, graph transformation, and deterministic fold transitions. Domain knowledge is never embedded in the kernel; it is introduced exclusively through plugins that register nodes within one or more folds. The Graph IR layer provides serialization independence, allowing the kernel to output multiple formats (SCXQ2, JSON, DOT, LLVM) without modification.


K'UHUL Kernel v1.0 - The runtime exists before AI. Everything else is installed.