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

@gomagentic/verdict-engine

v0.1.1

Published

Verdict embedded evaluator: VIR interpreter, decision combining, tracing, caches. Zero network calls; runs on Workers, Lambda, Bun, Deno, Node.

Readme

@gomagentic/verdict-engine

The embedded evaluator: microsecond authorization decisions, zero network calls.

Part of Verdict — a serverless-first authorization engine. Policies (RBAC / ABAC / ReBAC) compile once and decide in microseconds, embedded in your app, behind a central PDP, or synced to the edge.

Install

npm install @gomagentic/verdict-engine

The engine evaluates a compiled bundle; it does not author one. Compile your policy source to a bundle with @gomagentic/verdict-dsl, or receive a signed bundle from a control plane and load it with Verdict.fromBundle.

Quick start

import { allows } from "@gomagentic/verdict-core";
import { Verdict } from "@gomagentic/verdict-engine";

const verdict = await Verdict.fromBundle(bundle); // verifies content hash; or Verdict.fromProgram(vir)

const decision = verdict.check({
  principal: { id: "u_42", roles: ["employee"], attr: { department: "eng", level: 4 } },
  resource:  { kind: "leave", id: "lv_9", attr: { managerId: "u_42", department: "eng" } },
  actions:   ["approve"],
});

allows(decision, "approve"); // true | false — default deny, always

check() returns a Decision: results maps each action to its ActionEffect (Allow / Deny plus a reason), and meta carries requestId, bundleHash, bundleVersion, latencyUs, cacheHit, and evaluatedAt. Read a single verdict with allows(decision, action) from @gomagentic/verdict-core, or use the engine's own verdict.allows(request) for a single-action boolean check. batchCheck() evaluates many (principal, resource, actions) entries under one shared context.

explain() is check() with the full trace forced on. The returned Decision gains a trace: the rules the evaluator visited (matched policy and rule, evaluated conditions), the sorted missingAttributes that pushed conditions to UNKNOWN, and the derivedRoles computed for the request — produced by the evaluator itself, not reconstructed afterward.

const explained = verdict.explain({ principal, resource, actions: ["approve"] });
explained.trace?.missingAttributes; // e.g. ["resource.attr.ownerId"]

Decisions are pure functions of (bundle, principal, resource, actions, context) — the same bundle yields byte-identical decisions on Cloudflare Workers, Lambda, Deno, Bun, and Node, with no network calls. A warm check() runs in ~12 µs mean / 29 µs p99; a 1000-entry batch in ~9.6 ms; loading a 100-policy bundle in ~30 µs.

Key exports

| Export | Description | |---|---| | Verdict | The engine. fromBundle / fromProgram to load; check, explain, batchCheck, allows to decide. | | VerdictOptions | Construction options: extern function impls, decisionCache, tenantId, relationships resolver. | | DecisionCache / DecisionCacheOptions | Opt-in per-process LRU keyed on the full canonical (principal, resource, action); maxEntries, ttlMs. | | MemoryRelationshipResolver / RelationshipResolver | ReBAC seam for related(); supply tuples the resolver answers synchronously (PIP-prefetch pattern). | | ExternFunction | Synchronous host function backing an extern declaration; fetch async attributes before evaluation, not inside it. | | EVAL_LIMITS / BudgetExceeded | Per-check instruction budget and quantifier caps; exhausting the budget fails the whole check closed (all-actions DENY). | | LoadedProgram | A VirProgram prepared for evaluation — patterns compiled, policies indexed and pre-sorted at load time. |

Lower-level building blocks are also exported for tooling and conformance work: applicablePolicies, createRequestEnv, decideAction, evalCondition, and the value primitives (UNKNOWN, VDuration, VTimestamp, deepEqual, compareValues, kleeneAnd / kleeneOr / kleeneNot, parseDuration, parseTimestamp).

Documentation

License

Apache-2.0