@oh-my-pi/pi-utils 15.11.4 → 15.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +36 -0
  3. package/package.json +4 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,101 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [15.11.4] - 2026-06-12
6
+
7
+ ### Added
8
+
9
+ - Added `getEditorConfigFormatting(file)`: returns the `.editorconfig`-pinned `tabSize`/`insertSpaces` (both optional, no fallback) so LSP-format callers can layer per-file defaults under it without paving over silence with the renderer's display tab width ([#2329](https://github.com/can1357/oh-my-pi/issues/2329)).
10
+
11
+ ## [15.11.3] - 2026-06-11
12
+
13
+ ### Added
14
+
15
+ - Added `getEditorConfigFormatting(file)`: returns the `.editorconfig`-pinned `tabSize`/`insertSpaces` (both optional, no fallback) so LSP-format callers can layer per-file defaults under it without paving over silence with the renderer's display tab width ([#2329](https://github.com/can1357/oh-my-pi/issues/2329)).
16
+
17
+ ## [15.11.1] - 2026-06-11
18
+
19
+ ### Fixed
20
+
21
+ - Fixed cleanup reentry noise during fatal shutdown: recursive cleanup requests now no-op idempotently instead of logging repeated `Cleanup invoked recursively` errors ([#2284](https://github.com/can1357/oh-my-pi/issues/2284)).
22
+
23
+ ## [15.11.0] - 2026-06-10
24
+
25
+ ### Added
26
+
27
+ - Added the `path-tree` module (`buildPathTree`, `walkPathTree`, `formatGroupedPaths`, `isUrlLikePath`), moved from the coding agent's grouped file output so compaction file lists can share the same prefix-folded directory-tree rendering; `formatGroupedPaths` gains an optional `annotate` callback for per-file suffixes
28
+
29
+ ### Fixed
30
+
31
+ - Fixed the `{{join}}` prompt helper joining with a literal two-character `\n` when templates pass `"\n"` as the separator — Handlebars string literals carry no escape processing. The separator now unescapes `\n`/`\t`, matching the `{{#list}}` helper's documented convention (visible as literal `\n` between paths in compaction `<read-files>` lists).
32
+
33
+ ## [15.10.11] - 2026-06-10
34
+ ### Added
35
+
36
+ - Restored `PI_DEBUG_STARTUP` streaming startup markers: `logger.time` now writes a synchronous `[startup] <op>:start` / `:done` / `:fail` stderr line per phase (independent of `PI_TIMING`), so a startup that hangs hard still names the phase it is stuck in — the `PI_TIMING` tree only prints after startup completes and is structurally unable to diagnose a hang. The CLI runner emits `cli:load:<name>` markers around each lazily-imported command module for the same reason.
37
+ - Added `logger.openSpanPath()`: ops of the currently-open timing-span chain (root → deepest), used by the coding agent's startup watchdog to name the in-flight phase of a stalled startup.
38
+ - Added `declareWorkerHostEntry()` / `workerHostEntry()` (env): self-dispatching CLI entrypoints declare `Bun.main` as the worker host so worker spawn sites can re-enter the single entry module with `WorkerOptions.argv` selectors across source, npm-bundle, and compiled distributions
39
+
40
+ ### Changed
41
+
42
+ - Changed `prompt.compile()` to cache compiled templates by the raw template string so repeated calls reuse the same compiled function without re-disambiguating
43
+ - `Snowflake.formatParts` packs the id as a single 64-bit BigInt hex format instead of stitching four 16-bit segments (simpler and ~1.7x faster), and `getTimestamp` extracts via exact double arithmetic instead of a BigInt round-trip. Output is bit-identical.
44
+ - Logger initialization is lazy: the winston logger, file transport, and log-directory creation now happen on first log emission instead of at module import (the import previously cost ~8ms of fs work on the CLI startup path); the in-memory timing infrastructure never touches winston
45
+ - `prompt.format()` post-processing got cheap per-line guards and a single-pass ASCII-symbol replacement (was 7 chained regex passes per line), roughly halving render post-processing cost; output is byte-identical
46
+
47
+ ### Fixed
48
+
49
+ - Fixed `prompt.format()` so ASCII symbol replacements such as `-->` and `!=` still run on lines containing a closing HTML comment token when not inside a comment
50
+ - `isCompiledBinary()` now also honors a define-folded `process.env.PI_COMPILED` (only `Bun.env` was checked), so builds that constant-fold `process.env` keep compiled-binary detection without relying on `import.meta.url` bunfs markers
51
+ - `omp <cmd> --help` now loads only the requested command module instead of the entire command table, so an unrelated command whose import graph hangs or crashes can no longer take down every per-command help invocation.
52
+
53
+ ## [15.10.8] - 2026-06-09
54
+ ### Removed
55
+
56
+ - Removed the exported `hookFetch` API, which previously intercepted `globalThis.fetch` via middleware handlers
57
+ - Removed `hookFetch` from the package entrypoint, so imports from `@.../utils` no longer provide this fetch interception helper
58
+
59
+ ## [15.10.0] - 2026-06-06
60
+
61
+ ### Changed
62
+
63
+ - `logger.printTimings()` (the `PI_TIMING` startup tree) now surfaces two previously-invisible regions: a `(before instrumentation)` line for runtime init / uncaptured pre-marker work, and an `(unattributed self)` line for the root span's own untimed work so the gap between visible top-level spans and `Total` is no longer swallowed. `Total` is now labelled `(since first marker)` to make the window explicit. The restored `module-timer.ts` preload can feed module spans into the report: each module records `onLoad` → final top-level marker as `total`, a prepended body marker → final marker as `body/TLA`, and resolved static imports as a bounded dependency tree so the report separates graph wait from actual top-level module work.
64
+
65
+ ## [15.9.2] - 2026-06-05
66
+
67
+ ### Added
68
+
69
+ - Added `getAuthBrokerSnapshotCachePath()` with `OMP_AUTH_BROKER_SNAPSHOT_CACHE` override support for isolating the encrypted broker snapshot cache.
70
+
71
+ ## [15.9.1] - 2026-06-04
72
+
73
+ ### Fixed
74
+
75
+ - Hardened `getIndentation` against malformed paths: any filesystem error from the `.editorconfig` probe (e.g. `ENAMETOOLONG` on oversized garbage path segments) is now swallowed and cached as a miss instead of escaping and crashing the TUI mid-render ([#1871](https://github.com/can1357/oh-my-pi/issues/1871)).
76
+ - Fixed `getIndentation` (and the edit renderer's `replaceTabs` callers) crashing with `ENAMETOOLONG`/`ENOTDIR`/etc. when handed a path with an overlong component or a non-directory in its parent chain. Editorconfig discovery now short-circuits to the default tab width on any path component above `NAME_MAX` (255 bytes) and absorbs any `FsError` while walking the editorconfig chain — best-effort discovery must never escape as an uncaught exception ([#1872](https://github.com/can1357/oh-my-pi/issues/1872)).
77
+
78
+ ## [15.9.0] - 2026-06-04
79
+
80
+ ### Added
81
+
82
+ - Added color helpers `colorLuma` (perceptual luma), `relativeLuminance` (WCAG, linearized sRGB), and `hslToHex` to the color utilities. The luminance helpers parse `#rgb`/`#rrggbb` hex and 256-color palette indices, returning `undefined` for unparseable values.
83
+ - Added `peekFileEnds`, a single-open head-and-tail file peek helper that reuses the head bytes for the tail when the file fits the head window.
84
+
85
+ - Added `peekFileTail`, the tail mirror of `peekFile`: reads up to the last `maxBytes` of a file ending at EOF, reusing the same pooled-buffer strategy (no per-call allocation for small reads).
86
+
87
+ ## [15.7.3] - 2026-05-31
88
+
89
+ ### Added
90
+
91
+ - Added `getFastembedCacheDir` to return the FastEmbed model cache directory under ~/.omp/cache/fastembed
92
+
93
+ ### Fixed
94
+
95
+ - Fixed `$flag` environment parsing to accept lowercase truthy values such as `y`, `true`, `yes`, and `on`
96
+
97
+ ## [15.6.0] - 2026-05-30
98
+
99
+ ### Added
100
+
101
+ - Added an XDG-aware tiny-title model cache directory helper for coding-agent local title models.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # @oh-my-pi/pi-utils
2
+
3
+ Shared utilities for [oh-my-pi](https://github.com/can1357/oh-my-pi) packages. Zero ceremony, Bun-first.
4
+
5
+ ## Notable modules
6
+
7
+ | Module | Purpose |
8
+ | --- | --- |
9
+ | `logger` | Centralized logger writing to `~/.omp/logs/` with rotation (TUI-safe — never stdout) |
10
+ | `prompt` | Handlebars-based prompt templating and formatting helpers |
11
+ | `dirs` | Path helpers for omp config directories (`~/.omp`, XDG-aware on Linux) |
12
+ | `stream` | `readStream` / `readLines` helpers over `ReadableStream` |
13
+ | `ptree` / `procmgr` | Process trees, `ChildProcess` wrapper, process lifecycle management |
14
+ | `postmortem` | Cleanup callbacks on exit, signals, and fatal exceptions |
15
+ | `which` | `$which()` binary lookup with caching |
16
+ | `fetch-retry` | `fetch` with retry/backoff policies |
17
+ | `fs-error` | Errno guards (`isEnoent` and friends) |
18
+ | `env` | Environment plumbing, worker-host entry contract (`workerHostEntry`) |
19
+ | `abortable` / `async` | AbortSignal-aware stream/promise helpers |
20
+ | `peek-file` | Read the first N bytes of a file with pooled buffers |
21
+ | `frontmatter`, `glob`, `mime`, `temp`, `format`, `color`, `snowflake`, `tab-spacing`, `path-tree`, `sanitize-text` | Smaller single-purpose helpers |
22
+
23
+ Import from the root barrel or per-module subpaths (`@oh-my-pi/pi-utils/<module>`).
24
+
25
+ ## Install
26
+
27
+ ```sh
28
+ bun add @oh-my-pi/pi-utils
29
+ ```
30
+
31
+ Ships TypeScript source directly (no build step); requires Bun ≥ 1.3.14.
32
+
33
+ ## References
34
+
35
+ - [Monorepo README](https://github.com/can1357/oh-my-pi#readme)
36
+ - [CHANGELOG](./CHANGELOG.md)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "15.11.4",
4
+ "version": "15.11.7",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://omp.sh",
7
7
  "author": "Can Boluk",
@@ -31,7 +31,7 @@
31
31
  "fmt": "biome format --write ."
32
32
  },
33
33
  "dependencies": {
34
- "@oh-my-pi/pi-natives": "15.11.4",
34
+ "@oh-my-pi/pi-natives": "15.11.7",
35
35
  "beautiful-mermaid": "^1.1.3",
36
36
  "handlebars": "^4.7.9",
37
37
  "winston": "^3.19.0",
@@ -45,6 +45,8 @@
45
45
  },
46
46
  "files": [
47
47
  "src",
48
+ "README.md",
49
+ "CHANGELOG.md",
48
50
  "dist/types"
49
51
  ],
50
52
  "exports": {