bugzero 0.0.27 → 0.0.28
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.
- package/.turbo/turbo-build.log +4 -4
- package/dist/index.js +59 -47
- package/package.json +2 -1
- package/src/index.ts +64 -54
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> bugzero@0.0.
|
|
2
|
+
> bugzero@0.0.28 build D:\WD projects\OpsPilot\packages\cli
|
|
3
3
|
> tsup src/index.ts --format cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
|
-
[32mCJS[39m [1mdist\index.js [22m[32m70.
|
|
11
|
-
[32mCJS[39m ⚡️ Build success in
|
|
10
|
+
[32mCJS[39m [1mdist\index.js [22m[32m70.42 KB[39m
|
|
11
|
+
[32mCJS[39m ⚡️ Build success in 111ms
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 2699ms
|
|
14
14
|
[32mDTS[39m [1mdist\index.d.ts [22m[32m20.00 B[39m
|
package/dist/index.js
CHANGED
|
@@ -1541,62 +1541,74 @@ var import_core = __toESM(require_dist7());
|
|
|
1541
1541
|
var program = new import_commander.Command();
|
|
1542
1542
|
program.name("bugzero").description("AI-powered build issue fixer \u2014 detects and repairs build errors automatically").version("0.0.1");
|
|
1543
1543
|
program.command("hunt").description("Run build, lint, and tests \u2014 report issues without modifying files").option("-p, --path <dir>", "Path to the target project", ".").action(async (opts) => {
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1544
|
+
try {
|
|
1545
|
+
const cwd = import_path.default.resolve(opts.path);
|
|
1546
|
+
const framework = (0, import_core.detectFramework)(cwd);
|
|
1547
|
+
console.log(`
|
|
1547
1548
|
\u{1F50D} BugZero \u2014 Analyzing project`);
|
|
1548
|
-
|
|
1549
|
-
|
|
1549
|
+
console.log(` Path: ${cwd}`);
|
|
1550
|
+
console.log(` Framework: ${framework}
|
|
1550
1551
|
`);
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1552
|
+
const { build, lint, test } = await (0, import_core.orchestrate)({ cwd });
|
|
1553
|
+
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");
|
|
1554
|
+
console.log(` Build: ${build.success ? "\u2705 Passed" : "\u274C Failed (see report)"}`);
|
|
1555
|
+
console.log(` Lint: ${lint.success ? "\u2705 Passed" : "\u274C Failed (see report)"}`);
|
|
1556
|
+
console.log(` Tests: ${test.success ? "\u2705 Passed" : "\u274C Failed (see report)"}`);
|
|
1557
|
+
console.log("\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\u2500");
|
|
1558
|
+
const allPassed = build.success && lint.success && test.success;
|
|
1559
|
+
console.log(`
|
|
1559
1560
|
${allPassed ? "\u2705 All checks passed" : "\u274C Issues found \u2014 run 'bugzero rescue' to repair"}
|
|
1560
1561
|
`);
|
|
1561
|
-
|
|
1562
|
+
process.exit(allPassed ? 0 : 1);
|
|
1563
|
+
} catch (error) {
|
|
1564
|
+
console.error(`
|
|
1565
|
+
\u274C [BugZero] Execution failed: ${error.message || error}`);
|
|
1566
|
+
process.exit(1);
|
|
1567
|
+
}
|
|
1562
1568
|
});
|
|
1563
1569
|
program.command("rescue").description("Detect build failures and automatically apply AI-generated fixes").option("-p, --path <dir>", "Path to the target project", ".").option("-n, --max-attempts <number>", "Maximum AI fix attempts", "3").option("--dry-run", "Analyse only \u2014 print what would be fixed without writing files", false).action(async (opts) => {
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
\u{1F916} BugZero Fix`);
|
|
1570
|
-
console.log(` Path: ${cwd}`);
|
|
1571
|
-
console.log(` Framework: ${framework}`);
|
|
1572
|
-
console.log(` Max attempts: ${maxAttempts}`);
|
|
1573
|
-
if (dryRun) console.log(` Mode: DRY RUN (no files will be modified)`);
|
|
1574
|
-
console.log();
|
|
1575
|
-
const result = await (0, import_core.orchestrateAndFix)({ cwd, maxAttempts, dryRun });
|
|
1576
|
-
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");
|
|
1577
|
-
if (result.success) {
|
|
1578
|
-
console.log(`\u2705 Build fixed after ${result.attempts} attempt(s)!`);
|
|
1579
|
-
console.log(` Model: ${result.modelUsed || "unknown"}`);
|
|
1580
|
-
if (result.promptTokens !== void 0 && result.completionTokens !== void 0) {
|
|
1581
|
-
console.log(` Tokens: Prompt: ${result.promptTokens} | Completion: ${result.completionTokens} | Total: ${result.promptTokens + result.completionTokens}`);
|
|
1582
|
-
}
|
|
1583
|
-
if (result.appliedFix) {
|
|
1584
|
-
console.log(` File: ${result.appliedFix.filePath}`);
|
|
1585
|
-
console.log(` Reason: ${result.appliedFix.explanation}`);
|
|
1586
|
-
console.log(` Root cause: ${result.appliedFix.rootCause}`);
|
|
1587
|
-
}
|
|
1588
|
-
} else {
|
|
1589
|
-
console.log(`\u274C Could not fix build after ${result.attempts} attempt(s).`);
|
|
1590
|
-
console.log(` Model: ${result.modelUsed || "unknown"}`);
|
|
1591
|
-
if (result.promptTokens !== void 0 && result.completionTokens !== void 0) {
|
|
1592
|
-
console.log(` Tokens: Prompt: ${result.promptTokens} | Completion: ${result.completionTokens} | Total: ${result.promptTokens + result.completionTokens}`);
|
|
1593
|
-
}
|
|
1594
|
-
if (result.error) console.log(` ${result.error}`);
|
|
1570
|
+
try {
|
|
1571
|
+
const cwd = import_path.default.resolve(opts.path);
|
|
1572
|
+
const maxAttempts = parseInt(opts.maxAttempts, 10);
|
|
1573
|
+
const dryRun = opts.dryRun;
|
|
1574
|
+
const framework = (0, import_core.detectFramework)(cwd);
|
|
1595
1575
|
console.log(`
|
|
1576
|
+
\u{1F916} BugZero Fix`);
|
|
1577
|
+
console.log(` Path: ${cwd}`);
|
|
1578
|
+
console.log(` Framework: ${framework}`);
|
|
1579
|
+
console.log(` Max attempts: ${maxAttempts}`);
|
|
1580
|
+
if (dryRun) console.log(` Mode: DRY RUN (no files will be modified)`);
|
|
1581
|
+
console.log();
|
|
1582
|
+
const result = await (0, import_core.orchestrateAndFix)({ cwd, maxAttempts, dryRun });
|
|
1583
|
+
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");
|
|
1584
|
+
if (result.success) {
|
|
1585
|
+
console.log(`\u2705 Build fixed after ${result.attempts} attempt(s)!`);
|
|
1586
|
+
console.log(` Model: ${result.modelUsed || "unknown"}`);
|
|
1587
|
+
if (result.promptTokens !== void 0 && result.completionTokens !== void 0) {
|
|
1588
|
+
console.log(` Tokens: Prompt: ${result.promptTokens} | Completion: ${result.completionTokens} | Total: ${result.promptTokens + result.completionTokens}`);
|
|
1589
|
+
}
|
|
1590
|
+
if (result.appliedFix) {
|
|
1591
|
+
console.log(` File: ${result.appliedFix.filePath}`);
|
|
1592
|
+
console.log(` Reason: ${result.appliedFix.explanation}`);
|
|
1593
|
+
console.log(` Root cause: ${result.appliedFix.rootCause}`);
|
|
1594
|
+
}
|
|
1595
|
+
} else {
|
|
1596
|
+
console.log(`\u274C Could not fix build after ${result.attempts} attempt(s).`);
|
|
1597
|
+
console.log(` Model: ${result.modelUsed || "unknown"}`);
|
|
1598
|
+
if (result.promptTokens !== void 0 && result.completionTokens !== void 0) {
|
|
1599
|
+
console.log(` Tokens: Prompt: ${result.promptTokens} | Completion: ${result.completionTokens} | Total: ${result.promptTokens + result.completionTokens}`);
|
|
1600
|
+
}
|
|
1601
|
+
if (result.error) console.log(` ${result.error}`);
|
|
1602
|
+
console.log(`
|
|
1596
1603
|
\u{1F449} Full unresolved error logs have been listed in the generated report.`);
|
|
1604
|
+
}
|
|
1605
|
+
console.log();
|
|
1606
|
+
process.exit(result.success ? 0 : 1);
|
|
1607
|
+
} catch (error) {
|
|
1608
|
+
console.error(`
|
|
1609
|
+
\u274C [BugZero] Execution failed: ${error.message || error}`);
|
|
1610
|
+
process.exit(1);
|
|
1597
1611
|
}
|
|
1598
|
-
console.log();
|
|
1599
|
-
process.exit(result.success ? 0 : 1);
|
|
1600
1612
|
});
|
|
1601
1613
|
program.command("protect").description("[Deprecated] Use 'hunt' instead").action(async () => {
|
|
1602
1614
|
console.warn("\u26A0\uFE0F 'protect' is deprecated \u2014 use 'bugzero hunt' instead.\n");
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -19,24 +19,29 @@ program
|
|
|
19
19
|
.description("Run build, lint, and tests — report issues without modifying files")
|
|
20
20
|
.option("-p, --path <dir>", "Path to the target project", ".")
|
|
21
21
|
.action(async (opts) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
try {
|
|
23
|
+
const cwd = path.resolve(opts.path);
|
|
24
|
+
const framework = detectFramework(cwd);
|
|
25
|
+
|
|
26
|
+
console.log(`\n🔍 BugZero — Analyzing project`);
|
|
27
|
+
console.log(` Path: ${cwd}`);
|
|
28
|
+
console.log(` Framework: ${framework}\n`);
|
|
29
|
+
|
|
30
|
+
const { build, lint, test } = await orchestrate({ cwd });
|
|
31
|
+
|
|
32
|
+
console.log("── Pipeline Summary ───────────────────────────");
|
|
33
|
+
console.log(` Build: ${build.success ? "✅ Passed" : "❌ Failed (see report)"}`);
|
|
34
|
+
console.log(` Lint: ${lint.success ? "✅ Passed" : "❌ Failed (see report)"}`);
|
|
35
|
+
console.log(` Tests: ${test.success ? "✅ Passed" : "❌ Failed (see report)"}`);
|
|
36
|
+
console.log("───────────────────────────────────────────────");
|
|
37
|
+
|
|
38
|
+
const allPassed = build.success && lint.success && test.success;
|
|
39
|
+
console.log(`\n${allPassed ? "✅ All checks passed" : "❌ Issues found — run 'bugzero rescue' to repair"}\n`);
|
|
40
|
+
process.exit(allPassed ? 0 : 1);
|
|
41
|
+
} catch (error: any) {
|
|
42
|
+
console.error(`\n❌ [BugZero] Execution failed: ${error.message || error}`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
40
45
|
});
|
|
41
46
|
|
|
42
47
|
// ── bugzero rescue ───────────────────────────────────────────────────────────
|
|
@@ -47,44 +52,49 @@ program
|
|
|
47
52
|
.option("-n, --max-attempts <number>", "Maximum AI fix attempts", "3")
|
|
48
53
|
.option("--dry-run", "Analyse only — print what would be fixed without writing files", false)
|
|
49
54
|
.action(async (opts) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
55
|
+
try {
|
|
56
|
+
const cwd = path.resolve(opts.path);
|
|
57
|
+
const maxAttempts = parseInt(opts.maxAttempts, 10);
|
|
58
|
+
const dryRun: boolean = opts.dryRun;
|
|
59
|
+
const framework = detectFramework(cwd);
|
|
60
|
+
|
|
61
|
+
console.log(`\n🤖 BugZero Fix`);
|
|
62
|
+
console.log(` Path: ${cwd}`);
|
|
63
|
+
console.log(` Framework: ${framework}`);
|
|
64
|
+
console.log(` Max attempts: ${maxAttempts}`);
|
|
65
|
+
if (dryRun) console.log(` Mode: DRY RUN (no files will be modified)`);
|
|
66
|
+
console.log();
|
|
67
|
+
|
|
68
|
+
const result = await orchestrateAndFix({ cwd, maxAttempts, dryRun });
|
|
69
|
+
|
|
70
|
+
console.log("\n──────────────────────────────────────────────");
|
|
71
|
+
if (result.success) {
|
|
72
|
+
console.log(`✅ Build fixed after ${result.attempts} attempt(s)!`);
|
|
73
|
+
console.log(` Model: ${result.modelUsed || "unknown"}`);
|
|
74
|
+
if (result.promptTokens !== undefined && result.completionTokens !== undefined) {
|
|
75
|
+
console.log(` Tokens: Prompt: ${result.promptTokens} | Completion: ${result.completionTokens} | Total: ${result.promptTokens + result.completionTokens}`);
|
|
76
|
+
}
|
|
77
|
+
if (result.appliedFix) {
|
|
78
|
+
console.log(` File: ${result.appliedFix.filePath}`);
|
|
79
|
+
console.log(` Reason: ${result.appliedFix.explanation}`);
|
|
80
|
+
console.log(` Root cause: ${result.appliedFix.rootCause}`);
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
console.log(`❌ Could not fix build after ${result.attempts} attempt(s).`);
|
|
84
|
+
console.log(` Model: ${result.modelUsed || "unknown"}`);
|
|
85
|
+
if (result.promptTokens !== undefined && result.completionTokens !== undefined) {
|
|
86
|
+
console.log(` Tokens: Prompt: ${result.promptTokens} | Completion: ${result.completionTokens} | Total: ${result.promptTokens + result.completionTokens}`);
|
|
87
|
+
}
|
|
88
|
+
if (result.error) console.log(` ${result.error}`);
|
|
89
|
+
console.log(`\n👉 Full unresolved error logs have been listed in the generated report.`);
|
|
81
90
|
}
|
|
82
|
-
|
|
83
|
-
console.log(`\n👉 Full unresolved error logs have been listed in the generated report.`);
|
|
84
|
-
}
|
|
85
|
-
console.log();
|
|
91
|
+
console.log();
|
|
86
92
|
|
|
87
|
-
|
|
93
|
+
process.exit(result.success ? 0 : 1);
|
|
94
|
+
} catch (error: any) {
|
|
95
|
+
console.error(`\n❌ [BugZero] Execution failed: ${error.message || error}`);
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
88
98
|
});
|
|
89
99
|
|
|
90
100
|
// ── bugzero protect (legacy) ────────────────────────────────────────────────
|