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

@anteriorai/srg-compiler

v0.5.1

Published

SRG v2 compiler - compiles .srg files to executable JSON

Readme

@anteriorai/srg-compiler

Compiles .srg files to executable JSON format compatible with the Python symbolic_reasoning runtime.

Public preview. This package is an early public release of Anterior's symbolic reasoning tooling. It is being published to support transparency, research discussion, and early experimentation while the broader open-source repository is prepared for release.

Future releases may be made available under updated licensing terms. Until then, use of this package is governed by the license included with this release.

This release should not be treated as a supported product, a stable API, or a complete reference implementation. It is provided "as is," without warranties of any kind. Users are responsible for evaluating correctness, security, compliance, and suitability for their own use case.

Installation

npm install @anteriorai/srg-compiler

Usage

Programmatic API

import { compile, compileFile } from '@anteriorai/srg-compiler';

// Compile from string
const source = `
predicate is_adult: "Is patient 18 or older?"
outcome approved: "Approved"
is_adult => approved
`;

const json = await compile(source);

// Compile from file
const json2 = await compileFile('policy.srg');

CLI

# Compile a .srg file
npx srg-compile policy.srg

# Specify output file
npx srg-compile policy.srg --output result.json

# Pretty print JSON
npx srg-compile policy.srg --pretty

Output Format

The compiler outputs JSON that matches the JSON schema SRG model exactly:

{
  "edges": {...},
  "nodes": {...},
  "predicates": {...},
  "aggregators": {...},
  "outcomes": {...},
  "policy_context": null
}

This JSON can be directly loaded by Python:

from symbolic_reasoning.models import SRG

srg = SRG.model_validate_json(json_string)

Development

Building from Source

# Install dependencies
npm install

# Build the compiler
npm run build

The build process compiles TypeScript to dist/.

Dependencies

This package depends on:

  • @anteriorai/srg-parser: Parses .srg files to AST. Handles all syntax parsing and tree-sitter integration.
  • @anteriorai/srg-types: Provides TypeScript types for the SRG JSON schema. The compiler imports these types directly (e.g., import type * as SRG from '@anteriorai/srg-types')