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

@agwab/pi-subagent

v0.4.8

Published

Minimal subagent runtime for Pi.

Readme

pi-subagent

Minimal subagent runtime for Pi.

npm

pi-subagent adds one focused tool: subagent. It gives Pi the essentials for isolated worker runs — parallel fan-out, sandbox/worktree controls, durable artifacts, and async status.

It is intentionally small, so you can add it to a project when you need subagents and remove it when you do not.

npm package: @agwab/pi-subagent

Installation

pi install npm:@agwab/pi-subagent

Then reload Pi.

Requires Node.js >=22.19.0 on macOS or Linux. Native Windows is not supported (POSIX process groups, tmux, and which-based Pi discovery); use WSL2.

For local development, add this package as a Pi extension source and reload Pi.

Quick usage

Use it when you want Pi to spin up a separate worker instead of doing everything in the parent session:

Run three reviewers in parallel for this change.
Run this check in a sandboxed worker and report the artifact paths.
Start a background audit and let me inspect it in /subagent panel.

What it does

Tool: subagent

Sandbox

Run workers in an isolated local execution boundary.

{
  "sandbox": true,
  "agent": "checker",
  "task": "Run a local check and report the artifact paths."
}

sandbox: true denies all network access. Model-backed sandboxed runs must allow their provider endpoint explicitly:

{
  "sandbox": { "allowedDomains": ["api.anthropic.com"] },
  "agent": "implementer",
  "task": "Make the requested local change and run the checks."
}

Worktree

Isolate parallel or mutating tasks in managed git worktrees. Workspaces default to shared; request worktree: true explicitly for tasks that mutate files in parallel.

{
  "worktree": true,
  "agent": "implementer",
  "task": "Make the requested local change in an isolated worktree."
}

Agent

Inject Pi subagent markdown definitions from global or project agent directories.

{
  "agent": "reviewer-security",
  "task": "Review the current diff for security risks."
}

Agent markdown can live in ~/.pi/agent/agents/*.md or .pi/agents/*.md. Agent-level tools declarations are an authority ceiling; call-level tools can narrow them but not expand them. A systemPrompt override replaces the agent prompt body, not the agent's frontmatter policy.

Type

Use one structured schema for single, parallel, async, and existing-run calls. action defaults to run. Each execution is a run; each launch is an attempt.

Single:

{
  "agent": "reviewer",
  "task": "Review the current diff and summarize the highest-risk issues."
}

Parallel launches independent runs concurrently:

{
  "tasks": [
    { "agent": "reviewer-security", "task": "Review the current diff for security risks." },
    { "agent": "reviewer-performance", "task": "Review the current diff for performance risks." },
    { "agent": "reviewer-test-coverage", "task": "Review the current diff for missing tests." }
  ]
}

Existing run:

{ "action": "status", "runId": "run_..." }

Recent runs can be addressed by runId even when they were launched from another cwd; legacy records still resolve from the explicit or current cwd.

Panel

Inspect runs, attempts, artifacts, and log tails in a live TUI. The panel defaults to the current Pi session, can switch to current cwd or all indexed runs, and includes status filters plus a scrollable detail pane. It shows active and recent terminal runs by default, with in-panel m to show more, and counts stale/malformed run pointers without exposing raw session ids.

Open the run monitor:

/subagent panel

/subagent panel

Code API

Orchestrators can use the same runtime directly:

import { runSubagent, getSubagentStatus } from "@agwab/pi-subagent/api";

const run = await runSubagent({ agent: "reviewer", task: "Review this diff.", async: true });
const status = await getSubagentStatus({ runId: run.runId });

Detailed docs

  • docs/usage.md — full argument reference, code API, action behavior, backend selection, sandbox/worktree behavior, artifacts, and validation notes.