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-core

v0.1.1

Published

Verdict domain types, wire contracts, and runtime guards. Zero dependencies; runs on Workers, Lambda, Bun, Deno, Node.

Downloads

337

Readme

@gomagentic/verdict-core

Domain types, wire contracts, VIR format, and runtime guards. Zero dependencies.

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.

This is the foundation package. Every other @gomagentic/verdict-* package builds on it, so you usually install it transitively via @gomagentic/verdict-engine or @gomagentic/verdict-sdk. Install it directly when you only need the shared types and guards — for example in a service that constructs CheckRequests or inspects a Decision without linking the evaluator.

npm install @gomagentic/verdict-core

It runs unchanged on Cloudflare Workers, AWS Lambda, Bun, Deno, and Node. The package declares the cross-runtime Web globals it relies on (crypto, TextEncoder, …) via an ambient ./globals.js import, so canonicalization and signatures type-check the same everywhere.

What's in here

| Group | Exports | | |---|---|---| | Principal / resource / request | Principal, ResourceRef, CheckRequest, BatchCheckRequest, RequestContext, CheckOptions | Who acts, on what, for which actions | | Decision / effect | Decision, BatchDecision, ActionEffect, Effect, ReasonCode, Trace | The decision envelope every evaluator returns | | Values | AttributeValue, AttributeMap | JSON-safe ABAC attribute model + limits | | Policy | types/policy | Policy, rule, condition, and derived-role shapes | | Bundle | types/bundle | The immutable, content-hashed, versioned unit of deployment | | Tenant | types/tenant | Tenant scope and budgets | | Audit | types/audit | Audit record shape for the async pipeline | | VIR | vir/opcodes, vir/builtins, vir/format | Verdict Intermediate Representation: instruction set, builtins, and (de)serialization | | Canonicalization & signatures | canonical, signature | Deterministic byte encoding + Ed25519 signing/verification | | Guards & errors | guards, errors | Boundary validation and typed errors (ValidationError, ValidationIssue) |

Usage

Every guard rejects hostile input (prototype-pollution keys, non-serializable values, oversized batches) at the boundary; the decision helpers are default-deny by construction.

import {
  assertCheckRequest,
  allows,
  type CheckRequest,
  type Decision,
} from "@gomagentic/verdict-core";

// Validate untrusted input; throws ValidationError listing every issue.
const request: CheckRequest = assertCheckRequest({
  principal: { id: "u_42", roles: ["employee"], attr: { department: "eng" } },
  resource: { kind: "leave", id: "lv_9", attr: { ownerId: "u_42" } },
  actions: ["view", "approve"],
});

// ...hand `request` to the engine, get a Decision back...
declare const decision: Decision;

allows(decision, "approve"); // boolean — false unless an ALLOW effect matched

Non-throwing variants return ValidationIssue[] (validateCheckRequest, validatePrincipal, validateResource, validateActions), and allowsAll(decision) reports whether every requested action was allowed.

Documentation

License

Apache-2.0