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

@sewdn/workflow-engine

v0.1.1

Published

A workflow engine core: a pure, deterministic command core over definitions, versions and instances. No UI, no storage, no clock of its own.

Readme

@sewdn/workflow-engine

The workflow engine core: the runtime model of definitions, versions and runs, as a pure, deterministic TypeScript package.

  • Event-sourced. A command decides and does not mutate: decide(world, command, env) gives its events or a refusal, and the world after it is evolve(world, events), the fold. The typed command functions (startRun(world, ctx, actor, input), …) are that pair in one call, returning { ok, world, value, events }. See src/events/README.md.
  • Pure. No clock, no randomness, no I/O: the instant, the actor, the rights and the directory answers come in the env (Ctx for the command functions); ids are a function of the state. Every world handed out is deep-frozen; the states share their unchanged parts.
  • Projections. A run's history in words is a projection of its events (src/projections/run-log.ts, worded by the history catalogs in src/copy/); the other read models read the folded state and that log.
  • Streams. Snapshots (the state at a sequence) and rollback (an event of the stream) are in src/events/stream.ts; idempotency keys are the caller's command log, not state.

Layout

| File | What | | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | | src/model.ts | Definitions, versions, instances, tokens, passes, executions, tasks, document versions, the world | | src/context.ts | Ctx, the capabilities and the stock rights (rightsCan), refusals | | src/roles.ts | the role map: who a seat, a fill or a rule names on a run (seatHolders, holdsRule, responsibleOf, canOn) | | src/profile.ts | The one validator: Ajv 2020 under the workflow profile, the WF-D314 error filter, node data schemas | | src/analyze.ts | Region paths, retour kinds and publish validation (04 §7.2) | | src/conditions.ts | Three-valued evaluation with sources, the guarded schema leaf, staleness | | src/runtime.ts | Tokens, splits, joins, the post-command fixpoint | | src/commands.ts | Instance, task, recovery and notification commands; run, the wrapper every command goes through | | src/decide.ts | decide, DecideEnv, ENGINE_COMMANDS: the pure decision of any command by name | | src/events/ | The events, the live view a command reads through, the fold (evolve), the stream (snapshots, rollback); see its README | | src/projections/ | run-log.ts: a run's log as a projection of its events | | src/definition-content.ts | placeSchema, removeSchema (refused with the edit finding schema-in-use), placeSeat: an application's data types and seats on a definition's content | | src/authoring.ts | Drafts, import, publish (JCS + SHA-256), retire, diffVersions | | src/migration.ts | Plans, proefdraai, apply, the herstelstap fallback | | src/projections.ts | lifecycle, whyBlocked, opTeVolgen, fieldView, history | | src/invariants.ts | The 04 §3.6/§11 invariants and the append-only check | | src/testing/sample-definitions.ts | The sample routes (routeversie 1–3 of the Spec route, Rechtstreeks Committee) and their builders, as data; exported as part of @sewdn/workflow-engine/testing | | src/testing/ | Fixtures (the sample routes and personas), the scenario harness and the model-based generator; exported as @sewdn/workflow-engine/testing | | src/scenarios/ | One file per <engine>/scenarios/… proof of the acceptance map (11), each test named with its row ID |

Gates

bun run typecheck
bun run lint
bun run test                       # scenarios + 600 model seeds
ENGINE_BASE=100000 ENGINE_SEEDS=20000 bun test src/model.test.ts   # a sweep; stats in $TMPDIR/workflow-engine-model-stats.json

A failing model seed is shrunk and printed with its trace. Replay it with ENGINE_BASE=<seed> ENGINE_SEEDS=1.