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

ankr-trust-constants

v1.0.2

Published

ANKR 32-bit trust bitmask constants — single source of truth for all ANKR service permissions

Downloads

27

Readme

ankr-trust-constants

ANKR 32-bit trust bitmask — single source of truth for AI-native service permissions.

Zero dependencies. Import at build time. One integer encodes the full permission surface of any service.

Install

npm install ankr-trust-constants

Why a Bitmask?

String arrays require parsing, matching, and interpretation. At 200+ services, interpretation equals hallucination.

// String array — requires parsing
can_do: ["CREATE_BOOKING", "CLOSE_MANIFEST", "ISSUE_BL"]

// Bitmask — binary truth
trust_mask: 0x00000707
(mask & BOOK) !== 0   // either true or false. no ambiguity.

A bitmask AND across 200 services: sub-millisecond. Zero interpretation. Zero hallucination possible.

Usage

import { TRUST_PERM, ROLE_MASK, MARITIME_ROLE_MASK, hasPerm } from 'ankr-trust-constants'

// Check a single permission
const canBook = hasPerm(user.trust_mask, TRUST_PERM.BOOK)

// Check AI autonomy tier
const isAutonomous = hasPerm(agent.trust_mask, TRUST_PERM.AUTONOMOUS)

// Build a role mask
const shipperMask = MARITIME_ROLE_MASK.SHIPPER
// = READ | QUERY | WRITE | BOOK

The 32-bit Allocation

Bits 0-7   — Universal Forja
  READ     (bit 0)  — read/fetch data
  QUERY    (bit 1)  — query/search
  WRITE    (bit 2)  — create/update records
  EXECUTE  (bit 3)  — trigger operations
  APPROVE  (bit 4)  — approve/reject workflows
  AUDIT    (bit 5)  — access audit logs
  ADMIN    (bit 6)  — admin operations
  SUPER    (bit 7)  — superuser / unrestricted

Bits 8-15  — Maritime block
  BOOK              (bit 8)  — create bookings
  MANIFEST          (bit 9)  — close/amend manifests
  BL_ISSUE          (bit 10) — issue bills of lading
  RATE_DESK         (bit 11) — manage freight rates
  FEEDER_OPS        (bit 12) — feeder vessel operations
  NETWORK_PLAN      (bit 13) — network planning
  VESSEL_OPS        (bit 14) — vessel deployment/ops
  COMPLIANCE_OVERRIDE (bit 15)

Bits 16-23 — Logistics block
  GATE_IN, TRACK, FTA_CHECK, ALERT_ACK, PORT_OPS

Bits 24-31 — AGI autonomy tier
  AI_READ, AI_QUERY, AI_SUGGEST, AI_EXECUTE, AI_APPROVE, AUTONOMOUS

Bit allocation is append-only — once assigned, a bit position never changes.

Role Presets

import { ROLE_MASK, MARITIME_ROLE_MASK } from 'ankr-trust-constants'

ROLE_MASK.VIEWER      // READ | QUERY
ROLE_MASK.WRITER      // READ | QUERY | WRITE
ROLE_MASK.APPROVER    // READ | QUERY | WRITE | APPROVE
ROLE_MASK.ADMIN       // all universal bits (0-7)

MARITIME_ROLE_MASK.SHIPPER          // READ | QUERY | WRITE | BOOK
MARITIME_ROLE_MASK.MANIFEST_CLERK   // + MANIFEST
MARITIME_ROLE_MASK.VESSEL_MASTER    // + VESSEL_OPS
MARITIME_ROLE_MASK.COMPLIANCE_OFFICER

Helpers

hasPerm(mask, perm)            // mask includes permission?
hasAllPerms(mask, ...perms)    // mask includes ALL of these?
hasAnyPerm(mask, ...perms)     // mask includes ANY of these?
describePerms(mask)            // → ['READ', 'QUERY', 'BOOK', ...]

Used In Production

205+ services across the ANKR maritime platform use this bitmask — VTS systems, electronic Bill of Lading, charter party management, voyage intelligence, port congestion analytics.

Pair With

  • ankr-forja — wires STATE + TRUST + SENSE + PROOF endpoints. The TRUST endpoint returns this bitmask.

License

Apache 2.0


Built by ANKR Labs | PowerPbox IT Solutions Pvt Ltd