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

defineworkflow

v0.5.0

Published

Deterministic, crash-safe multi-agent workflow engine. Author workflows as TypeScript, orchestrate coding-agent calls with agent()/parallel()/pipeline(), and replay from a journal.

Readme

defineworkflow

Deterministic, crash-safe multi-agent workflow engine.

A workflow is a TypeScript file that orchestrates coding-agent invocations (agent(), parallel(), pipeline()) with durable, replayable execution: every agent result is journaled by sequence number, so a crashed run can be resumed from a checkpoint without re-invoking the model. Scripts run in a VM sandbox, agents are dispatched through pluggable harness adapters (Claude / Codex / Copilot CLIs or the raw Anthropic API), and progress streams to a React + Ink terminal UI.

Install

npm install defineworkflow
# or: pnpm add defineworkflow

Requires Node.js ≥ 20.

Write a workflow

// haiku.workflow.ts
import { defineWorkflow, agent } from "defineworkflow";

export default defineWorkflow({
  name: "haiku",
  description: "Write a haiku about TypeScript",
  harness: "claude",
  async run({ agent, log }) {
    const poem = await agent("Write a haiku about TypeScript.");
    log(poem);
    return poem;
  },
});

Run it

npx defineworkflow run haiku.workflow.ts

Other commands:

defineworkflow run <script> [--args '{...}'] [--detach] [--yes]
defineworkflow watch <id> | list | resume <id> | stop <id> | save <id>
defineworkflow adapters
defineworkflow <name> [--args ...]   # run a saved workflow by name

Authoring API

defineworkflow exports the authoring entrypoint and the runtime primitive stubs used for type-checking and editor autocomplete:

  • defineWorkflow({ name, description, harness, phases?, whenToUse?, run })
  • agent(), parallel(), pipeline(), phase(), log(), workflow()
  • askUserQuestion() — pause mid-run to ask the human a question; the answer is journaled so resume never re-asks
  • z (the engine's zod instance), args, budget
  • types: AgentOptions, HarnessId, WorkflowMeta, …

The primitive imports exist purely for TypeScript/editor support. At execution time the CLI strips them and injects the live runtime into the sandbox, so the following are forbidden inside a workflow body (they would break journal replay): Date.now(), Math.random(), and argless new Date().

A workflow's harness is declared in meta.harness and is the single source of truth — "claude" | "codex" | "copilot" | "raw-api".

License

MIT © Alexander Opalic