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

@kehto/runtime

v0.2.0

Published

Browser-agnostic protocol engine for the napplet protocol — message dispatch, ACL enforcement, AUTH handshake

Readme

@kehto/runtime

Browser-agnostic protocol engine for the napplet protocol.

Install

pnpm add @kehto/runtime

Overview

@kehto/runtime is the canonical v1.2 NIP-5D protocol engine. It owns every incoming napplet message, gates it through the ACL enforcement layer, routes it to the correct NUB handler, and emits the corresponding reply envelope.

The runtime is built around the canonical dispatch contract from @napplet/corecreateDispatch() + registerNub() — so routing is declarative, not a hand-rolled switch. Covers all eight canonical NIP-5D domains end-to-end:

  • identityidentity.getProfile, identity.getFollows, identity.getPublicKey, …
  • ifcifc.channel.*, ifc.emit, cross-napplet pub/sub
  • keyskeys.forward, keys.action, keys.bind
  • mediamedia.* playback & transport control
  • notifynotify.send, notify.channel.register, badge/permission flows
  • relayrelay.publish, relay.publishEncrypted, relay.subscribe
  • storagestorage.get/set/remove/keys with quota enforcement
  • themetheme.get, theme.changed fan-out

Signing is shell-mediated inside relay.publish / relay.publishEncrypted (NIP-44 default, NIP-04 opt-in). The legacy signer domain is dissolved — napplets never see a host-injected nostr object and cannot call signer-sign RPCs directly.

Everything plugs into a single factory, createRuntime(), via a RuntimeAdapter hook bag — persistence, relay pool, auth, services, and so on. No DOM, no postMessage, no localStorage: those live in @kehto/shell.

Quick Start

import { createRuntime } from '@kehto/runtime';

const runtime = createRuntime({
  aclPersistence: aclStore,
  manifestPersistence: manifestStore,
  relayPool: myRelayPoolAdapter,
  auth: myAuthAdapter,
  // ... further adapter hooks
});

// Incoming canonical v1.2 envelope from a napplet:
runtime.handleMessage('window-1', {
  type: 'relay.publish',
  id: 'evt-42',
  event: { kind: 1, content: 'hello', /* ... */ },
});

Public API

Runtime factory

Enforcement gate

Session registry

  • createSessionRegistry — bidirectional windowId ↔ SessionEntry store
  • createNappKeyRegistry — deprecated alias retained for v1.1 migration consumers

ACL state container

Manifest cache

Replay detection

Event buffer

State handler

Service dispatch

Types

40+ interfaces — including Runtime, RuntimeAdapter, SendToNapplet, RelayPoolAdapter, ServiceHandler, ServiceRegistry, NappletMessage, SessionEntry, AclEntryExternal, AclCheckEvent, and the per-adapter hook types — are exported from ./types.js for host-app integration.

Compat re-exports (DRIFT-CORE-06)

Retained for v1.1 migration consumers; new integrations should use canonical NIP-5D envelope types from @napplet/core. Slated for removal once upstream restores those exports.

Re-exported constants cover the v1.1 bus-kind enum, auth event kind, shell bridge URI, protocol version string, the full capability list, destructive-kind set, and the replay window seconds. Re-exported types cover the v1.1 capability union, bus-kind numeric union, and service descriptor shape. See the typedoc API reference below for the exact identifier list and current numeric values.

API Reference

Full API reference: docs/api/@kehto/runtime/ (generated via pnpm docs:api).

License

MIT