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

@nguyenquangthai/pi-subtask

v1.0.1

Published

Isolated background conversation forks for Pi with branch-safe result delivery and a terminal-native control UI.

Readme

pi-subtask

CI License: MIT

Isolated background conversation forks for Pi.

pi-subtask runs delegated work in isolated pi --mode rpc processes. Each child receives a snapshot of the parent's active conversation branch, uses its own context window and session file, and reports its final result back automatically.

Features

  • /subtask <task> starts a background fork with the user's active tool set.
  • /subtask stop <id> stops an active run and its process tree.
  • /subtasks opens a keyboard-first Control Tower for active and recent runs.
  • The model-facing subtask tool starts a strict read-only fork and returns a receipt immediately.
  • Parent branch checks prevent results from being injected into an unrelated branch.
  • Child prompts use RPC stdin; prompts and API keys are never copied into process arguments.
  • Concurrency, wall-clock, inactivity, stderr, JSON-line, and result-output limits are enforced.
  • Nested subtask fan-out is disabled in child processes.

Defaults are intentionally conservative: four concurrent runs, 30-minute wall-clock timeout, five-minute inactivity timeout, and a 50 KiB / 2,000-line delivered result. The complete result remains available in the child session.

Control Tower UI

While runs are active, a compact themed activity rail appears below the editor with status, short run ID, elapsed time, and capability. Completion messages render a concise result by default; press Ctrl+O to expand provenance, output metrics, and the child session path.

Open /subtasks for the focused inspector:

  • / or j / k: select a run
  • Enter: toggle expanded details
  • s: stop the selected active run
  • Esc: close and restore editor focus

The UI uses Pi theme semantics and never replaces the user's editor component.

Install

Requires Node.js 22.19+ and Pi >=0.84.2.

pi install npm:@nguyenquangthai/pi-subtask

Pin a release for reproducible environments:

pi install npm:@nguyenquangthai/[email protected]
# or install the matching Git tag
pi install git:github.com/QuangThai/[email protected]

Pi packages execute with the permissions of your user account. Review third-party extension source before installation.

Development

git clone https://github.com/QuangThai/pi-subtask.git
cd pi-subtask
npm install
pi --extension ./src/index.ts

Public interface and versioning

Version 1.x treats these user-facing interfaces as stable:

  • /subtask <task> starts a background run with the user's active tools.
  • /subtask stop <id> stops an active run and its process tree.
  • /subtasks opens the run inspector.
  • The model-facing subtask tool accepts { task: string }, starts a read-only run, and returns a receipt immediately.

Breaking command or tool-schema changes require a new major version. Child session internals and the custom completion-message payload are implementation details. Pi compatibility remains constrained by the peer dependency range declared in package.json.

See CHANGELOG.md for user-visible changes and the release checklist for maintainer steps.

Security model

  • Model-created runs only receive active read, grep, find, and ls tools.
  • User-created /subtask runs inherit the parent's active tools and should be treated accordingly.
  • Child prompts use RPC stdin; prompts and API keys are not copied into process arguments.
  • Process lifetime, concurrency, stderr, protocol records, and delivered output are bounded.
  • Child output is untrusted delegated output and should be reviewed before consequential use.

Verify

npm run check
npm test
npm pack --dry-run

# Basic real-model E2E (incurs provider usage)
npm run e2e -- D:/path/to/a/project-with-pi-subtask-installed

# Edge-case matrix (incurs provider usage)
npm run e2e:matrix -- D:/path/to/a/project-with-pi-subtask-installed

The test suite exercises session snapshots, strict JSONL parsing, headless dialog cancellation, startup/wall/inactivity timeouts, stop behavior, process-tree termination, concurrency reservation, tool ceilings, branch-safe delivery guards, and strict UTF-8-safe output caps. Real-model E2E artifacts contain prompts and outputs, are created with private file permissions where the platform supports POSIX modes (Windows inherits directory ACLs), and should be deleted when no longer needed.

Current limitations

  • Parent sessions must be persisted and contain at least one entry.
  • Runs are not reconciled after parent restart or extension reload.
  • Completion delivery is not durably acknowledged; a parent crash between child completion and message injection can leave the result only in the child session.
  • Live child transcript, steering, and resume are not implemented yet.
  • Model-created runs are limited to active read, grep, find, and ls tools.
  • Use stored credentials or provider environment variables. A transient parent --api-key is deliberately not forwarded to child process arguments.

Child session files are written against Pi's exported session version. Pi 0.84.2 is the minimum tested baseline; compatibility must be revalidated before relying on newer Pi APIs.