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

@localminds/workflow

v0.1.2

Published

Local-first agent workflow engine — skills, graph IR, parallel fan-out/fan-in, host-injected tools.

Readme

@localminds/workflow

License: MIT

Host-agnostic workflow execution for agent applications — use it with LocalMinds or your own Node.js host.

What it is

@localminds/workflow is a TypeScript/Node.js engine for describing reusable skills and running them as workflows. It compiles workflow steps into a graph, executes sequential, parallel, and looping steps, and emits lifecycle events.

skills and workflow steps → graph compiler → graph executor → host-provided tools

The engine owns orchestration. Your application or LocalMinds owns the model provider, filesystem, terminal, web search, memory, persistence, and UI.

Choose your setup

Recommended: LocalMinds

LocalMinds provides the WorkflowHost, local and cloud model routing, tools, approvals, and workflow UI.

  1. Install the LocalMinds VS Code extension.
  2. Choose a local or cloud model in LocalMinds settings.
  3. Open the Command Palette and run Project Workflows.

No manual host implementation is required.

Author workflows with Studio

Studio is a standalone browser CMS for creating skills and workflows without writing TypeScript. It saves committed workflow JSON under .localminds/. Select a skill or workflow and click Run to preview it (Ollama if local, otherwise a mock host). File operations are never applied from Studio.

From another repository:

npm install @localminds/workflow
npx localminds-workflow

The shorter command uses the current directory as the repository root. The explicit form remains available for LocalMinds:

npx localminds-workflow --root .

Then open http://127.0.0.1:4174.

Embed the engine in your application

Install the package, define a ProjectLibrary and Workflow, and implement the WorkflowHost boundary. See the custom host guide for model routing, Ollama, OpenRouter, approvals, and host requirements.

Try the included demo

From a checkout of this repository:

npm install
npm run demo

Open http://127.0.0.1:4173. The demo uses mock services only; it does not call a real model or modify files.

Installation

Node.js 18 or newer is required.

npm install @localminds/workflow

For local development before publishing:

npm install ../localminds-workflow

Minimal usage

1. Define a project library

A library contains the reusable entities referenced by workflow steps:

import type { ProjectLibrary } from '@localminds/workflow';

const library: ProjectLibrary = {
  instructions: [],
  agents: [],
  prompts: [],
  skills: [
    {
      kind: 'skill',
      slug: 'summarize',
      name: 'Summarize',
      body: 'Summarize the supplied project context in five concise bullet points.',
      mode: 'ask',
      activation: { mode: 'on-demand' },
    },
  ],
  workflows: [],
};

2. Define a workflow

import type { Workflow } from '@localminds/workflow';

const workflow: Workflow = {
  id: 'project-summary',
  slug: 'project-summary',
  name: 'Project summary',
  steps: [
    { id: 'summary', type: 'skill', ref: 'summarize' },
  ],
};

Use type: 'parallel' or type: 'loop' with nested steps for fan-out or repeated work.

3. Compile or execute

Use compileWorkflow when you only need the graph:

import { compileWorkflow } from '@localminds/workflow';

const graph = compileWorkflow(workflow);
console.log(graph.nodes, graph.edges);

To execute, provide a WorkflowHost implementation. createWorkflowHost() is an application-specific placeholder; the package does not provide that factory.

import {
  GraphExecutor,
  createRoutingSession,
  type GraphWorkflowEvent,
  type WorkflowHost,
} from '@localminds/workflow';

const host: WorkflowHost = createWorkflowHost();
const routing = createRoutingSession({
  offlineMode: true,
  localModel: 'gemma4:e4b',
});

const executor = new GraphExecutor(host);
await executor.run(
  workflow,
  {
    emit(event: GraphWorkflowEvent) {
      console.log(event.type, event);
    },
    requestApproval: async ({ title, preview }) => {
      // Demo default: reject changes until the host has a confirmation UI.
      console.log(`Approval required for ${title}\n${preview}`);
      return false;
    },
  },
  { library, getRouting: () => routing.get() },
);

Safety: Never auto-approve file changes or terminal commands in production. Show the preview in a confirmation dialog and return the user's decision. Only set workflow.autoApply to true when those operations are intentionally trusted.

Cancel an active run with executor.abort().

Models and providers

The engine is model-provider agnostic. It does not ship a provider SDK or read API keys. LocalMinds handles this integration for you. Custom hosts can connect host.chat to Ollama, OpenRouter, OpenAI, Anthropic, or another gateway.

See the custom host guide for provider examples. Keep secrets in the host environment or a secret manager, never in committed .localminds/ JSON.

API and development

Important exports include compileWorkflow, GraphExecutor, GraphScheduler, WorkflowContext, createRoutingSession, Workflow, ProjectLibrary, WorkflowHost, and graph/event types.

License

MIT