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

@moikapy/origen-zero

v0.1.1

Published

Bridge package connecting Origen agents to ZeroLang compiler and runtime

Readme

@moikapy/origen-zero

Bridge package connecting Origen agents to the ZeroLang compiler and runtime.

Why?

Origen agents write tool logic in TypeScript. ZeroLang is a systems language designed for agents — structured compiler output, explicit effects, repair metadata, and JSON diagnostics are first-class. This package bridges the two:

  • Define tools in Zero — Write .0 files, compile them, get structured diagnostics before registration
  • Register as OrigenTools — Zero functions become first-class Origen tools
  • Interactive compiler toolszero_check, zero_graph, zero_size, zero_fix as Origen tools
  • Self-modify — Write, check, fix, and register tools during a single conversation session

Install

npm install @moikapy/origen-zero

Prerequisites:

  • @moikapy/origen ^0.6.0 (peer dependency)
  • Zero CLI installed and available on $PATHinstall guide

Usage

Register a Compiled Zero Binary as OrigenTool

import { createZeroTool } from "@moikapy/origen-zero/tools";
import { streamOrigen } from "@moikapy/origen";

const lookupTool = createZeroTool({
  functionName: "lookup",
  description: "Look up a record by ID",
  executablePath: "./bin/lookup",
});

const config = {
  appName: "MyAgent",
  tools: [lookupTool],
  getD1: async () => myD1,
};

Interactive Compiler Tools (LLM Calls Zero CLI)

import { createZeroCompilerTools } from "@moikapy/origen-zero/tools";

const compilerTools = createZeroCompilerTools();
// Returns: [zero_check, zero_graph, zero_size, zero_fix]

Write, Check, Fix, Register — Full Loop

import { compileAndRegister } from "@moikapy/origen-zero/tools";

const result = await compileAndRegister({
  path: "math.0",
  content: sourceCode,
});

if ("tools" in result) {
  // ✅ Compiled — result.tools are ready
} else {
  // ❌ Errors — return to LLM for self-repair
  console.log(result.errors);
}

Direct Compiler Access

import { ZeroCompiler } from "@moikapy/origen-zero/compiler";

const compiler = new ZeroCompiler({ binaryPath: "zero", timeout: 10000 });

// Check for errors
const result = await compiler.check("fun main() {}" /* ... */);
if (result.ok) { /* clean */ }

// Get dependency graph
const graph = await compiler.graph("./src/math.0");

// Get size estimates
const sizes = await compiler.size("./src/math.0");

// Build WASM for Workers
const build = await compiler.build("./src/math.0", { emit: "wasm", target: "wasm32-web", out: "./dist/math" });

API

ZeroCompiler

| Method | Description | Zero CLI | |---|---|---| | check(source) | Check for errors, return diagnostics | zero check --json | | graph(source) | Get dependency graph | zero graph --json | | size(source) | Get function size estimates | zero size --json | | fix(source) | Get repair suggestions | zero fix --plan --json | | build(source, opts?) | Compile to native executable | zero build | | explain(code) | Human-readable diagnostic explanation | zero explain |

Tool Registration

| Function | Description | |---|---| | createZeroTool(config) | Register a compiled Zero function as an OrigenTool | | createZeroToolsFromProgram(path, opts?) | Discover and register all public functions | | compileAndRegister(source, opts?) | Write → compile → verify → register in one call |

Interactive Compiler Tools

| Tool Name | Description | |---|---| | zero_check | Check Zero source for errors | | zero_graph | Show dependency graph | | zero_size | Show function size estimates | | zero_fix | Suggest repairs for errors |

Error Types

| Error | When | |---|---| | ZeroCompilerNotFoundError | zero binary not on PATH | | ZeroCheckFailedError | Source has diagnostics | | ZeroBuildFailedError | Build produces no output | | ZeroTimeoutError | CLI invocation exceeds timeout | | ZeroExecutionError | Compiled binary exits non-zero |

WASM Execution (Workers-ready)

import { createZeroWASMTool } from "@moikapy/origen-zero/wasm-tool";
import { readFileSync } from "node:fs";

// Load pre-compiled WASM module
const wasmBytes = readFileSync("./dist/my-tool.wasm");

// In Workers — WASM runs in-process, no subprocess or HTTP needed
const tool = createZeroWASMTool({
  functionName: "main",
  description: "My Zero tool",
  wasmBytes,
});

// Execute: Zero program writes to stdout, tool captures the output
const result = await tool.execute({ input: "hello" });

Build the WASM module from Zero source:

zero build --emit wasm --target wasm32-web src/my-tool.0 --out dist/my-tool

Execution Modes

| Mode | Transport | Works In | When | |---|---|---|---| | subprocess | execFile() | Node.js, Bun | Native binaries | | http | fetch() | Workers, Node, browser | Remote Zero service | | wasm | WebAssembly.instantiate() | Workers, Node, browser | Pre-compiled .wasm |

License

MIT