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

pi-subagent-workflows

v0.2.0

Published

Inline-defined subagents and programmatic workflow orchestration for Pi.

Readme

pi-subagent-workflows

Inline-defined subagents and workflow orchestration for Pi.

There are no prebuilt agent roles. Every subagent is defined at spawn time by the orchestrating agent: a task, and optionally a role, model, thinking level, and tool/skill allowlists. For large batches, the orchestrator writes a workflow script that fans out workers and returns one consolidated result.

Install

pi install npm:pi-subagent-workflows

Or add "npm:pi-subagent-workflows" to the packages array in ~/.pi/agent/settings.json.

Tools

spawn_subagent

Runs a fresh-context subagent synchronously and returns its final reply.

| Param | | | |---|---|---| | task | required | Objective, scope, boundaries, expected output | | role | optional | System-prompt instructions for the worker | | model | optional | Exact ID from get_scoped_models | | thinking | optional | off–max | | tools / skills | optional | Allowlists; omit for all, [] for none | | label | optional | Short display name |

Output is plain text: a subagent_id: <id> header line followed by the worker's reply.

Workers are normal Pi AgentSessions. They automatically discover and bind all global extensions in print mode, except copies of this package's own extension, which are identified by package manifest and excluded to prevent recursion. No third-party extension is singled out. Tool selection then operates on Pi's effective tool surface, so same-named tools supplied by another extension remain available. Child resource selection is limited to tools and skills; there is no per-child extensions option.

message_subagent

Continues a spawned subagent by subagent_id. The full resolved spec (role, model, thinking, tools, skills) is persisted at spawn time, so follow-ups recreate the session deterministically.

get_scoped_models

Lists exact model IDs permitted by Pi's enabledModels.

Workflow library

pi-subagent-workflows/workflow is a programmatic orchestration layer for scripts run outside the Pi process:

import { createWorkflowRuntime } from "pi-subagent-workflows/workflow";

const wf = await createWorkflowRuntime({ budget: { maxTotalAgents: 30 } });
const audits = await wf.pipeline(files, async (file) => ({
  file,
  finding: (await wf.agent(`Audit ${file} for missing auth checks.`, { tools: ["read", "grep"] })).output,
}));
console.log(audits.filter((a) => a.finding !== "NONE"));
  • agent(task, options) — one fresh Pi-native worker; options match spawn_subagent, plus schema for JSON-Schema-validated structured output with correction retries. Results may include warnings from resource selection or extensions.
  • parallel(thunks) — barrier concurrency.
  • pipeline(items, ...stages) — streaming stages, no barrier.
  • Budgets — maxConcurrentAgents, maxTotalAgents, maxRuntime, maxRetriesPerItem, maxTotalTokens, maxTotalCost.
  • Journal — completed calls are cached on disk keyed by task + spec; unchanged calls are served from cache on rerun.

Workflow workers use the same global extension discovery as direct workers and bind extensions before active tools are selected. Successful runs emit Pi's shutdown event and dispose before their final warnings are journaled and returned. Both paths keep projectTrusted: false. This package is the only extension package filtered from workers.

The packaged subagent-workflows skill teaches the orchestrating model both surfaces.

Settings

Under subagentWorkflows in Pi settings:

| Key | Default | | |---|---|---| | defaultModel | parent model | provider/model | | defaultThinking | parent level | | | maxConcurrentSubagents | 4 | Also the default workflow concurrency | | softTimeoutMinutes | 30 | Worker asked to wrap up | | hardTimeoutMinutes | 45 | Worker aborted | | summarizeOnTimeout | false | Summarize aborted runs | | timeoutSummaryModel | defaultModel | |

Development

npm test   # typecheck + node:test unit tests

License: 0BSD