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

@zeeuw/bag-of-holding-client

v0.1.0

Published

The browser host toolkit for AI-driven D&D. A structured/streaming LLM client, a layered blueprint→AI→assemble worldgen pipeline, a procedural dungeon generator, and an overworld travel FSM — the host machinery that the @zeeuw/bag-of-holding rules kernel

Readme

bag-of-holding-client

The browser host toolkit for AI-driven D&D. The @zeeuw/bag-of-holding rules kernel is AI-agnostic by design — the host owns the prose, the persistence, and the AI loop. This package is that host machinery, factored out so it's reusable.

  • Zero runtime dependencies. Single ESM surface, config-injected (no globals), node --test-friendly.
  • Provider-agnostic LLM client (OpenRouter default): tiered model routing, JSON-schema-constrained completions, JSON-repair retry, 400/429 fallbacks, streaming with a JsonFieldStreamer, and a typed ApiError.
  • Layered worldgen — a seeded blueprint factory + a runPipeline orchestrator that threads digests, fans out parallel layers, retries, and continues past non-critical failures.
  • Procedural dungeon generator — grid placement, spine + branches, lock-and-key, depth-scaled enemies, vault boss; content + stat blocks injected.
  • Overworld travel FSM — departing → traveling (encounters / discoveries) → arriving.
  • Narrative runtime engines — a flag-gated red-thread beat evaluator and faction-reputation math (standings, merchant prices, hostility) — the engines that consume what the worldgen blueprint's beatsHints / factionsHints constrain the AI to produce, plus the JSON-schema contracts for every layer.
  • Settlement economy — pure trade, quest state, inventory, and per-NPC dialogue-memory helpers over the generated settlements + NPCs.
npm i @zeeuw/bag-of-holding-client
import {
  chatCompletion, chatStream,                         // structured + streaming LLM
  buildBlueprint, runPipeline, WORLD_SEED_SCHEMA,     // layered worldgen
  generateDungeon, runTravel,                         // dungeon + overworld
  currentBeat, completeBeat, adjustReputation,        // narrative engines
  resolvePurchase, makeQuest,                         // settlement economy
} from '@zeeuw/bag-of-holding-client';

// Every entry point is config-injected — the host builds a plain object and
// passes it in; the library never reads globals:
const config = { key: MY_OPENROUTER_KEY, models: { medium: 'deepseek/deepseek-chat' } };
const out = await chatCompletion(config, { tier: 'medium', messages, schema: WORLD_SEED_SCHEMA });

Design

The library owns algorithms and orchestration; the host injects content (rng, stat blocks, locale descriptors, schemas, prompts). That keeps it free of both a rules engine and any i18n, so it loads under node --test and re-skins to any genre.

| Module | Owns | |---|---| | llm/transport llm/tiers llm/client llm/stream | the structured/streaming LLM client | | worldgen/rng worldgen/blueprint worldgen/pipeline worldgen/schemas | seeded blueprint + layered pipeline runner + layer schemas | | dungeon/generate | the dungeon-graph algorithm (injected stat blocks + content) | | narrative/beats narrative/factions | red-thread beat evaluator + faction-reputation math | | settlement/economy | trade / quests / inventory / dialogue-memory helpers | | travel/fsm | the overworld travel state machine |

Develop

npm test     # node --test tests/*.test.js

License

MPL-2.0 — matching the rules kernel (file-level copyleft).