e27b0e81ec
The postmortem module bound the native hard-exit once at module init (process.reallyExit.bind(process)). The shipped bundle defers this module's evaluation until first access, which can land inside a withHostGuard window where process.reallyExit is the ExtensionExitError- throwing stub; .bind() then froze that stub permanently, so every later host-owned exit (SIGHUP 129, SIGINT 130, fatal 1) threw and re-entered the unhandled-rejection fatal path in a loop (exit 129 storm). Resolve the native exit on every call instead of binding at init, and have withHostGuard stamp its throwing replacement with the native primitive it shadows so a signal arriving mid-guard still exits (#6488) without the guard poisoning later exits (#7393). Fixes #7393
@oh-my-pi/pi-utils
Shared utilities for oh-my-pi packages. Zero ceremony, Bun-first.
Notable modules
| Module | Purpose |
|---|---|
logger |
Centralized logger writing to ~/.omp/logs/ with rotation (TUI-safe — never stdout) |
prompt |
Handlebars-based prompt templating and formatting helpers |
dirs |
Path helpers for omp config directories (~/.omp, XDG-aware on Linux) |
stream |
readStream / readLines helpers over ReadableStream |
ptree / procmgr |
Process trees, ChildProcess wrapper, process lifecycle management |
postmortem |
Cleanup callbacks on exit, signals, and fatal exceptions |
which |
$which() binary lookup with caching |
fetch-retry |
fetch with retry/backoff policies |
fs-error |
Errno guards (isEnoent and friends) |
env / worker-host |
Environment plumbing and side-effect-free worker-host entry contract (workerHostEntry) |
abortable / async |
AbortSignal-aware stream/promise helpers |
peek-file |
Read the first N bytes of a file with pooled buffers |
frontmatter, glob, mime, temp, format, color, snowflake, tab-spacing, path-tree, sanitize-text |
Smaller single-purpose helpers |
Import from the root barrel or per-module subpaths (@oh-my-pi/pi-utils/<module>).
Install
bun add @oh-my-pi/pi-utils
Ships TypeScript source directly (no build step); requires Bun ≥ 1.3.14.