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

v0.1.1

Published

Deterministic background process supervision for the Pi coding agent on Windows

Downloads

308

Readme

pi-process-native

Deterministic background process supervision for the Pi coding agent on Windows.

pi-process-native starts, inspects, waits for, and stops non-interactive background processes while Pi continues working. It is designed for development servers, watchers, continuous tests, emulators, and other long-running commands.

Design

  • One compact process model tool with start, list, status, logs, wait, and stop actions.
  • Supports verified PowerShell 7 command execution and direct executable-plus-arguments execution.
  • Keeps logs in bounded in-memory buffers and tail-truncates model results to Pi's limits.
  • Detects readiness from literal output, including text split across output chunks.
  • Owns processes for the current Pi session and stops them during session shutdown by default.
  • Uses Windows process-tree termination with graceful and forced phases.
  • Preserves Pi session environment metadata for model-started commands.
  • Has no runtime dependencies, telemetry, elevation, or network calls.

Requirements

  • Windows
  • PowerShell 7+ for command mode
  • Node.js 22.19 or newer
  • Pi 0.83.0 or newer (before 1.0)

Direct executable mode does not require PowerShell.

Installation

Install the latest npm release:

pi install npm:pi-process-native

From GitHub:

pi install git:github.com/takomine/pi-process-native

From source:

npm install --ignore-scripts
pi -e .\src\index.ts

Examples

Start a development server and wait until it is ready:

{
  "action": "start",
  "name": "dev-server",
  "command": "npm run dev",
  "cwd": "C:\\project",
  "readyText": "Local:",
  "readyTimeout": 30
}

Read recent logs:

{
  "action": "logs",
  "id": "dev-server",
  "lines": 100
}

Wait for tests:

{
  "action": "wait",
  "id": "tests",
  "readyTimeout": 120
}

Stop a process:

{
  "action": "stop",
  "id": "dev-server"
}

Direct executable mode avoids shell interpretation:

{
  "action": "start",
  "name": "node-server",
  "executable": "C:\\Program Files\\nodejs\\node.exe",
  "args": ["server.js", "--port", "3000"]
}

Provide exactly one of command or executable when starting a process.

User command

/processes
/processes logs dev-server
/processes stop dev-server
/processes stop-all

Configuration

Global configuration:

~/.pi/agent/process-native.json

Example:

{
  "powerShellExecutable": "auto",
  "loadPowerShellProfile": false,
  "maxProcesses": 8,
  "maxBufferBytesPerProcess": 1048576,
  "defaultReadyTimeoutSeconds": 30,
  "defaultStopTimeoutSeconds": 5
}

Unknown fields and malformed values are rejected.

Environment overrides:

  • PI_PROCESS_NATIVE_CONFIG
  • PI_PROCESS_NATIVE_PWSH_EXECUTABLE
  • PI_PROCESS_NATIVE_LOAD_PROFILE
  • PI_PROCESS_NATIVE_MAX_PROCESSES
  • PI_PROCESS_NATIVE_MAX_BUFFER_BYTES

Lifecycle

Processes continue across model turns but are owned by the active Pi session. They are always stopped on quit, reload, new session, resume, or fork. Cancelling a readiness wait stops the process being started. Cancelling a normal wait does not stop an already-running process.

Completed process records and their bounded logs remain available during the session. The oldest completed records are pruned after 32 entries.

Security

Processes run with the user's permissions. This package is a process supervisor, not a sandbox.

  • Shell commands can execute arbitrary code.
  • Environment variables and process logs may contain secrets.
  • No process is elevated automatically.
  • Output memory and active process counts are bounded.
  • Project commands should only be run in trusted repositories.

Limitations

  • Windows-only in the initial release.
  • Non-interactive processes only; there is no PTY or stdin interaction.
  • Processes do not survive Pi shutdown or extension reload by default.
  • Readiness detection is literal text matching; port probes and regular expressions are not included yet.
  • Windows cleanup uses taskkill /T. A child deliberately detached before its parent exits may escape later tree discovery; this package does not claim Job Object containment.
  • Log buffers are in memory and older output is discarded when their configured limit is reached.

Development

npm install --ignore-scripts
npm run check

Tests cover configuration, bounded UTF-8 logs, readiness across output chunks, native exit codes, timeouts, active-process limits, PowerShell Unicode transport, and process-tree stopping.

License

MIT