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

@johnhenry/browsermesh-core

v0.8.0

Published

Identity, crypto, peer management, and trust primitives for BrowserMesh

Readme

browsermesh-core

npm version license

Identity, crypto, peer management, and trust primitives for BrowserMesh.

Why this exists

browsermesh-primitives gives you an Ed25519 keypair and a bare capability token; it has no opinion about peers -- who you've seen, how much you trust them, or what they're currently allowed to do. browsermesh-core is the layer that turns raw identity primitives into a working peer model: MeshIdentityManager/IdentityWallet manage which identity is active, MeshPeerManager/PeerState track who's been seen and when, TrustGraph accumulates trust edges into a transitive score, and MeshACL/CapabilityChain/CapabilityValidator turn a raw CapabilityToken into an actual access decision. It sits directly on browsermesh-primitives and nothing else -- every downstream package that needs to answer "is this peer who they say they are, and are they allowed to do this" builds on browsermesh-core rather than reimplementing peer/trust bookkeeping itself.

Cross-package relationship

  • Depends on @johnhenry/browsermesh-primitives (required) -- identity.mjs, acl.mjs, keyring.mjs, and trust.mjs all import their base types (PodIdentity, capability/wire-format primitives) from there.
  • Used by @johnhenry/browsermesh-apps (optional peer) -- peer-registry.mjs types its registry against MeshPeerManager/TrustGraph/MeshACL, and several modules (mesh-hardening.mjs, mesh-keepalive.mjs, key-distribution.mjs) lazily import() this package at runtime for RetryWithBackoff, TransportFailover, TransportHealthCheck, MetricsRegistry, and the wrapKeyForMember/unwrapKeyForMember key-wrapping helpers used by CloudStorage's key-distribution service.
  • Optionally reaches back into @johnhenry/browsermesh-apps itself -- peer-tools.mjs lazily import()s ScheduledTask from browsermesh-apps when a peer tool needs to schedule follow-up work. This is a genuine (narrow, optional-on-both-sides) circular relationship: neither package requires the other to load, but each reaches into the other for one specific, lazily-imported piece.

Provenance

Extracted from the private clawser monorepo (previously packages/browsermesh-core), where it was manually published to npm, unscoped, as [email protected] (2026-07-17) with no CI ever automating that publish. This is its first release as part of the @johnhenry/browsermesh monorepo; the version restarts at 0.0.0 per family convention.

Modules

| Module | Key Exports | |--------|-------------| | identity | MeshIdentityManager, AutoIdentityManager, IdentitySelector, PodIdentity, derivePodId | | identity-tools | IdentityCreateTool, IdentityListTool, IdentitySwitchTool, registerIdentityTools | | keyring | MeshKeyring, KeyLink, SignedKeyLink, SuccessionPolicy | | group-keys | GroupKeyManager, GroupState | | peer | PeerState, MeshPeerManager | | peer-tools | MeshPeerToolsContext, registerMeshPeerTools + 30 BrowserTool subclasses | | handshake | HandshakeCoordinator, SignalingClient, DirectInputHandshake | | acl | MeshACL, ScopeTemplate, RosterEntry, InvitationToken | | capabilities | CapabilityToken, CapabilityChain, CapabilityValidator, WasmSandbox | | trust | TrustGraph | | hardening | RetryWithBackoff, TransportHealthCheck, ConnectionPool, TransportFailover | | identity-base | IdentityManager, compileSystemPrompt, detectIdentityFormat | | identity-wallet | IdentityWallet |

Install

npm install @johnhenry/browsermesh-core @johnhenry/browsermesh-primitives

Usage

import { MeshIdentityManager, MeshKeyring, TrustGraph } from '@johnhenry/browsermesh-core';

Padding group-key envelopes

GroupKeyManager.encrypt() leaks the exact plaintext length to anything that sees the ciphertext (a relay, for instance). Pass padding to round the plaintext up to a size bucket before sealing it:

const { ciphertext, iv, epoch } = await keys.encrypt(bytes, { padding: true });
const back = await keys.decrypt(ciphertext, iv, epoch, { padding: true });

padding: true uses buckets of 256 / 1024 / 4096 / 16384 bytes (larger payloads round up to a multiple of 16384); { buckets: [...] } picks your own; new GroupKeyManager({ ..., padding }) sets the default. Ciphertexts are then bucket + 16 bytes. Sender and receiver must agree on the setting (the padded plaintext is not self-describing). Off by default; no cover traffic or timing protection is provided.

License

MIT