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

@coderifts/sdk

v1.0.1

Published

Agent Governance SDK — validate API changes before tool invocations. TypeScript client for the CodeRifts API.

Downloads

539

Readme

@coderifts/sdk

Agent Governance SDK for the CodeRifts API. Validate API changes before tool invocations in AI agent infrastructure (LangChain, AutoGen, Copilot, Claude, Grok, etc.).

Installation

npm install @coderifts/sdk

Quick Start

import { CodeRifts } from '@coderifts/sdk';

const client = new CodeRifts({ apiKey: 'cr_live_...' });

const result = await client.preflightCheck({
  tool_name: 'get_refund_status',
  old_spec: oldYaml,
  new_spec: newYaml,
});

if (!result.safe) {
  console.error('Blocked:', result.decision, result.reflex_triggers);
  process.exit(1);
}

Methods

preflightCheck(options)

Check whether it is safe to proceed with a tool invocation.

const result = await client.preflightCheck({
  tool_name: 'get_refund_status',
  old_spec: '...',
  new_spec: '...',
});
// result.decision: 'BLOCK' | 'REQUIRE_APPROVAL' | 'WARN' | 'ALLOW'
// result.omega_api: number
// result.safe: boolean
// result.reflex_triggers: Array<{ rule: string; decision: string }>
// result.affected_tools: Array<{ tool_name: string; status: string }>

diff(options)

Full analysis of two OpenAPI specs.

const result = await client.diff({
  before: '...',
  after: '...',
});
// result.omega_decision: string
// result.risk_score: number
// result.breaking_changes: BreakingChange[]
// result.should_block: boolean

explainDecision(options)

Human-readable explanation of why a decision was made.

const explanation = await client.explainDecision({
  omega_api: 43.95,
  decision: 'BLOCK',
  reflex_triggers: [...],
});
// explanation.summary: string
// explanation.components: Array<{ name: string; value: number; description: string }>

howToUnblock(options)

Actionable steps to resolve a BLOCK decision.

const steps = await client.howToUnblock({
  decision: 'BLOCK',
  breaking_changes: [...],
  detected_patterns: [...],
});
// steps.actions: Array<{ step: number; description: string; code_example?: string }>

scoreMcp(manifest)

Score an MCP manifest for agent safety.

const score = await client.scoreMcp({
  manifest: { tools: [...] },
});
// score.overall_score: number (0-100)
// score.band: 'STRONG' | 'GOOD' | 'NEEDS_WORK' | 'POOR' | 'CRITICAL'

getLedger(options)

Query compliance ledger entries.

const ledger = await client.getLedger({
  repo: 'owner/repo',
  decision: 'BLOCK',
  limit: 10,
});
// ledger.entries: LedgerEntry[]
// ledger.total: number

simulatePolicy(options)

Test a YAML policy against two OpenAPI specs.

const result = await client.simulatePolicy({
  policy_yaml: '...',
  old_spec: '...',
  new_spec: '...',
});
// result.effective_action: string
// result.matched_rules: MatchedRule[]

Error Handling

All methods throw a typed CodeRiftsError on non-2xx responses:

import { CodeRifts, CodeRiftsError } from '@coderifts/sdk';

try {
  const result = await client.preflightCheck({ ... });
} catch (err) {
  if (err instanceof CodeRiftsError) {
    console.error(err.code, err.message);
  }
}

Documentation

Full API documentation: https://coderifts.com/docs

License

MIT