bugzero 0.0.34 → 0.0.35

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > bugzero@0.0.34 build /home/runner/work/Bugzero/Bugzero/apps/bugzero
2
+ > bugzero@0.0.35 build /home/runner/work/Bugzero/Bugzero/apps/bugzero
3
3
  > tsup src/index.ts --format cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  CJS Build start
10
- CJS dist/index.js 77.80 KB
11
- CJS ⚡️ Build success in 57ms
10
+ CJS dist/index.js 79.68 KB
11
+ CJS ⚡️ Build success in 54ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 1273ms
13
+ DTS ⚡️ Build success in 1265ms
14
14
  DTS dist/index.d.ts 20.00 B
package/README.md CHANGED
@@ -95,6 +95,7 @@ bugzero rescue
95
95
  | Autonomous repair loop | Runs analyze, patch, verify in a stateful LangGraph graph |
96
96
  | Multi-model support | DeepSeek, Claude, GPT-4o, Gemini, Llama via OpenRouter |
97
97
  | Framework detection | Automatically identifies your project's tooling setup |
98
+ | Package manager detection | Runs build/lint/test with npm, pnpm, yarn, or bun — whichever the target project actually uses |
98
99
  | **Multi-file patches** | A single fix attempt can edit several files at once, applied atomically — if any file's patch fails, every file touched in that attempt is rolled back |
99
100
  | **Fuzzy patch matching** | Falls back from exact match to whitespace-normalized and similarity-scored matching when the AI's snippet doesn't match the file verbatim |
100
101
  | Safe file patching | Every modified file receives a `.opspilot.bak` backup |
package/dist/index.js CHANGED
@@ -466,6 +466,8 @@ var require_dist2 = __commonJS({
466
466
  var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
467
467
  var index_exports = {};
468
468
  __export(index_exports, {
469
+ detectPackageManager: () => detectPackageManager3,
470
+ getRunScriptCommand: () => getRunScriptCommand,
469
471
  parseErrors: () => parseErrors,
470
472
  runBuild: () => runBuild,
471
473
  runCommand: () => runCommand,
@@ -474,6 +476,39 @@ var require_dist2 = __commonJS({
474
476
  runValidationPipeline: () => runValidationPipeline
475
477
  });
476
478
  module2.exports = __toCommonJS(index_exports);
479
+ var import_fs = __toESM2(require("fs"));
480
+ var import_path2 = __toESM2(require("path"));
481
+ var VALID_MANAGERS = ["npm", "pnpm", "yarn", "bun"];
482
+ var LOCKFILE_MANAGERS = [
483
+ { file: "pnpm-workspace.yaml", manager: "pnpm" },
484
+ { file: "pnpm-lock.yaml", manager: "pnpm" },
485
+ { file: "yarn.lock", manager: "yarn" },
486
+ { file: "bun.lockb", manager: "bun" },
487
+ { file: "bun.lock", manager: "bun" },
488
+ { file: "package-lock.json", manager: "npm" }
489
+ ];
490
+ function detectPackageManager3(cwd = process.cwd()) {
491
+ try {
492
+ const pkgPath = import_path2.default.join(cwd, "package.json");
493
+ if (import_fs.default.existsSync(pkgPath)) {
494
+ const pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf-8"));
495
+ if (typeof pkg.packageManager === "string") {
496
+ const name = pkg.packageManager.split("@")[0].trim();
497
+ if (VALID_MANAGERS.includes(name)) {
498
+ return name;
499
+ }
500
+ }
501
+ }
502
+ } catch {
503
+ }
504
+ for (const { file, manager } of LOCKFILE_MANAGERS) {
505
+ if (import_fs.default.existsSync(import_path2.default.join(cwd, file))) return manager;
506
+ }
507
+ return "npm";
508
+ }
509
+ function getRunScriptCommand(manager, script) {
510
+ return `${manager} run ${script}`;
511
+ }
477
512
  async function runCommand(command, cwd) {
478
513
  const { execa } = await import("execa");
479
514
  try {
@@ -497,9 +532,9 @@ var require_dist2 = __commonJS({
497
532
  };
498
533
  }
499
534
  }
500
- var runBuild = (cwd) => runCommand("npm run build", cwd);
501
- var runLint = (cwd) => runCommand("npm run lint", cwd);
502
- var runTests = (cwd) => runCommand("npm run test", cwd);
535
+ var runBuild = (cwd) => runCommand(getRunScriptCommand(detectPackageManager3(cwd), "build"), cwd);
536
+ var runLint = (cwd) => runCommand(getRunScriptCommand(detectPackageManager3(cwd), "lint"), cwd);
537
+ var runTests = (cwd) => runCommand(getRunScriptCommand(detectPackageManager3(cwd), "test"), cwd);
503
538
  var TS_ERROR_RE = /^(.+)\((\d+),(\d+)\):\s+error\s+TS\d+:\s+(.+)$/gm;
504
539
  var ESLINT_ERROR_RE = /^\s+(\d+):(\d+)\s+error\s+(.+)$/gm;
505
540
  var JEST_FAIL_RE = /● (.+)/g;
@@ -549,15 +584,15 @@ var require_dist2 = __commonJS({
549
584
  }
550
585
  return errors;
551
586
  }
552
- var import_fs = __toESM2(require("fs"));
553
- var import_path2 = __toESM2(require("path"));
587
+ var import_fs2 = __toESM2(require("fs"));
588
+ var import_path22 = __toESM2(require("path"));
554
589
  async function runValidationPipeline(cwd) {
555
590
  const targetCwd = cwd ?? process.cwd();
556
591
  let scripts = [];
557
592
  try {
558
- const pkgPath = import_path2.default.resolve(targetCwd, "package.json");
559
- if (import_fs.default.existsSync(pkgPath)) {
560
- const pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf-8"));
593
+ const pkgPath = import_path22.default.resolve(targetCwd, "package.json");
594
+ if (import_fs2.default.existsSync(pkgPath)) {
595
+ const pkg = JSON.parse(import_fs2.default.readFileSync(pkgPath, "utf-8"));
561
596
  scripts = Object.keys(pkg.scripts || {});
562
597
  }
563
598
  } catch {
@@ -1375,6 +1410,7 @@ var require_dist7 = __commonJS({
1375
1410
  var index_exports = {};
1376
1411
  __export(index_exports, {
1377
1412
  detectFramework: () => detectFramework2,
1413
+ detectPackageManager: () => import_analyzers2.detectPackageManager,
1378
1414
  orchestrate: () => orchestrate2,
1379
1415
  orchestrateAndFix: () => orchestrateAndFix2
1380
1416
  });
@@ -1707,6 +1743,7 @@ ${rawOutput}
1707
1743
  console.log("\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
1708
1744
  }
1709
1745
  }
1746
+ var import_analyzers2 = require_dist2();
1710
1747
  }
1711
1748
  });
1712
1749
 
@@ -1721,10 +1758,12 @@ program.command("hunt").description("Run build, lint, and tests \u2014 report is
1721
1758
  try {
1722
1759
  const cwd = import_path.default.resolve(opts.path);
1723
1760
  const framework = (0, import_core.detectFramework)(cwd);
1761
+ const packageManager = (0, import_core.detectPackageManager)(cwd);
1724
1762
  console.log(`
1725
1763
  \u{1F50D} BugZero \u2014 Analyzing project`);
1726
1764
  console.log(` Path: ${cwd}`);
1727
- console.log(` Framework: ${framework}
1765
+ console.log(` Framework: ${framework}`);
1766
+ console.log(` Package manager: ${packageManager}
1728
1767
  `);
1729
1768
  const { build, lint, test } = await (0, import_core.orchestrate)({ cwd });
1730
1769
  console.log("\u2500\u2500 Pipeline Summary \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
@@ -1749,10 +1788,12 @@ program.command("rescue").description("Detect build failures and automatically a
1749
1788
  const maxAttempts = parseInt(opts.maxAttempts, 10);
1750
1789
  const dryRun = opts.dryRun;
1751
1790
  const framework = (0, import_core.detectFramework)(cwd);
1791
+ const packageManager = (0, import_core.detectPackageManager)(cwd);
1752
1792
  console.log(`
1753
1793
  \u{1F916} BugZero Fix`);
1754
1794
  console.log(` Path: ${cwd}`);
1755
1795
  console.log(` Framework: ${framework}`);
1796
+ console.log(` Package manager: ${packageManager}`);
1756
1797
  console.log(` Max attempts: ${maxAttempts}`);
1757
1798
  if (dryRun) console.log(` Mode: DRY RUN (no files will be modified)`);
1758
1799
  console.log();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bugzero",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "An autonomous, AI-powered CLI tool for automatic build error detection and repair.",
5
5
  "license": "MIT",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  import "@opspilot/config"; // loads .env before anything else
4
4
  import { Command } from "commander";
5
5
  import path from "path";
6
- import { orchestrate, orchestrateAndFix, detectFramework } from "@opspilot/core";
6
+ import { orchestrate, orchestrateAndFix, detectFramework, detectPackageManager } from "@opspilot/core";
7
7
 
8
8
 
9
9
  const program = new Command();
@@ -22,10 +22,12 @@ program
22
22
  try {
23
23
  const cwd = path.resolve(opts.path);
24
24
  const framework = detectFramework(cwd);
25
+ const packageManager = detectPackageManager(cwd);
25
26
 
26
27
  console.log(`\n🔍 BugZero — Analyzing project`);
27
28
  console.log(` Path: ${cwd}`);
28
- console.log(` Framework: ${framework}\n`);
29
+ console.log(` Framework: ${framework}`);
30
+ console.log(` Package manager: ${packageManager}\n`);
29
31
 
30
32
  const { build, lint, test } = await orchestrate({ cwd });
31
33
 
@@ -57,10 +59,12 @@ program
57
59
  const maxAttempts = parseInt(opts.maxAttempts, 10);
58
60
  const dryRun: boolean = opts.dryRun;
59
61
  const framework = detectFramework(cwd);
62
+ const packageManager = detectPackageManager(cwd);
60
63
 
61
64
  console.log(`\n🤖 BugZero Fix`);
62
65
  console.log(` Path: ${cwd}`);
63
66
  console.log(` Framework: ${framework}`);
67
+ console.log(` Package manager: ${packageManager}`);
64
68
  console.log(` Max attempts: ${maxAttempts}`);
65
69
  if (dryRun) console.log(` Mode: DRY RUN (no files will be modified)`);
66
70
  console.log();