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-process

v0.1.0

Published

Pi extension that adds OpenClaw-style background bash + process session management

Readme

pi-process

A Pi extension that overrides bash and adds a process tool with OpenClaw-style background execution.

Features

  • bash auto-backgrounds long commands after yieldMs (default 10000ms)
  • bash background=true starts immediately in background
  • In-memory job tracking (per Pi session)
  • process actions: list, poll, log, write, kill, clear, remove
  • Simple KISS/YAGNI implementation (in-memory state, optional PTY via node-pty)

Install

cd ~/code/pi-process
npm install

Then load in Pi:

pi -e ~/code/pi-process/src/index.ts

Or add it to ~/.pi/agent/extensions/ (or .pi/extensions/) and use /reload.

Tool contracts

bash

Parameters:

  • command (required)
  • timeout (seconds, optional)
  • yieldMs (milliseconds, default 10000)
  • background (boolean, optional)
  • pty (boolean, optional; requires @lydell/node-pty)

Behavior:

  • If command completes before yieldMs, returns foreground output.
  • Otherwise returns status=running and sessionId.

process

Parameters:

  • action: list | poll | log | write | kill | clear | remove
  • sessionId: required for all actions except list
  • offset, limit: optional paging for log (line-based)
  • data, eof: optional stdin input for write

Acceptance smoke tests (agent-driven)

Use these in a fresh Pi session after loading the extension. These are end-to-end prompts where the agent should decide when to use bash vs process.

1) Long command that should auto-background and complete

Prompt to agent:

Run `ping -c 20 google.com`. If it backgrounds, keep polling until it completes, then summarize packet loss and avg latency.

What success looks like:

  • First bash call runs ~10s and backgrounds with a session id.
  • Agent then calls process poll repeatedly.
  • Final response includes completed ping stats.

2) Regular short command should stay foreground

Prompt to agent:

Run `uname -a` and show me the result.

What success looks like:

  • Agent uses bash only.
  • No process follow-up needed.

3) Start long job, write to stdin, then cancel it

Prompt to agent:

Start `cat` in background. Write `hello\n` to stdin, poll to verify output, then stop it.

What success looks like:

  • Agent gets a running session id from bash.
  • Agent uses process write with data (and optional eof) to send stdin.
  • Agent confirms echoed output via process poll.
  • Agent stops it with process kill (or remove).

4) Fire-and-forget behavior

Prompt to agent:

Start `sleep 15 && echo done` in background and do not wait for completion. Just tell me the session id.

What success looks like:

  • Agent starts background work and returns session id.
  • Agent does not keep polling.

5) Timeout behavior

Prompt to agent:

Run `sleep 30` with timeout 3 seconds and report what happened.

What success looks like:

  • Command is terminated by timeout.
  • Agent reports timeout outcome (foreground or via process state).

6) PTY/TTY behavior

Prompt to agent:

Run `python3` with pty=true, send `print(2+2)\n` via process write, then send eof=true and report output.

What success looks like:

  • bash session starts with PTY and backgrounds/foregrounds as needed
  • process write sends input into REPL
  • output includes 4

Notes

  • Jobs are scoped to the current Pi session.
  • Jobs are in-memory only and cleaned up after a TTL.
  • user_bash (!cmd) is intentionally not modified in v1.