bugzero 0.0.52 → 0.0.53

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 (3) hide show
  1. package/README.md +7 -0
  2. package/dist/index.js +25 -18
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -201,6 +201,13 @@ Run build, lint, and test checks. Reports all failures without modifying any fil
201
201
  bugzero hunt --path /path/to/your/project
202
202
  ```
203
203
 
204
+ When a check fails, `hunt` asks an AI model to write the diagnosis in `bugzero-report.md`, which sends your error logs to your AI provider. To keep `hunt` fully offline, add `--no-ai-report`: the report is still written, with the status of each check and the raw logs, and no network call is made.
205
+ ```bash
206
+ bugzero hunt --no-ai-report
207
+ ```
208
+
209
+ > **Heads-up for 1.0:** `hunt` will stop calling an AI model by default, and the AI diagnosis will become opt-in. Until then nothing changes unless you pass `--no-ai-report`.
210
+
204
211
  ### `bugzero rescue`
205
212
  Run the full AI-powered repair loop. Detects build failures, generates precise code patches, applies them, and verifies the result.
206
213
 
package/dist/index.js CHANGED
@@ -1897,7 +1897,8 @@ Re-run without \`--dry-run\` to let BugZero attempt a fix.
1897
1897
  success: build.success && lint.success && test.success,
1898
1898
  build,
1899
1899
  lint,
1900
- test
1900
+ test,
1901
+ aiReport: options.aiReport
1901
1902
  });
1902
1903
  return { build, lint, test };
1903
1904
  }
@@ -2001,19 +2002,7 @@ ${lint.output}
2001
2002
  ${test.output}
2002
2003
 
2003
2004
  `;
2004
- console.log("[BugZero] Calling AI to diagnose errors and write report...");
2005
- const prompt = buildHuntDiagnosisPrompt({ build, lint, test });
2006
- try {
2007
- const result = await provider.invoke(prompt, { cwd });
2008
- content = result.content;
2009
- content += `
2010
-
2011
- ---
2012
- ### \u{1F50D} BugZero Hunt Metadata
2013
- - **AI Brain (Model) used for Diagnosis:** \`${result.model || "unknown"}\`
2014
- - **Token Usage for Diagnosis:** ${result.usage ? `Prompt: **${result.usage.prompt_tokens}** | Completion: **${result.usage.completion_tokens}** | Total: **${result.usage.total_tokens}**` : "*N/A*"}`;
2015
- } catch (e) {
2016
- content = `# \u{1F50D} BugZero Hunt Report
2005
+ const reportWithoutAi = (modelLine, tokenLine) => `# \u{1F50D} BugZero Hunt Report
2017
2006
 
2018
2007
  **Date:** ${(/* @__PURE__ */ new Date()).toLocaleString()}
2019
2008
  **Project Path:** \`${cwd}\`
@@ -2029,9 +2018,27 @@ ${logs}
2029
2018
 
2030
2019
  ---
2031
2020
  ### \u{1F50D} BugZero Hunt Metadata
2032
- - **AI Brain (Model) used for Diagnosis:** *None (AI call failed)*
2033
- - **Token Usage for Diagnosis:** *N/A (AI call failed: ${e.message})*
2021
+ - **AI Brain (Model) used for Diagnosis:** ${modelLine}
2022
+ - **Token Usage for Diagnosis:** ${tokenLine}
2034
2023
  `;
2024
+ if (data.aiReport === false) {
2025
+ console.log("[BugZero] AI report turned off (--no-ai-report) \u2014 writing the report without contacting an AI model.");
2026
+ content = reportWithoutAi("*None (AI report turned off)*", "*N/A*");
2027
+ } else {
2028
+ console.log("[BugZero] Calling AI to diagnose errors and write report...");
2029
+ const prompt = buildHuntDiagnosisPrompt({ build, lint, test });
2030
+ try {
2031
+ const result = await provider.invoke(prompt, { cwd });
2032
+ content = result.content;
2033
+ content += `
2034
+
2035
+ ---
2036
+ ### \u{1F50D} BugZero Hunt Metadata
2037
+ - **AI Brain (Model) used for Diagnosis:** \`${result.model || "unknown"}\`
2038
+ - **Token Usage for Diagnosis:** ${result.usage ? `Prompt: **${result.usage.prompt_tokens}** | Completion: **${result.usage.completion_tokens}** | Total: **${result.usage.total_tokens}**` : "*N/A*"}`;
2039
+ } catch (e) {
2040
+ content = reportWithoutAi("*None (AI call failed)*", `*N/A (AI call failed: ${e.message})*`);
2041
+ }
2035
2042
  }
2036
2043
  } else {
2037
2044
  content = `# \u{1F50D} BugZero Hunt Report
@@ -2313,7 +2320,7 @@ function finish(exitCode, json) {
2313
2320
  }
2314
2321
  var program = new import_commander.Command();
2315
2322
  program.name("bugzero").description("AI-powered build issue fixer \u2014 detects and repairs build errors automatically").version(version);
2316
- program.command("hunt").description("Run build, lint, and tests \u2014 report issues without modifying files").option("-p, --path <dir>", "Path to the target project", ".").option("-t, --timeout <seconds>", TIMEOUT_DESCRIPTION).option("--json", JSON_DESCRIPTION).action(async (opts) => {
2323
+ program.command("hunt").description("Run build, lint, and tests \u2014 report issues without modifying files").option("-p, --path <dir>", "Path to the target project", ".").option("-t, --timeout <seconds>", TIMEOUT_DESCRIPTION).option("--no-ai-report", "Do not contact an AI model: write the report with the raw logs only").option("--json", JSON_DESCRIPTION).action(async (opts) => {
2317
2324
  const json = opts.json === true;
2318
2325
  if (json) routeLogsToStderr();
2319
2326
  try {
@@ -2329,7 +2336,7 @@ program.command("hunt").description("Run build, lint, and tests \u2014 report is
2329
2336
  console.log(` Package manager: ${packageManager}`);
2330
2337
  if (timeoutSeconds !== void 0) console.log(` Timeout: ${timeoutSeconds}s per command`);
2331
2338
  console.log();
2332
- const { build, lint, test } = await (0, import_core.orchestrate)({ cwd, timeoutSeconds });
2339
+ const { build, lint, test } = await (0, import_core.orchestrate)({ cwd, timeoutSeconds, aiReport: opts.aiReport });
2333
2340
  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");
2334
2341
  const label = (r) => r.skipped ? "\u23ED\uFE0F Skipped (no script)" : r.success ? "\u2705 Passed" : "\u274C Failed (see report)";
2335
2342
  console.log(` Build: ${label(build)}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bugzero",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "Autonomous AI-powered CLI and GitHub Action that detects build, lint, and test failures, generates multi-file patches, applies them atomically with fuzzy matching, and re-verifies until your project is green.",
5
5
  "license": "MIT",
6
6
  "author": "Saksham Agarwal (https://github.com/Saksham1800t)",