@linxiraos/pi-utils 1.0.0 → 1.0.2

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 (132) hide show
  1. package/CHANGELOG.md +41 -6
  2. package/package.json +56 -57
  3. package/src/dirs.ts +99 -91
  4. package/src/fetch-retry.ts +11 -2
  5. package/src/json-parse.ts +18 -7
  6. package/src/logger.ts +55 -20
  7. package/src/ptree.ts +2 -2
  8. package/src/stderr-guard.ts +1 -1
  9. package/src/stream.ts +27 -3
  10. package/src/vendor/mermaid-ascii/ascii/canvas.ts +8 -6
  11. package/src/vendor/mermaid-ascii/ascii/draw.ts +21 -14
  12. package/src/vendor/mermaid-ascii/text-metrics.ts +3 -0
  13. package/dist/types/abortable.d.ts +0 -32
  14. package/dist/types/acp/connection.d.ts +0 -118
  15. package/dist/types/acp/protocol.d.ts +0 -526
  16. package/dist/types/acp/schema.d.ts +0 -41
  17. package/dist/types/acp/stream.d.ts +0 -8
  18. package/dist/types/acp/transport.d.ts +0 -81
  19. package/dist/types/acp.d.ts +0 -6
  20. package/dist/types/async.d.ts +0 -20
  21. package/dist/types/binary.d.ts +0 -17
  22. package/dist/types/browsers.d.ts +0 -68
  23. package/dist/types/chalk.d.ts +0 -125
  24. package/dist/types/cli.d.ts +0 -134
  25. package/dist/types/color.d.ts +0 -102
  26. package/dist/types/dates.d.ts +0 -7
  27. package/dist/types/dirs.d.ts +0 -282
  28. package/dist/types/docx/converter.d.ts +0 -46
  29. package/dist/types/docx/xml.d.ts +0 -26
  30. package/dist/types/docx/zip.d.ts +0 -6
  31. package/dist/types/docx.d.ts +0 -11
  32. package/dist/types/dom/core.d.ts +0 -431
  33. package/dist/types/dom/parser.d.ts +0 -7
  34. package/dist/types/dom/selector.d.ts +0 -5
  35. package/dist/types/dom.d.ts +0 -5
  36. package/dist/types/env.d.ts +0 -124
  37. package/dist/types/fetch-retry.d.ts +0 -96
  38. package/dist/types/file-lock.d.ts +0 -23
  39. package/dist/types/format.d.ts +0 -37
  40. package/dist/types/frontmatter.d.ts +0 -46
  41. package/dist/types/fs-error.d.ts +0 -31
  42. package/dist/types/glob.d.ts +0 -28
  43. package/dist/types/headers.d.ts +0 -34
  44. package/dist/types/index.d.ts +0 -39
  45. package/dist/types/json-parse.d.ts +0 -74
  46. package/dist/types/json.d.ts +0 -14
  47. package/dist/types/logger/rotating-file.d.ts +0 -18
  48. package/dist/types/logger.d.ts +0 -96
  49. package/dist/types/loop-phase.d.ts +0 -10
  50. package/dist/types/lru.d.ts +0 -46
  51. package/dist/types/marked/core.d.ts +0 -445
  52. package/dist/types/marked.d.ts +0 -2
  53. package/dist/types/mermaid-ascii.d.ts +0 -11
  54. package/dist/types/mime.d.ts +0 -29
  55. package/dist/types/module-timer.d.ts +0 -1
  56. package/dist/types/path-tree.d.ts +0 -76
  57. package/dist/types/path.d.ts +0 -2
  58. package/dist/types/peek-file.d.ts +0 -29
  59. package/dist/types/postmortem.d.ts +0 -104
  60. package/dist/types/process-name.d.ts +0 -7
  61. package/dist/types/procmgr.d.ts +0 -74
  62. package/dist/types/prompt.d.ts +0 -18
  63. package/dist/types/ptree.d.ts +0 -110
  64. package/dist/types/readability/readability.d.ts +0 -9
  65. package/dist/types/readability/readerable.d.ts +0 -10
  66. package/dist/types/readability/types.d.ts +0 -70
  67. package/dist/types/readability.d.ts +0 -4
  68. package/dist/types/ring.d.ts +0 -93
  69. package/dist/types/runtime-install.d.ts +0 -78
  70. package/dist/types/sanitize-text.d.ts +0 -29
  71. package/dist/types/snowflake.d.ts +0 -25
  72. package/dist/types/stderr-guard.d.ts +0 -22
  73. package/dist/types/stream.d.ts +0 -67
  74. package/dist/types/tab-spacing.d.ts +0 -24
  75. package/dist/types/temp.d.ts +0 -17
  76. package/dist/types/template.d.ts +0 -62
  77. package/dist/types/timing-buffer.d.ts +0 -22
  78. package/dist/types/tls-fetch.d.ts +0 -37
  79. package/dist/types/turndown/gfm.d.ts +0 -11
  80. package/dist/types/turndown/html.d.ts +0 -5
  81. package/dist/types/turndown/service.d.ts +0 -21
  82. package/dist/types/turndown/types.d.ts +0 -70
  83. package/dist/types/turndown.d.ts +0 -4
  84. package/dist/types/type-guards.d.ts +0 -5
  85. package/dist/types/vendor/mermaid-ascii/ascii/ansi.d.ts +0 -41
  86. package/dist/types/vendor/mermaid-ascii/ascii/canvas.d.ts +0 -89
  87. package/dist/types/vendor/mermaid-ascii/ascii/class-diagram.d.ts +0 -7
  88. package/dist/types/vendor/mermaid-ascii/ascii/converter.d.ts +0 -12
  89. package/dist/types/vendor/mermaid-ascii/ascii/draw.d.ts +0 -66
  90. package/dist/types/vendor/mermaid-ascii/ascii/edge-bundling.d.ts +0 -48
  91. package/dist/types/vendor/mermaid-ascii/ascii/edge-routing.d.ts +0 -43
  92. package/dist/types/vendor/mermaid-ascii/ascii/er-diagram.d.ts +0 -7
  93. package/dist/types/vendor/mermaid-ascii/ascii/grid.d.ts +0 -56
  94. package/dist/types/vendor/mermaid-ascii/ascii/index.d.ts +0 -65
  95. package/dist/types/vendor/mermaid-ascii/ascii/multiline-utils.d.ts +0 -27
  96. package/dist/types/vendor/mermaid-ascii/ascii/pathfinder.d.ts +0 -17
  97. package/dist/types/vendor/mermaid-ascii/ascii/sequence.d.ts +0 -7
  98. package/dist/types/vendor/mermaid-ascii/ascii/shapes/circle.d.ts +0 -11
  99. package/dist/types/vendor/mermaid-ascii/ascii/shapes/corners.d.ts +0 -34
  100. package/dist/types/vendor/mermaid-ascii/ascii/shapes/diamond.d.ts +0 -11
  101. package/dist/types/vendor/mermaid-ascii/ascii/shapes/hexagon.d.ts +0 -11
  102. package/dist/types/vendor/mermaid-ascii/ascii/shapes/index.d.ts +0 -26
  103. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rectangle.d.ts +0 -31
  104. package/dist/types/vendor/mermaid-ascii/ascii/shapes/rounded.d.ts +0 -11
  105. package/dist/types/vendor/mermaid-ascii/ascii/shapes/special.d.ts +0 -59
  106. package/dist/types/vendor/mermaid-ascii/ascii/shapes/stadium.d.ts +0 -17
  107. package/dist/types/vendor/mermaid-ascii/ascii/shapes/state.d.ts +0 -30
  108. package/dist/types/vendor/mermaid-ascii/ascii/shapes/types.d.ts +0 -55
  109. package/dist/types/vendor/mermaid-ascii/ascii/types.d.ts +0 -206
  110. package/dist/types/vendor/mermaid-ascii/ascii/validate.d.ts +0 -51
  111. package/dist/types/vendor/mermaid-ascii/ascii/xychart.d.ts +0 -2
  112. package/dist/types/vendor/mermaid-ascii/class/parser.d.ts +0 -6
  113. package/dist/types/vendor/mermaid-ascii/class/types.d.ts +0 -102
  114. package/dist/types/vendor/mermaid-ascii/er/parser.d.ts +0 -6
  115. package/dist/types/vendor/mermaid-ascii/er/types.d.ts +0 -76
  116. package/dist/types/vendor/mermaid-ascii/index.d.ts +0 -1
  117. package/dist/types/vendor/mermaid-ascii/multiline-utils.d.ts +0 -9
  118. package/dist/types/vendor/mermaid-ascii/parser.d.ts +0 -7
  119. package/dist/types/vendor/mermaid-ascii/sequence/parser.d.ts +0 -6
  120. package/dist/types/vendor/mermaid-ascii/sequence/types.d.ts +0 -130
  121. package/dist/types/vendor/mermaid-ascii/text-metrics.d.ts +0 -21
  122. package/dist/types/vendor/mermaid-ascii/types.d.ts +0 -114
  123. package/dist/types/vendor/mermaid-ascii/xychart/colors.d.ts +0 -25
  124. package/dist/types/vendor/mermaid-ascii/xychart/parser.d.ts +0 -6
  125. package/dist/types/vendor/mermaid-ascii/xychart/types.d.ts +0 -145
  126. package/dist/types/version.d.ts +0 -18
  127. package/dist/types/vterm/buffer.d.ts +0 -99
  128. package/dist/types/vterm/terminal.d.ts +0 -44
  129. package/dist/types/vterm.d.ts +0 -8
  130. package/dist/types/which.d.ts +0 -37
  131. package/dist/types/worker-host.d.ts +0 -51
  132. package/dist/types/xml.d.ts +0 -31
package/CHANGELOG.md CHANGED
@@ -2,9 +2,38 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.0.2] - 2026-08-15
6
+
7
+ ## [17.3.2] - 2026-08-13
8
+
9
+ ### Fixed
10
+
11
+ - Fixed `fetchWithRetry()` aborts during retry backoff to preserve the documented `"Request was aborted"` error contract ([#8450](https://github.com/can1357/oh-my-pi/issues/8450)).
12
+
13
+ ## [17.3.0] - 2026-08-13
14
+
15
+ ### Fixed
16
+
17
+ - Optimized performance of partial JSON parsing for long streaming tool-call arguments.
18
+ - Fixed Mermaid ASCII multi-word edge labels where routed lines would show through spaces.
19
+
20
+ ## [17.2.15] - 2026-08-12
21
+
5
22
  ### Changed
6
23
 
7
- - Reset the version to 1.0.0 and republished under the `@linxiraos/*` scope, breaking from the `@oh-my-pi` version lineage.
24
+ - Extended parsed Server-Sent Events (SSE) to include optional id and retry fields, enabling reconnecting transports to retain stream cursors and respect server-requested retry intervals.
25
+
26
+ ## [17.2.13] - 2026-08-11
27
+
28
+ ### Changed
29
+
30
+ - Changed stale process-log retention from the newest five files globally to one newest file per completed process and day within the current and previous four local calendar days. This preserves bounded daily diagnostic coverage while continuing to remove one-use audit files.
31
+ - Changed outbound User-Agent consumers to share the versioned `USER_AGENT` constant (`omp/<version>`).
32
+
33
+ ### Fixed
34
+
35
+ - Fixed Mermaid ASCII state pseudostates rendering empty boxes, miscoloring final-state borders, and inverting rounded corners in bottom-to-top diagrams.
36
+
8
37
  ## [17.2.11] - 2026-08-07
9
38
 
10
39
  ### Added
@@ -19,7 +48,7 @@
19
48
 
20
49
  ### Added
21
50
 
22
- - Introduced zero-dependency in-house modules replacing external packages, importable via `@oh-my-pi/pi-utils/<module>`: `acp` (Agent Client Protocol), `browsers` (Chrome for Testing discovery/install), `chalk` (ANSI styling), `dates` (date formatting), `dom` (HTML parser, WHATWG DOM subset, and CSS selectors), `docx` (DOCX to HTML), `headers` (browser header generation), `lru` (LRU cache), `marked` (GFM markdown lexer/parser), `readability` (article extraction), `template` (Handlebars-compatible templating), `turndown` (HTML to Markdown), `vterm` (headless terminal emulator), and `xml` (XML parser).
51
+ - Introduced zero-dependency in-house modules replacing external packages, importable via `@linxiraos/pi-utils/<module>`: `acp` (Agent Client Protocol), `browsers` (Chrome for Testing discovery/install), `chalk` (ANSI styling), `dates` (date formatting), `dom` (HTML parser, WHATWG DOM subset, and CSS selectors), `docx` (DOCX to HTML), `headers` (browser header generation), `lru` (LRU cache), `marked` (GFM markdown lexer/parser), `readability` (article extraction), `template` (Handlebars-compatible templating), `turndown` (HTML to Markdown), `vterm` (headless terminal emulator), and `xml` (XML parser).
23
52
  - Added postmortem fatal recovery hint providers to allow applications to print actionable recovery commands before cleanup starts.
24
53
 
25
54
  ### Changed
@@ -40,7 +69,7 @@
40
69
 
41
70
  ### Added
42
71
 
43
- - Added a public `compareVersions` utility (`@oh-my-pi/pi-utils`) that compares two version strings with SemVer-2.0 prerelease ordering, build-metadata stripping, and numeric segment comparison without float overflow; never throws.
72
+ - Added a public `compareVersions` utility (`@linxiraos/pi-utils`) that compares two version strings with SemVer-2.0 prerelease ordering, build-metadata stripping, and numeric segment comparison without float overflow; never throws.
44
73
 
45
74
  ### Fixed
46
75
 
@@ -288,7 +317,7 @@
288
317
 
289
318
  ### Removed
290
319
 
291
- - Removed the public `createAbortableStream` API from `@oh-my-pi/pi-utils`. Consumers should use the lighter, direct-reader `abortableSource` async generator inside `@oh-my-pi/pi-utils/stream` to avoid the extra ReadableStream wrapper layer and per-chunk enqueue overhead.
320
+ - Removed the public `createAbortableStream` API from `@linxiraos/pi-utils`. Consumers should use the lighter, direct-reader `abortableSource` async generator inside `@linxiraos/pi-utils/stream` to avoid the extra ReadableStream wrapper layer and per-chunk enqueue overhead.
292
321
 
293
322
  ## [16.0.11] - 2026-06-19
294
323
 
@@ -317,7 +346,7 @@
317
346
 
318
347
  ### Added
319
348
 
320
- - Added `installWorkerInbox(port)` / `consumeWorkerInbox()` to `@oh-my-pi/pi-utils/worker-host`. A self-dispatching CLI host that imports a Bun worker module dynamically attaches the worker's real `message` listener after Bun flushes the messages the parent posted before spawn, dropping a synchronously-posted `init`. The host installs this buffering inbox synchronously in the entry's sync prefix so a listener exists at flush time; the worker module consumes it and binds the real handler, replaying anything buffered.
349
+ - Added `installWorkerInbox(port)` / `consumeWorkerInbox()` to `@linxiraos/pi-utils/worker-host`. A self-dispatching CLI host that imports a Bun worker module dynamically attaches the worker's real `message` listener after Bun flushes the messages the parent posted before spawn, dropping a synchronously-posted `init`. The host installs this buffering inbox synchronously in the entry's sync prefix so a listener exists at flush time; the worker module consumes it and binds the real handler, replaying anything buffered.
321
350
 
322
351
  ## [15.13.1] - 2026-06-15
323
352
 
@@ -328,7 +357,7 @@
328
357
  - Added support for a runtime `overrides` map in `RuntimeInstallSpec`, which is now written into generated runtime `package.json` manifests to force dependency pins (including transitive ones) across the runtime tree
329
358
  - Added a lightweight loop-phase breadcrumb stack (`pushLoopPhase`/`popLoopPhase`/`currentLoopPhase`, plus `takeRecentLoopPhase` which returns the live phase or the most recently popped one and clears it) so the TUI event-loop watchdog can attribute a main-thread block to the phase that caused it — including a synchronous phase already popped before the watchdog's delayed tick runs ([#2485](https://github.com/can1357/oh-my-pi/issues/2485))
330
359
  - Added `FetchWithRetryOptions.timeout` (forwarded to the underlying `fetch` call). `false` disables Bun's native ~300s pre-response timeout; a positive number overrides the ceiling. Bare browser/Node fetch ignores it ([#2422](https://github.com/can1357/oh-my-pi/issues/2422))
331
- - Added the side-effect-free `@oh-my-pi/pi-utils/worker-host` module (`declareWorkerHostEntry()` / `workerHostEntry()`), extracted from `env` (still re-exported there) so worker spawn sites can resolve the self-dispatching CLI host entry without importing `env`'s side-effecting module graph.
360
+ - Added the side-effect-free `@linxiraos/pi-utils/worker-host` module (`declareWorkerHostEntry()` / `workerHostEntry()`), extracted from `env` (still re-exported there) so worker spawn sites can resolve the self-dispatching CLI host entry without importing `env`'s side-effecting module graph.
332
361
 
333
362
  ### Fixed
334
363
 
@@ -447,3 +476,9 @@
447
476
  ### Added
448
477
 
449
478
  - Added an XDG-aware tiny-title model cache directory helper for coding-agent local title models.
479
+
480
+ ## [1.0.0] - 2026-08-13
481
+
482
+ ### Changed
483
+
484
+ - Reset the version to 1.0.0 and republished under the `@linxiraos/*` scope, breaking from the `@oh-my-pi` version lineage.
package/package.json CHANGED
@@ -1,59 +1,58 @@
1
1
  {
2
- "type": "module",
3
- "name": "@linxiraos/pi-utils",
4
- "version": "1.0.0",
5
- "description": "Shared utilities for pi packages",
6
- "homepage": "https://linxira-os.github.io",
7
- "author": "Can Boluk",
8
- "license": "MIT",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/Linxira-OS/linxira-zeta.git",
12
- "directory": "packages/utils"
13
- },
14
- "bugs": {
15
- "url": "https://github.com/can1357/oh-my-pi/issues"
16
- },
17
- "keywords": [
18
- "utilities",
19
- "cli",
20
- "logging",
21
- "streams"
22
- ],
23
- "main": "./src/index.ts",
24
- "types": "./dist/types/index.d.ts",
25
- "scripts": {
26
- "check": "biome check . && bun run check:types",
27
- "check:types": "tsgo -p tsconfig.json --noEmit",
28
- "lint": "biome lint .",
29
- "test": "bun test --parallel",
30
- "fix": "biome check --write --unsafe .",
31
- "fmt": "biome format --write ."
32
- },
33
- "dependencies": {
34
- "@linxiraos/pi-natives": "1.0.0"
35
- },
36
- "devDependencies": {
37
- "@types/bun": "^1.3.14"
38
- },
39
- "engines": {
40
- "bun": ">=1.3.14"
41
- },
42
- "files": [
43
- "src",
44
- "README.md",
45
- "CHANGELOG.md",
46
- "dist/types"
47
- ],
48
- "exports": {
49
- ".": {
50
- "types": "./dist/types/index.d.ts",
51
- "import": "./src/index.ts"
52
- },
53
- "./*": {
54
- "types": "./dist/types/*.d.ts",
55
- "import": "./src/*.ts"
56
- },
57
- "./*.js": "./src/*.ts"
58
- }
2
+ "type": "module",
3
+ "name": "@linxiraos/pi-utils",
4
+ "version": "1.0.2",
5
+ "description": "Shared utilities for pi packages",
6
+ "homepage": "https://linxira-os.github.io",
7
+ "author": "Can Boluk",
8
+ "license": "MIT",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/Linxira-OS/linxira-zeta.git",
12
+ "directory": "packages/utils"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/can1357/oh-my-pi/issues"
16
+ },
17
+ "keywords": [
18
+ "utilities",
19
+ "cli",
20
+ "logging",
21
+ "streams"
22
+ ],
23
+ "main": "./src/index.ts",
24
+ "types": "./src/index.ts",
25
+ "scripts": {
26
+ "check": "biome check . && bun run check:types",
27
+ "check:types": "tsgo -p tsconfig.json --noEmit",
28
+ "lint": "biome lint .",
29
+ "test": "bun test --parallel",
30
+ "fix": "biome check --write --unsafe .",
31
+ "fmt": "biome format --write ."
32
+ },
33
+ "dependencies": {
34
+ "@linxiraos/pi-natives": "catalog:"
35
+ },
36
+ "devDependencies": {
37
+ "@types/bun": "catalog:"
38
+ },
39
+ "engines": {
40
+ "bun": ">=1.3.14"
41
+ },
42
+ "files": [
43
+ "src",
44
+ "README.md",
45
+ "CHANGELOG.md"
46
+ ],
47
+ "exports": {
48
+ ".": {
49
+ "types": "./src/index.ts",
50
+ "import": "./src/index.ts"
51
+ },
52
+ "./*": {
53
+ "types": "./src/*.ts",
54
+ "import": "./src/*.ts"
55
+ },
56
+ "./*.js": "./src/*.ts"
57
+ }
59
58
  }