bugzero 0.0.54 → 0.0.55

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 +15 -0
  2. package/dist/index.js +45 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -225,6 +225,7 @@ bugzero rescue --path /path/to/your/project
225
225
  | `--max-attempts <n>` | `-n` | `3` | Maximum AI fix iterations before giving up |
226
226
  | `--timeout <seconds>` | `-t` | none | Stop any build, lint, or test command that runs longer than this many seconds |
227
227
  | `--dry-run` | | `false` | Analyze only — no files will be written |
228
+ | `--print-prompt` | | `false` | Print the exact prompt that would be sent to the AI model, then stop. Nothing is sent and no files are written |
228
229
  | `--json` | | `false` | Print the result as one JSON document on stdout (logs go to stderr) |
229
230
 
230
231
  </details>
@@ -262,6 +263,20 @@ bugzero rescue --json --dry-run | jq -r '.outcome'
262
263
 
263
264
  ---
264
265
 
266
+ ## Privacy
267
+
268
+ BugZero runs your build, lint and tests on your own machine. The only time your code can leave it is when BugZero asks an AI model for help, through [OpenRouter](https://openrouter.ai) with your own API key.
269
+
270
+ - **What is sent:** the error output of the failing command and the contents of the project's source files that output mentions (each shortened to a size limit), plus your project folder's path. Nothing is sent when your project already passes.
271
+ - **What is never sent:** files outside your project, secret files (`.env`, `.env.*`, `*.pem`, `*.key`), `node_modules`, build output and `.git`. BugZero cannot recognise a secret by its content, so a password that your build prints is sent like any other text.
272
+ - **See it first:** `bugzero rescue --print-prompt` prints the exact prompt and sends nothing.
273
+ - **Stay offline:** `bugzero hunt --no-ai-report` makes no network call.
274
+ - There is no telemetry, analytics or update check.
275
+
276
+ The full list, with sizes and limits, is in [docs/PRIVACY.md](https://github.com/Saksham1800t/Bugzero/blob/main/docs/PRIVACY.md).
277
+
278
+ ---
279
+
265
280
  ## Configuration
266
281
 
267
282
  BugZero reads a `.bugzerorc` JSON file in your target project directory to pick up model preferences and file protection:
package/dist/index.js CHANGED
@@ -1592,6 +1592,7 @@ var require_dist7 = __commonJS({
1592
1592
  var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
1593
1593
  var index_exports = {};
1594
1594
  __export(index_exports, {
1595
+ previewAnalysisPrompt: () => previewAnalysisPrompt,
1595
1596
  runRepairWorkflow: () => runRepairWorkflow,
1596
1597
  workflow: () => workflow
1597
1598
  });
@@ -1697,12 +1698,15 @@ var require_dist7 = __commonJS({
1697
1698
  function protectionFor(cwd) {
1698
1699
  return (0, import_shared3.createProtectedPathRules)((0, import_config2.getProtectionSettings)(cwd));
1699
1700
  }
1701
+ function previewAnalysisPrompt(cwd, logs) {
1702
+ return (0, import_prompts.buildAnalysisPrompt)(logs, cwd, { rules: protectionFor(cwd) });
1703
+ }
1700
1704
  async function analyzeNode(state) {
1701
1705
  console.log(
1702
1706
  `
1703
1707
  [BugZero] Attempt ${state.attempts + 1}/${state.maxAttempts} \u2014 asking AI\u2026`
1704
1708
  );
1705
- const prompt = (0, import_prompts.buildAnalysisPrompt)(state.logs, state.cwd, { rules: protectionFor(state.cwd) });
1709
+ const prompt = previewAnalysisPrompt(state.cwd, state.logs);
1706
1710
  const result = await provider.invoke(prompt, { cwd: state.cwd });
1707
1711
  const response = result.content;
1708
1712
  let fixSuggestion = null;
@@ -2051,6 +2055,10 @@ Re-run without \`--dry-run\` to let BugZero attempt a fix.
2051
2055
  const pipelineResult = await (0, import_analyzers.runValidationPipeline)(cwd, { timeoutMs });
2052
2056
  if (pipelineResult.success) {
2053
2057
  console.log("[BugZero] Validation already passing \u2014 nothing to fix.");
2058
+ if (options.printPrompt) {
2059
+ console.log("[BugZero] Nothing would be sent to an AI model.");
2060
+ return { success: true, attempts: 0, finalOutput: "" };
2061
+ }
2054
2062
  await writeReport(cwd, "rescue", {
2055
2063
  success: true,
2056
2064
  attempts: 0,
@@ -2062,6 +2070,15 @@ Re-run without \`--dry-run\` to let BugZero attempt a fix.
2062
2070
  }
2063
2071
  const errors = (0, import_analyzers.parseErrors)(pipelineResult.output);
2064
2072
  console.log(`[BugZero] Detected ${errors.length} error(s) (type: ${errors[0]?.type ?? "unknown"})`);
2073
+ if (options.printPrompt) {
2074
+ console.log("[BugZero] --print-prompt: showing the first prompt without sending it.");
2075
+ return {
2076
+ success: false,
2077
+ attempts: 0,
2078
+ finalOutput: pipelineResult.output,
2079
+ promptPreview: (0, import_agents.previewAnalysisPrompt)(cwd, pipelineResult.output)
2080
+ };
2081
+ }
2065
2082
  if (options.dryRun) {
2066
2083
  console.log("[BugZero] Dry-run mode \u2014 skipping AI fix.");
2067
2084
  await writeReport(cwd, "rescue", {
@@ -2352,7 +2369,8 @@ function buildHuntJson(info, steps) {
2352
2369
  }
2353
2370
  function buildRescueJson(result, info) {
2354
2371
  let outcome;
2355
- if (result.success && result.attempts === 0) outcome = "already-passing";
2372
+ if (result.promptPreview !== void 0) outcome = "prompt-preview";
2373
+ else if (result.success && result.attempts === 0) outcome = "already-passing";
2356
2374
  else if (result.success) outcome = "fixed";
2357
2375
  else if (info.dryRun) outcome = "dry-run";
2358
2376
  else outcome = "failed";
@@ -2364,7 +2382,8 @@ function buildRescueJson(result, info) {
2364
2382
  return {
2365
2383
  command: "rescue",
2366
2384
  outcome,
2367
- success: result.success,
2385
+ // A preview that shows the prompt did what was asked, which is why its exit code is 0
2386
+ success: result.success || result.promptPreview !== void 0,
2368
2387
  dryRun: info.dryRun,
2369
2388
  path: info.path,
2370
2389
  framework: info.framework,
@@ -2378,6 +2397,7 @@ function buildRescueJson(result, info) {
2378
2397
  files: (0, import_shared.uniqueFilePaths)(result.appliedFix.patches)
2379
2398
  } : null,
2380
2399
  error: result.error ?? null,
2400
+ prompt: result.promptPreview ?? null,
2381
2401
  reportPath: info.reportPath
2382
2402
  };
2383
2403
  }
@@ -2501,9 +2521,10 @@ ${allPassed ? "\u2705 All checks passed" : "\u274C Issues found \u2014 run 'bugz
2501
2521
  finish(1, json ? buildErrorJson(String(error.message || error)) : void 0);
2502
2522
  }
2503
2523
  });
2504
- 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("-t, --timeout <seconds>", TIMEOUT_DESCRIPTION).option("--dry-run", "Analyse only \u2014 print what would be fixed without writing files", false).option("--json", JSON_DESCRIPTION).action(async (opts) => {
2524
+ 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("-t, --timeout <seconds>", TIMEOUT_DESCRIPTION).option("--dry-run", "Analyse only \u2014 print what would be fixed without writing files", false).option("--print-prompt", "Print the exact prompt that would be sent to the AI model, then stop (nothing is sent, no files are written)").option("--json", JSON_DESCRIPTION).action(async (opts) => {
2505
2525
  const json = opts.json === true;
2506
- if (json) routeLogsToStderr();
2526
+ const printPrompt = opts.printPrompt === true;
2527
+ if (json || printPrompt) routeLogsToStderr();
2507
2528
  try {
2508
2529
  const cwd = import_path.default.resolve(opts.path);
2509
2530
  (0, import_config.loadProjectEnv)(cwd);
@@ -2521,7 +2542,25 @@ program.command("rescue").description("Detect build failures and automatically a
2521
2542
  if (timeoutSeconds !== void 0) console.log(` Timeout: ${timeoutSeconds}s per command`);
2522
2543
  if (dryRun) console.log(` Mode: DRY RUN (no files will be modified)`);
2523
2544
  console.log();
2524
- const result = await (0, import_core.orchestrateAndFix)({ cwd, maxAttempts, dryRun, timeoutSeconds });
2545
+ const result = await (0, import_core.orchestrateAndFix)({ cwd, maxAttempts, dryRun, timeoutSeconds, printPrompt });
2546
+ if (result.promptPreview !== void 0) {
2547
+ if (json) {
2548
+ finish(
2549
+ 0,
2550
+ buildRescueJson(result, {
2551
+ path: cwd,
2552
+ framework,
2553
+ packageManager,
2554
+ dryRun,
2555
+ reportPath: import_path.default.resolve(cwd, import_core.REPORT_FILENAME)
2556
+ })
2557
+ );
2558
+ } else {
2559
+ process.stdout.write(`${result.promptPreview}
2560
+ `, () => process.exit(0));
2561
+ }
2562
+ return;
2563
+ }
2525
2564
  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");
2526
2565
  const summary = buildRescueSummary(result, { dryRun });
2527
2566
  for (const line of summary.lines) console.log(line);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bugzero",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
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)",