@wrongstack/tools 0.296.4 → 0.297.0

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 (46) hide show
  1. package/dist/audit.js +15 -0
  2. package/dist/audit.js.map +2 -2
  3. package/dist/bash.js +15 -0
  4. package/dist/bash.js.map +2 -2
  5. package/dist/builtin.js +42 -0
  6. package/dist/builtin.js.map +2 -2
  7. package/dist/codebase-index/index.js +27 -0
  8. package/dist/codebase-index/index.js.map +2 -2
  9. package/dist/codebase-index/project-server-client.d.ts.map +1 -1
  10. package/dist/codebase-index/project-server.js +16 -0
  11. package/dist/codebase-index/project-server.js.map +2 -2
  12. package/dist/exec.js +15 -0
  13. package/dist/exec.js.map +2 -2
  14. package/dist/format.js +15 -0
  15. package/dist/format.js.map +2 -2
  16. package/dist/index.js +42 -0
  17. package/dist/index.js.map +2 -2
  18. package/dist/install.js +15 -0
  19. package/dist/install.js.map +2 -2
  20. package/dist/languages/index.js +15 -0
  21. package/dist/languages/index.js.map +2 -2
  22. package/dist/lint.js +15 -0
  23. package/dist/lint.js.map +2 -2
  24. package/dist/next-steps.d.ts +23 -0
  25. package/dist/next-steps.d.ts.map +1 -1
  26. package/dist/next-steps.js +4 -0
  27. package/dist/next-steps.js.map +2 -2
  28. package/dist/outdated.js +15 -0
  29. package/dist/outdated.js.map +2 -2
  30. package/dist/pack.js +42 -0
  31. package/dist/pack.js.map +2 -2
  32. package/dist/process-registry.d.ts +9 -0
  33. package/dist/process-registry.d.ts.map +1 -1
  34. package/dist/process-registry.js +15 -0
  35. package/dist/process-registry.js.map +2 -2
  36. package/dist/ps-slash.js +15 -0
  37. package/dist/ps-slash.js.map +2 -2
  38. package/dist/read.js +27 -0
  39. package/dist/read.js.map +2 -2
  40. package/dist/test.js +15 -0
  41. package/dist/test.js.map +2 -2
  42. package/dist/tool-tier.js +42 -0
  43. package/dist/tool-tier.js.map +2 -2
  44. package/dist/typecheck.js +15 -0
  45. package/dist/typecheck.js.map +2 -2
  46. package/package.json +3 -3
@@ -2573,6 +2573,7 @@ var ProcessRegistryImpl = class {
2573
2573
  }
2574
2574
  /** Get all tracked processes. */
2575
2575
  list() {
2576
+ this._pruneAllStale();
2576
2577
  return Array.from(this.processes.values());
2577
2578
  }
2578
2579
  /** Get processes filtered by name (e.g. 'bash', 'exec'). */
@@ -2603,6 +2604,7 @@ var ProcessRegistryImpl = class {
2603
2604
  * Combined stats for observability — used by /ps and the TUI status bar.
2604
2605
  */
2605
2606
  stats() {
2607
+ this._pruneAllStale();
2606
2608
  return {
2607
2609
  activeCount: this.activeCount,
2608
2610
  backgroundCount: this.activeBackgroundCount,
@@ -2842,6 +2844,19 @@ var ProcessRegistryImpl = class {
2842
2844
  this.processes.delete(pid);
2843
2845
  }
2844
2846
  }
2847
+ /**
2848
+ * Remove every stale entry, not just one PID. `list()`/`stats()` — the
2849
+ * surfaces the TUI status bar and `/ps` poll — must prune too: a child
2850
+ * whose 'close' event never fires (e.g. Windows grandchildren holding stdio
2851
+ * open) would otherwise linger in the registry until someone looks up its
2852
+ * exact PID, and PID reuse meanwhile makes `get()`/`kill()` target the
2853
+ * wrong process. RAM-leak audit 2026-07-31, MEDIUM.
2854
+ */
2855
+ _pruneAllStale() {
2856
+ for (const [pid, entry] of this.processes) {
2857
+ if (this._isStaleEntry(entry)) this.processes.delete(pid);
2858
+ }
2859
+ }
2845
2860
  };
2846
2861
  var _registry;
2847
2862
  function getProcessRegistry() {