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

anbaric-tsapi

v1.18.1

Published

These are the shared libraries - types, classes, etc - that both the public state-machine and hosting services share

Downloads

5,987

Readme

anbaric-tsapi

The contracts and value classes shared by every Anbaric package. Nothing here depends on any other Anbaric package. App developers usually install anbaric instead, which re-exports all of this.

Interfaces whose implementations may cross a process boundary are async: their methods return Promise even when an implementation is trivially synchronous.

Value classes

Job — a unit of work moving through a workflow. Immutable. new Job(id, properties = new Map(), state, workflowId?, startedBy = "system", startedAt = new Date(), lastUpdated = startedAt). state is a readonly string; a job never changes in place — JobPersistence.save constructs a new Job at the target state and stamps lastUpdated.

Statenew State(id, actions = [], transitions = []), plus subscribe(action) to add an action later.

Actionnew Action(name, actor, description = "", id = crypto.randomUUID()). Two replaceable function fields: predicate : (job) => boolean (defaults to accept) gates whether the action runs, and run : (job) => Promise<Map<string, any>> (defaults to an empty map) returns the property changes the action wants. run never mutates the job.

Actor — an interface, pure identity: { type : "HUMAN" | "CODE" | "AGENT" | "SYSTEM", id : string, role : string }. Concrete Human, Code, Agent classes live in anbaric-state-machine.

Transitionnew Transition(to, predicate); the first accepting transition in a state wins.

PropertyDefinitionnew PropertyDefinition(id) with mutable required : boolean (default false) and validation : (value) => boolean (default accept).

SerializationserializeJob(job) : SerializedJob and deserializeJob(serialized) : Job define the wire shape used by the cloud clients and platform (dates as ISO strings, properties as a plain object).

Contracts

JobPersistence — an abstract class taking an Auditor; every method takes the acting Actor and audits before deferring to an abstract …Internal. create(actor, job), save(actor, changeDescription, job, properties?, state?) (applies the property/state change and stamps lastUpdated), retrieve(id, actor) (throws No job found with id "x"), delete(id, actor), list(actor, pageSize?, page?).

Queueenqueue(jobId, workflowId), schedule(jobId, workflowId, due). Dequeue extends Queue adds dequeueSome() : Promise<Array<QueueMessage>>; the exported Dequeue.supports(queue) type guard tests for it structurally. Delivery is at-least-once: consumers must tolerate redelivery.

Consumersubscribe(workflowId, processJob) routes deliveries for one workflow to a callback; cleanUp() releases resources.

JsonStore — abstract, Auditor-backed and actor-audited like JobPersistence: create(actor, id, document), save(actor, changeDescription, id, document), retrieve(id, actor), delete(id, actor), list(actor, pageSize?, page?) (returns the document values, not ids); implementations validate against a JsonSchema when one is given.

SecretStore — abstract, Auditor-backed: create(actor, name, value), save(actor, changeDescription, name, value), retrieve(name, actor), delete(name, actor), list(actor). Secret values never appear in audit details.

QueueMessage{ jobId, workflowId }; part of the platform's private wire protocol (in api/cloud/), exported because Dequeue returns it.