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

@action-flow/core

v0.1.0

Published

Framework-agnostic, dispatch-driven action runtime for TypeScript

Readme

@action-flow/core

Framework-agnostic, dispatch-driven action runtime for TypeScript.

npm install @action-flow/core
import { createRuntime, defineAction, defineModule } from "@action-flow/core";

const math = defineModule("math", {
  double: defineAction({ handler: (input: number) => input * 2 }),
});

const runtime = createRuntime({ providers: {}, modules: [math] });
const result = await runtime.dispatch("math.double", 3); // number: 6

Define modules with defineModule(namespace, actionsMap). The namespace and action types are preserved.

Includes typed static dispatch, modules, injected providers, a read-only action registry, and nested execution. Use createActionFactory<Providers, Contract>() with ActionSignature<Input, Output> entries for typed cross-module ctx.dispatch. Runtime assembly checks that each required target is registered with a compatible implementation. Contract-enabled module lists must be statically known; use as const when storing the list in a variable. Factories without a contract retain the dynamic Promise<unknown> boundary. Contracts are compile-time checks, not runtime schemas.

Execution context includes IDs, parent linkage and an AbortSignal. Enable structural tracing with environment: "development" or trace: true, then inspect runtime.trace.list(), getTrace(traceId) and lifecycle subscriptions. Tracing defaults off in the default production environment, and payload capture is opt-in. Retention is bounded and snapshots support redaction. Onion middleware can wrap, recover or short-circuit execution. Cancellation is cooperative and does not roll back side effects.

The separate @action-flow/scenario package provides typed scenarios, scoped provider overrides, result/error mocks and fixture cleanup. Core exposes createDebugScope() with isolated bindings, Middleware and Trace, plus close() to drain started descendants. Debug execution defaults off in production; allowDebug overrides the environment default. Scenario records and contexts include scenarioId and scenarioRunId. The separate @action-flow/devtools package provides an explicitly mounted browser panel; Core does not import it. snapshotTraceValue() exposes bounded, detached, redacted snapshots for diagnostic consumers, including AggregateError constituents.

See the repository documentation for provider factories, development commands, and design boundaries. This package is ESM and has no runtime dependencies.

MIT