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

@better-compute/core

v0.3.0

Published

Browser-safe contracts for better-compute: domain types, errors, state tables, extension contracts and the IAM catalog.

Readme

@better-compute/core

Browser-safe contracts that every other better-compute package builds on: ids, errors, state tables, domain types, the config manifest builder, extension contracts (define*), the SqlExecutor, Clock and IamPort ports, the IAM catalog, and the normative method → action table. It has no dependencies and imports nothing from Node.js.

The contracts freeze at the end of P0. After that they change only by additive, reviewed edits (PLAN.md §5.1, .claude/coordination.md).

import { field, manifest, newId, reservationStateTable, transition } from '@better-compute/core';

const config = manifest({
  token: field.secret().describe('API token'),
  timeout: field.duration().default('10m'),
});
type Config = manifest.Infer<typeof config>; // { token: SecretRef; timeout: number }

const next = transition(reservationStateTable, 'draft', 'place'); // 'placed'
const id = newId('rsv'); // 'rsv_01…'

The conformance helpers have their own subpath, so the root entry carries no test code:

import { runConformance, type ConformanceCase } from '@better-compute/core/conformance';

Contracts

  • errors: ComputeError(code, message, status?, details?), ErrorCode, defaultStatus (§9.1), isComputeError, notImplemented(feature, phase).
  • ids: newId(prefix) (monotonic lower-case ULIDs), createIdGenerator({ now, random }) for the simulator, idPrefixes, parseId, isId, draftId(prefix, tenantId, identityId, key) (§3.4 step 5), base32.
  • duration: parseDuration('8h' | '1h30m' | ms), formatDuration, Duration.
  • clock: Clock, systemClock, manualClock(start).
  • states: data-driven tables with transition, canTransition, targets and exits for provision (§11.1, with failedFrom and metalRecoverTargets), connectivity (§7.5), reservations (§10.5), commands (§7.4), instances (§11.1), and workflows and steps (§11.2).
  • domain: regions, sites, pools, offerings, nodes, devices and atoms, reservation requests and records, allocations, bookings, instances, images, profiles, workflows and steps, command kinds and envelopes, NodeSpec sections, admission context, events, projects.
  • manifest: field.* builders with .optional(), .default(), .describe(), .suggest(), .disabledWhen() and .masked. manifest({...}) is a Standard Schema v1 with .jsonSchema() (2020-12 plus x-bc hints), .parse() and .redact(); also manifest.Infer, SecretRef, and validateManifest, which accepts any Standard Schema.
  • extension: DriverKinds (open to declaration merging), defineDriver, defineSchedulerPlugin, Placer, defineAttestor, defineSink, Notifier, LeaseProvider, BlobStore, SecretStore, CertificateAuthority, ImageSource, NodeAdapter, the ProviderDefinition and StepDefinition types (their helpers live in vps and provision), ComputeModule, defineModule, definePlugin, ModuleContext, defineMethod, ModuleApis, PluginApis.
  • sql: SqlTx, SqlExecutor (implemented by postgres and pglite), Migration (<owner>/<nnnn>_<slug>), assertMigrations.
  • iam: IamPort (§12.1), Credential, Caller, Decision, Check, SpendCheck, UsageEvent (§12.7), UsageResult, IamCapabilities.
  • catalog: computeResourceTypes(prefix) and computeActions (§12.3), and apiSurface, the §9.2 table as data with one row per method.
  • conformance (subpath): ConformanceCase<T>, ConformanceFailure, check, checkEqual, checkRejects, runConformance.