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

@nacre.work/core

v0.17.5

Published

Nacre core: data model, permission resolver, and shared types

Readme

@nacre.work/core

The data model, the permission resolver and the shared types behind Nacre — a self-hosted knowledge index with fine-grained access control.

Most people do not install this. Applications install @nacre.work/sdk, people run @nacre.work/cli, and operators run the container. This package is here because the API, the MCP server and the worker all depend on it — and because a commercial module has to resolve the host's copy of it, which needs it on the registry.

What is in it

The permission resolver and its reference implementation, the schema and its forward-only migrations, the Qdrant filter builder, the BM25 producer both sides of search share, configuration loading, the extension registry, and the types everything else is written against.

The part worth knowing before depending on it

Six invariants hold across every consumer, and breaking one is a security incident rather than a bug:

  1. The organization comes from the token — never from a body, path or header.
  2. Access filtering is a pre-filter, never a post-filter. The filter goes inside the index traversal, so top_k returns k permitted results.
  3. A failure to evaluate permissions denies access. There is no "couldn't compute it, let it through" path.
  4. "No permission" and "no such object" are indistinguishable404, never 403, including the wording.
  5. A deleted document is never returned, including before collection.
  6. write does not imply read. admin implies both. This is the opposite of most permission systems and is not a thing to fix.

Extension points

A commercial module registers into these from its module body while loadModules is running:

registerAuthProvider(provider)
registerAuthzResolver(resolver)
registerAuditSink(sink)
registerIngestGate(gate)
mountAdminRoutes(...routes)

The registry is module-level state, so it belongs to whichever copy of this package was loaded. A module that resolves a second copy registers into a registry the host never reads — which is why every module declares this as a peer dependency rather than an ordinary one.

Versioning

0.x, and the packages ship together referencing each other by exact version. A minor bump can move an interface; the extension contract says which parts are load-bearing for a module author.

Apache 2.0. The permission model in full: github.com/nacre-work/nacre.