kodevu 0.1.62 → 0.1.63

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodevu",
3
- "version": "0.1.62",
3
+ "version": "0.1.63",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Poll SVN revisions or Git commits, send each change diff to a reviewer CLI, and write configurable review reports.",
package/src/config.js CHANGED
@@ -139,7 +139,7 @@ async function resolveAutoReviewers(debug) {
139
139
  }
140
140
 
141
141
  if (availableReviewers.length === 0) {
142
- throw new Error(`No reviewer CLI found in PATH. Install one of: ${AUTO_SUPPORTED_REVIEWERS.join(", ")}`);
142
+ throw mkCliError(`No reviewer CLI found in PATH. Install one of: ${AUTO_SUPPORTED_REVIEWERS.join(", ")}`);
143
143
  }
144
144
 
145
145
  // Shuffle for variety
@@ -335,11 +335,11 @@ export async function resolveConfig(cliArgs = {}) {
335
335
  }
336
336
 
337
337
  if (cliArgs.rev && cliArgs.last) {
338
- throw new Error("Parameters --rev and --last are mutually exclusive. Please specify only one.");
338
+ throw mkCliError("Parameters --rev and --last are mutually exclusive. Please specify only one.");
339
339
  }
340
340
 
341
341
  if (cliArgs.uncommitted && (cliArgs.rev || cliArgs.last)) {
342
- throw new Error("Parameter --uncommitted is mutually exclusive with --rev and --last.");
342
+ throw mkCliError("Parameter --uncommitted is mutually exclusive with --rev and --last.");
343
343
  }
344
344
 
345
345
  if (!config.target) {
@@ -358,7 +358,7 @@ export async function resolveConfig(cliArgs = {}) {
358
358
  try {
359
359
  config.prompt = await fs.readFile(promptPath, "utf8");
360
360
  } catch (err) {
361
- throw new Error(`Failed to read prompt file: ${promptPath} (${err.message})`);
361
+ throw mkCliError(`Failed to read prompt file: ${promptPath} (${err.message})`);
362
362
  }
363
363
  }
364
364
 
@@ -370,7 +370,7 @@ export async function resolveConfig(cliArgs = {}) {
370
370
  config.fallbackReviewers = availableReviewers.map(r => r.reviewerName).slice(1);
371
371
  config.reviewerWasAutoSelected = true;
372
372
  } else if (!SUPPORTED_REVIEWERS.includes(config.reviewer)) {
373
- throw new Error(`"reviewer" must be one of: ${SUPPORTED_REVIEWERS.join(", ")}, or "auto"`);
373
+ throw mkCliError(`"reviewer" must be one of: ${SUPPORTED_REVIEWERS.join(", ")}, or "auto"`);
374
374
  }
375
375
 
376
376
  config.outputDir = resolvePath(config.outputDir);
@@ -391,7 +391,7 @@ export async function resolveConfig(cliArgs = {}) {
391
391
  }
392
392
 
393
393
  if (config.reviewer === "openai" && !config.openaiApiKey) {
394
- throw new Error('Reviewer "openai" requires an API key. Set KODEVU_OPENAI_API_KEY or pass --openai-api-key.');
394
+ throw mkCliError('Reviewer "openai" requires an API key. Set KODEVU_OPENAI_API_KEY or pass --openai-api-key.');
395
395
  }
396
396
 
397
397
  return config;