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

@maias/core

v0.5.1

Published

MAIAS core library: parse, typed model, canonical serialise, graph utilities, safe edits, validation. The single implementation all MAIAS tooling builds on.

Readme

@maias/core — the MAIAS core library

The single TypeScript implementation of everything MAIAS: parse → typed object model → serialise with round-trip fidelity, validation, graph utilities, safe edits, and the canonical formatter. The CLI, the MCP server, and the MAIAS Browser are all thin wrappers over this package — one implementation, so the three surfaces can never disagree about what a valid document is.

Environment constraint that shaped it: the same code runs in Node (CLI, MCP), the browser, and React Native/Hermes. Hermes forbids runtime codegen, so schema validation uses an interpreting validator (@cfworker/json-schema, not Ajv — decision D11), and the JSON Schema is embedded at build time (maias-schema.gen.ts): a published @maias/core validates with no network and no external files, ever.

Quick taste

import { parse, validate, editElements, format } from '@maias/core';

const { parsed } = parse(readFileSync('my-app.maias.yaml', 'utf8'));

// Safe element edit — atomic batch, refuses dangling targets & stale indices
const result = editElements(parsed!, 'home', [
  { op: 'insert', index: 2, element: { label: 'Send feedback', type: 'link', target: 'feedback' } },
]);
if (!result.ok) throw new Error(result.reason);

const output = format(parsed!);          // canonical form, comments intact
console.log(validate(output).valid);     // re-check before writing

Module surface

| Module | Exports | Job | |---|---|---| | parse | parse, ParsedDocument | YAML/JSON text → typed model plus the underlying CST (yaml package, D10). Comments and source ranges survive; position(path) maps any document path to line/col. | | model | MaiasDocument, Screen, Element, Flow, … | The spec, 1:1, as TypeScript types. x_ extension fields are typed on every object. | | validate | validate, lint, schemaValidate | Two layers: embedded JSON Schema, then semantic lint (dangling targets MAIAS-E003, orphans, registry membership, duplicates, path collisions — E001–E009 / W001–W008), all as Diagnostic { code, severity, message, path, line, col }. | | graph | screenIndex, reachableScreens, orphanScreens, whatLinksHere, outboundRefs | The document as a navigation graph. | | edit | renameScreen, addScreen, removeScreen, editElements | Safe mutations through the CST: renames cascade to every reference; removal refuses to leave dangling targets unless cascade; editElements applies an atomic insert/update/remove/move batch with expect guards (R6.5, D20). Every operation returns EditResult { ok, reason?, changes } and, on refusal, leaves the document untouched. | | fmt | format, canonicalize | Canonical form (spec §11): fixed key order, derived screen ordering, omit-empty. Idempotent; comments move with their nodes. |

Guarantees

  • Round-trip fidelity (D10): parse → edit → serialise keeps every comment and leaves untouched lines byte-identical — machine edits diff as exactly the change.
  • Safe by default: every edit operation validates its inputs first and refuses with an actionable reason rather than writing a broken document.
  • One validation everywhere (D11): CLI, MCP, and the in-app browser all call this validate(); a document valid in one place is valid in all.

Development

npm run build -w @maias/core     # regenerates the embedded schema, then compiles
npx vitest run packages/core    # round-trip, lint fixtures, fmt idempotence, edit ops