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

@hatiolab/figure-model

v0.2.10

Published

The figure format (figure-asset-1): a kernel that evaluates a figure from its declared relations, the authoring commands a modeller and an AI share, the release gate and the score.

Readme

@hatiolab/figure-model

Implementation and verification status: docs/status.md.

The figure format, figure-asset-1: its kernel, authoring commands, release gate, score and AI proposal grammar. No runtime dependencies.

The package contains no renderer. The modeller authors with it, the server judges and stores with it, and the scene draws from what it compiles.

What it solves

It moves adding a component from development to authoring. A new kind of equipment should be a data document, not a class that a developer writes, builds and deploys. That requires three things at once:

| | Condition | | --- | ----------------------------------------------------------------------------------------- | | 1 | Expressiveness — a shape that could be written in code can be written as data | | 2 | Equal performance — drawing from data is as fast as drawing hard-coded geometry | | 3 | A live component — events, animation and data binding attach, not only the shape |

A figure is a graph of named parts whose dimensions, poses and states are typed expressions of the instance size and state inputs. The names are what let a binding say "tie the lamp colour to temperature" or "open the door".

Use

npm install @hatiolab/figure-model

Everything is exported from the package root.

import { parseFigureAsset, compileFigureAsset, inspectFigureAsset, figureScoreOf } from '@hatiolab/figure-model'

Main exports

| Area | Exports | | --- | --- | | Asset document | parseFigureAsset, serializeFigureAsset, compileFigureAsset, captureFigureAuthoredInputs; types from asset-types.ts, FIGURE_PLACEMENTS | | Kernel (typed graph) | compileFigureGraph, FIGURE_OPERATORS, FIGURE_NON_AFFINE_OPERATORS, FIGURE_STATE_NON_AFFINE_OPERATORS, FIGURE_OPERATOR_STATE_POLICY, figureShapeFaces, FIGURE_KERNEL_VERSION, FIGURE_FACE_NORMALS; graph types (FigureGraph, FigureCompiledGraph, …) | | Instance size | FIGURE_INSTANCE_SIZE_INPUTS, FIGURE_INSTANCE_SIZE_DEFAULT, defaultInstanceSizeRange, foldInstanceSizeRange, figureInstanceSizeLimitsOf | | Motion and state | driverValue, driverStates, normalisePhase, validateFigureDrivers, validateFigureStateInputs, advanceStateValue, stateInputPolicy | | Authoring commands | createFigureAsset, addFigureBox, addFigurePrimitive, editFigurePart, applyFigureAuthoring, proposeFigureOccupancy, proposeFigureProportion, checkFigureJoints, figureAttachmentsOf, figureBindingsOf | | Authoring session | createFigureAuthoringSession, createFigureEditorWorkspace | | Release gate | inspectFigureAsset, figureWorldBoxesOf, figureOccupiedBoxesOf, figureWritersOf, figurePartsExtentOf, figureContractChanges | | Score and cost | figureScoreOf, figureGradeOf, figurePartCountOf, figurePartBudgetOf, figureCostOf, figureTrianglesOf | | AI proposal grammar | applyFigureProposal, FIGURE_PROPOSAL_GRAMMAR, FIGURE_PROPOSAL_KINDS | | Capabilities and documents | compileFigureCapabilities, compileFigureDocument, parseFigureDocument, serializeFigureDocument | | JSON input boundary | parseFigureJson, assertFigureJson, FIGURE_JSON_MAX_BYTES, FIGURE_JSON_MAX_DEPTH, FigureContractError | | Shared words | AXES, FIGURE_CAPABILITIES, MATERIAL_PRESETS, SEGMENT_PRESETS, DETAIL_LEVELS, PART_LIMIT, LIMITS, … (words.ts) | | Example | robotArmFigure, ROBOT_ARM_CHAIN |

Commands

npm test               type check, then all tests
npm run test:coverage  coverage (thresholds: lines 100% · branches 95% · functions 100%)
npm run check          type check (tests included)
npm run build          build to dist (tests excluded)
npm run format         format sources and docs

Requirements

| | | | ----------- | --------------------------------------------------------------------------------- | | Consumers | Node 20 or later. ESM only; no CommonJS output. | | Development | Node 22.6 or later — npm test runs TypeScript directly (type stripping). |

No enum: Node's type stripping cannot run syntax that needs code generation.

No runtime dependencies; it runs unchanged in the browser. The three devDependencies (typescript, @types/node, prettier) are not part of dist.

Documents