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

@redwood-labs/cambium-runner

v0.5.0

Published

TS runtime for Cambium — executes compiled IR produced by the Cambium Ruby DSL.

Readme

@redwood-labs/cambium-runner

TypeScript runtime for Cambium — executes compiled IR produced by the Cambium Ruby DSL.

This is the library form. For the cambium CLI (authoring .cmb.rb files, scaffolders, cambium run), install the cambium package instead.

Install

npm install @redwood-labs/cambium-runner

Use (engine mode)

Host projects import runGen and supply their own schemas:

import { runGen } from '@redwood-labs/cambium-runner';
import * as schemas from './schemas.js';

// `ir` is the JSON IR emitted by the Ruby compiler (or constructed programmatically).
const result = await runGen({ ir, schemas, mock: false });

if (result.ok) {
  console.log(result.output);
  console.log('Trace:', result.trace);
}

Options

await runGen({
  ir,                // IR object
  schemas,           // Record<string, JSONSchema7> — single source of truth for validation
  mock: false,       // use deterministic mock instead of live LLM
  memoryKeys: [],    // `--memory-key name=value` slot values
  sessionId,         // explicit session id for memory :session scope
  correctors,        // Record<string, CorrectorFn> — override built-ins or add plugins
  logSinks,          // Record<string, LogSink>   — override built-ins or add plugins
  firedBy,           // 'schedule:<id>[@<iso>]' — when invoked by a cron fire
  runId,             // optional: pin the run id (host wants the emitted dir/trace path
                     //           to match a value it generated; auto-generated otherwise).
                     //           Validated as a safe path segment.
});

Types

import type {
  IR,
  RunGenOptions, RunGenResult,
  CorrectorFn, CorrectorResult, CorrectorIssue,
  ToolContext,
  LogEvent, LogSink, LogDestination, RunEventName, FailReason,
} from '@redwood-labs/cambium-runner';

Compiling IR

The IR is produced by the Cambium Ruby compiler (ruby/cambium/compile.rb), which ships with the cambium CLI package. Engine-mode hosts typically commit a compiled <name>.ir.json alongside each gen and import that — or shell out to cambium compile <file.cmb.rb> as a build step.

Internal exports

@redwood-labs/cambium-runner also exports runGenFromIr / RunGenFromIrOptions / RunGenFromIrResult. These are the in-process CLI-orchestration helpers used by the cambium binary — they wrap schema discovery (engine-mode sibling schemas.ts or app-mode Genfile.toml [types].contracts) plus artifact writes around runGen. Engine-mode library consumers should call runGen directly; runGenFromIr assumes a filesystem layout the host already controls explicitly.

Optional dependencies

Memory (better-sqlite3, sqlite-vec) and the WASM exec substrate (quickjs-emscripten) are declared as optionalDependencies. Gens that don't declare memory :... or security exec: { runtime: :wasm } never trigger the import; installs without those native builds succeed without penalty.

License

MIT — see LICENSE.