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

@trigguard/protocol

v0.1.3

Published

TypeScript SDK: types and JSON snapshots for the TrigGuard protocol (see repository spec/).

Readme

@trigguard/protocol (TypeScript SDK)

npm version

Reference implementation for the TrigGuard protocol in TypeScript: vocabulary (PERMIT, DENY, SILENCE), enforcement semantics, and the DecisionRecord shape, plus JSON snapshots aligned with core/contracts/decision_contract.json.

Language-agnostic specification: spec/TG_PROTOCOL.md — this npm package is an SDK, not the full protocol.

Runtime evaluation and policy engines live in other packages and services; integrations conform to the spec.

Quick start

npm install @trigguard/protocol
import { DECISION, ENFORCEMENT, type DecisionRecord } from "@trigguard/protocol";

const record: DecisionRecord = {
  decision: DECISION.PERMIT,
  enforcement: ENFORCEMENT.EXECUTED,
  reason_code: "NO_POLICY_VIOLATION",
  timestamp: new Date().toISOString(),
};

There is no evaluate() or validateDecision() in this package — only types and canonical constants so your code matches spec/TG_PROTOCOL.md. For JSON Schema and contract JSON via subpaths, see Subpath exports.

Install and paths

Published on the public registry under the @trigguard scope. For release process, see docs/release/PROTOCOL_RELEASE.md in the monorepo.

Develop inside the repo (no registry), use a path or workspace:

"@trigguard/protocol": "file:implementations/typescript"

(From a package at the repository root. From packages/*, use file:../../implementations/typescript.)

Or install from a Git URL / workspace as documented in the main TrigGuard repository.

Decision model

| Decision | Meaning (high level) | |------------|----------------------| | PERMIT | Authorization to proceed under policy (subject to enforcement and deployment rules). | | DENY | Action must not proceed as requested. | | SILENCE| No authorization was issued; without authorization, execution cannot proceed (see SILENCE_DEFINITION export). |

Policy-only layers may restrict emitted decisions to PERMIT / DENY; full protocol surfaces also use SILENCE where applicable.

Other useful exports: type Decision, DECISIONS, SILENCE_DEFINITION, REASON_CODES, decisionContract.

Subpath exports (JSON)

The package exposes stable paths for the JSON schema and decision contract snapshot:

const schema = require("@trigguard/protocol/schema");
const contract = require("@trigguard/protocol/contract");

Build (maintainers / CI)

From implementations/typescript:

npm install
npm run build

build runs sync-contract (when the full monorepo is present), tsc, and asset copy into dist/. Published tarballs are built via prepack / prepare before npm publish.

Repository

Canonical source: github.com/TrigGuard-AI/TrigGuardimplementations/typescript/ (spec: spec/).

For installation paths and release tagging, see:

  • docs/developers/INSTALL_PROTOCOL.md
  • docs/release/PROTOCOL_RELEASE.md

Legacy note (snapshot)

src/contracts/decision_contract.json is kept in sync with core/contracts/decision_contract.json via npm run sync-contract in the monorepo. Do not edit kernel contracts from this README — follow governance and protocol integrity processes in the main repo.