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

@braidhq/schema

v0.4.2

Published

Zod schemas and branded TypeScript types for the Braid domain. The wire-format contract for all Braid packages.

Downloads

1,353

Readme

@braidhq/schema

Braid keeps a product's intent and its code aligned in one knowledge graph. @braidhq/schema is the contract for that graph. Every data shape in Braid is defined here once, as a zod schema paired with its TypeScript type, and every other package imports from here.

Role

Schema is the root of the monorepo. It says what data looks like, and nothing about what happens to it.

  • The Shapes: Every entity, message, and config as a zod schema with an inferred type, so validation and typing come from one definition.
  • The Ids: Branded identifiers, so a NodeId can never be passed where a ProposalId belongs.
  • The Vocabulary: The closed enums and open brands that decide which sets are fixed and which are extensible.

Structure

The package is flat. Every module sits directly under src/ and re-exports through the index.ts barrel.

src/
├── common.ts
├── model.ts
├── proposal.ts
├── ...
└── index.ts

The modules group into a few families.

  • Graph: model, ontology, graph-validation. The graph shapes and their type descriptors.
  • Review: proposal, proposal-preview, clarify. The HITL artifacts a human approves.
  • Orchestration: batch, reactor, skill, source-unit. Records of automated runs over sources.
  • Config: source, mcp, storage, agent, workspace. The product manifest and what it declares.
  • Cross-Cutting: common, error, event, history, user, view, plugin. Primitives and contracts shared across the rest.

Boundaries

These are the rules that keep schema a pure contract. They are enforced in review.

  • Validated or Shared: A shape earns a place here when it crosses a trust boundary, either parsed from outside the process (an HTTP body, a file on disk, config) or shared as a wire contract between packages (the SSE event stream). Pure in-process types stay in the package that uses them.
  • Only Zod Lives Here: Every schema is defined once in this package. No other package redeclares a shape.
  • No Side Effects: Shapes, validation, and pure helpers only. No I/O, and no import from another Braid package.
  • Closed or Open: A fixed set is a z.enum, an extensible one is a branded string, and that choice is the extension boundary for plugins.
  • Types Ride With Schemas: Every const Foo = z.object(...) is paired with export type Foo = z.infer<typeof Foo>, so consumers get both from one name.

Dependencies

Schema depends on nothing inside Braid, so the whole monorepo can depend on it.

  • Depends On: zod only.
  • Consumed By: Every package in the monorepo.