@wrongstack/tools 0.298.3 → 0.300.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 (42) hide show
  1. package/dist/audit.js +6 -2
  2. package/dist/bash.js +20 -2
  3. package/dist/builtin.js +1901 -327
  4. package/dist/codebase-index/background-indexer.d.ts +6 -1
  5. package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +34 -0
  6. package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +34 -0
  7. package/dist/codebase-index/import-extractor.d.ts +39 -0
  8. package/dist/codebase-index/index-service.d.ts +24 -2
  9. package/dist/codebase-index/index.d.ts +4 -2
  10. package/dist/codebase-index/index.js +1779 -256
  11. package/dist/codebase-index/languages.d.ts +24 -0
  12. package/dist/codebase-index/module-resolver.d.ts +78 -0
  13. package/dist/codebase-index/module-roots.d.ts +81 -0
  14. package/dist/codebase-index/parser-output.d.ts +29 -0
  15. package/dist/codebase-index/project-server.js +1556 -237
  16. package/dist/codebase-index/rs-parser.d.ts +22 -0
  17. package/dist/codebase-index/schema.d.ts +47 -1
  18. package/dist/codebase-index/worker-protocol.d.ts +14 -0
  19. package/dist/codebase-index/worker.js +1545 -238
  20. package/dist/codebase-index/writer-graph-helpers.d.ts +17 -5
  21. package/dist/codebase-index/writer-graph-reader.d.ts +24 -1
  22. package/dist/codebase-index/writer-ref-mapper.d.ts +3 -0
  23. package/dist/codebase-index/writer-schema.d.ts +15 -3
  24. package/dist/codebase-index/writer.d.ts +97 -4
  25. package/dist/exec.js +39 -2
  26. package/dist/format.js +6 -2
  27. package/dist/index.js +1901 -327
  28. package/dist/install.js +6 -2
  29. package/dist/json.js +51 -2
  30. package/dist/languages/index.js +6 -2
  31. package/dist/lint.js +6 -2
  32. package/dist/outdated.js +6 -2
  33. package/dist/pack.js +1899 -327
  34. package/dist/process-registry.d.ts +6 -0
  35. package/dist/process-registry.js +6 -2
  36. package/dist/ps-slash.js +10 -2
  37. package/dist/read.js +1551 -244
  38. package/dist/test.js +6 -2
  39. package/dist/tool-tier.js +1901 -327
  40. package/dist/typecheck.js +6 -2
  41. package/package.json +3 -3
  42. package/dist/codebase-index/refs-extractor.d.ts +0 -11
package/dist/audit.js CHANGED
@@ -666,7 +666,7 @@ var ProcessRegistryImpl = class {
666
666
  const p = this.processes.get(pid);
667
667
  if (!p) return false;
668
668
  if (p.killed) return true;
669
- if (p.protected) return false;
669
+ if (p.protected && opts.includeProtected !== true) return false;
670
670
  if (opts.preserveBackground && p.background) return false;
671
671
  const { force = false, graceMs = DEFAULT_GRACE_MS } = opts;
672
672
  const isWin2 = os.platform() === "win32";
@@ -717,9 +717,13 @@ var ProcessRegistryImpl = class {
717
717
  killAll(opts = {}) {
718
718
  const pids = Array.from(this.processes.keys());
719
719
  const killed = [];
720
+ const includeProtected = opts.includeProtected === true;
720
721
  for (const pid of pids) {
721
722
  const p = this.processes.get(pid);
722
- if (p && !p.protected && this.kill(pid, opts)) killed.push(pid);
723
+ if (!p) continue;
724
+ if (p.protected && !includeProtected) continue;
725
+ if (opts.preserveBackground && p.background) continue;
726
+ if (this.kill(pid, opts)) killed.push(pid);
723
727
  }
724
728
  return killed;
725
729
  }
package/dist/bash.js CHANGED
@@ -696,7 +696,7 @@ var ProcessRegistryImpl = class {
696
696
  const p = this.processes.get(pid);
697
697
  if (!p) return false;
698
698
  if (p.killed) return true;
699
- if (p.protected) return false;
699
+ if (p.protected && opts.includeProtected !== true) return false;
700
700
  if (opts.preserveBackground && p.background) return false;
701
701
  const { force = false, graceMs = DEFAULT_GRACE_MS } = opts;
702
702
  const isWin2 = os.platform() === "win32";
@@ -747,9 +747,13 @@ var ProcessRegistryImpl = class {
747
747
  killAll(opts = {}) {
748
748
  const pids = Array.from(this.processes.keys());
749
749
  const killed = [];
750
+ const includeProtected = opts.includeProtected === true;
750
751
  for (const pid of pids) {
751
752
  const p = this.processes.get(pid);
752
- if (p && !p.protected && this.kill(pid, opts)) killed.push(pid);
753
+ if (!p) continue;
754
+ if (p.protected && !includeProtected) continue;
755
+ if (opts.preserveBackground && p.background) continue;
756
+ if (this.kill(pid, opts)) killed.push(pid);
753
757
  }
754
758
  return killed;
755
759
  }
@@ -856,6 +860,10 @@ async function acquireLock(lockfilePath, timeoutMs = 5e3) {
856
860
  const start = Date.now();
857
861
  const pidStr = String(process.pid);
858
862
  const hostStr = os2.hostname();
863
+ try {
864
+ await fs.mkdir(path2.dirname(lockfilePath), { recursive: true });
865
+ } catch {
866
+ }
859
867
  while (Date.now() - start < timeoutMs) {
860
868
  try {
861
869
  await fs.writeFile(lockfilePath, `${pidStr}:${hostStr}:${Date.now()}`, { flag: "wx" });
@@ -1521,6 +1529,16 @@ function parseKillCommand(command) {
1521
1529
  if (pgrepMatch) {
1522
1530
  return null;
1523
1531
  }
1532
+ const posixScriptMatch = normalized.match(SCRIPT_KILL_RE_POSIX);
1533
+ if (posixScriptMatch) {
1534
+ return {
1535
+ name: "kill-script",
1536
+ signal: "FORCE",
1537
+ isGroupKill: false,
1538
+ isAllKill: false,
1539
+ originalCommand: command
1540
+ };
1541
+ }
1524
1542
  return null;
1525
1543
  }
1526
1544
  async function getProtectedEntries() {