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

@promptowl/contextnest-engine

v0.3.8

Published

Core engine for AI agent knowledge bases — selectors, versioning, graph traversal, integrity verification, and context management for LLMs

Readme

@promptowl/contextnest-engine

Core engine for Context Nest — structured, versioned context vaults for AI agents.

Install

npm install @promptowl/contextnest-engine

What It Does

The engine provides the core building blocks for Context Nest vaults:

  • Storage — Read/write documents, version histories, checkpoints, and config from the vault file system
  • Parsing & Validation — Parse markdown documents with YAML frontmatter, validate against the spec (including skill and source node rules)
  • Selector Grammar — Deterministic query language for selecting documents by tag, type, URI, pack, and boolean combinations
  • Skill Nodes — First-class support for type: skill nodes with trigger, inputs, tools_required, output_format, and guard_rails
  • Graph Traversal — Hop-based BFS traversal using context.yaml as a lightweight graph index, with priority-weighted edges
  • URI Resolution — Resolve contextnest:// URIs to documents, tags, folders, or search results
  • Versioning — Hash-chained version history with keyframe + diff reconstruction
  • Integrity — SHA-256 content hashes, chain hashes, and checkpoint verification
  • Index Generation — Generate context.yaml (document graph) and INDEX.md files
  • Agent Config Generation — Auto-generate CLAUDE.md, GEMINI.md, .cursorrules, etc. so AI tools discover the vault

Quick Example

import { NestStorage, GraphQueryEngine } from "@promptowl/contextnest-engine";

const storage = new NestStorage("/path/to/vault");
const engine = new GraphQueryEngine(storage);

// Query with graph traversal (default: 2 hops)
const result = await engine.query('#engineering + type:document', { hops: 3 });

// Query skill nodes
const skills = await engine.query('type:skill + #engineering', { hops: 2 });

for (const doc of result.documents) {
  console.log(`${doc.id}: ${doc.frontmatter.title}`);
}

Key Exports

| Export | Description | |--------|-------------| | NestStorage | File system abstraction for vault operations | | GraphQueryEngine | Graph-aware query orchestrator (recommended) | | GraphTraverser | BFS traversal with priority-weighted edge costs | | Resolver | URI resolution against in-memory document set | | ContextInjector | Legacy full-load query orchestrator | | VersionManager | Document version history management | | CheckpointManager | Vault-wide checkpoint management | | generateContextYaml | Generate the context.yaml graph index | | generateAgentConfigs | Generate AI tool config files | | parseSelector | Parse selector query strings into AST | | evaluateFromIndex | Evaluate selectors against lightweight index (no bodies) | | publishDocument | Publish a document (bump version, checkpoint) |

Graph Traversal

The engine uses context.yaml as a pre-built graph index. Queries evaluate selectors against document metadata (no file bodies loaded), then traverse relationship edges via BFS for N hops, and only load bodies for reached nodes.

  • depends_on edges and edges to hub nodes are free (always traversed)
  • reference edges cost 1 hop
  • Edges with explicit priority: 0 in frontmatter metadata are free
  • Adaptive expansion retries with more hops if too few results

Links

License

AGPL-3.0