@shakecodeslikecray/whiterose 1.0.6 → 1.0.8

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/dist/cli/index.js CHANGED
@@ -326,6 +326,20 @@ var ClaudeCodeExecutor = class {
326
326
  reject: false
327
327
  }
328
328
  );
329
+ if (stderr) {
330
+ if (stderr.includes("429") || stderr.includes("rate limit") || stderr.includes("too many requests")) {
331
+ throw new Error("Claude API rate limit reached. Try again later.");
332
+ }
333
+ if (stderr.includes("401") || stderr.includes("unauthorized") || stderr.includes("invalid api key")) {
334
+ throw new Error("Claude API authentication failed. Check your API key.");
335
+ }
336
+ if (stderr.includes("402") || stderr.includes("insufficient") || stderr.includes("billing")) {
337
+ throw new Error("Claude API billing error. Check your account credits.");
338
+ }
339
+ if (stderr.includes("Error:") && !stdout) {
340
+ throw new Error(`Claude Code error: ${stderr.substring(0, 200)}`);
341
+ }
342
+ }
329
343
  return {
330
344
  output: stdout || "",
331
345
  error: stderr || void 0
@@ -370,6 +384,19 @@ var CodexExecutor = class {
370
384
  reject: false
371
385
  }
372
386
  );
387
+ if (stderr) {
388
+ if (stderr.includes("429") || stderr.includes("usage_limit") || stderr.includes("rate limit")) {
389
+ throw new Error("Codex API rate limit reached. Try again later or upgrade your plan.");
390
+ }
391
+ if (stderr.includes("401") || stderr.includes("unauthorized") || stderr.includes("authentication")) {
392
+ throw new Error("Codex API authentication failed. Check your API key.");
393
+ }
394
+ if (stderr.includes("ERROR:") || stderr.includes("error=http")) {
395
+ const errorMatch = stderr.match(/ERROR:\s*(.+?)(?:\n|$)/i) || stderr.match(/error=(.+?)(?:\n|$)/);
396
+ const errorMsg = errorMatch ? errorMatch[1].trim() : stderr.substring(0, 200);
397
+ throw new Error(`Codex API error: ${errorMsg}`);
398
+ }
399
+ }
373
400
  let output = stdout || "";
374
401
  if (existsSync(outputFile)) {
375
402
  try {
@@ -416,6 +443,17 @@ var GeminiExecutor = class {
416
443
  reject: false
417
444
  }
418
445
  );
446
+ if (stderr) {
447
+ if (stderr.includes("429") || stderr.includes("rate limit") || stderr.includes("quota exceeded")) {
448
+ throw new Error("Gemini API rate limit reached. Try again later.");
449
+ }
450
+ if (stderr.includes("401") || stderr.includes("403") || stderr.includes("unauthorized") || stderr.includes("invalid api key")) {
451
+ throw new Error("Gemini API authentication failed. Check your API key.");
452
+ }
453
+ if ((stderr.includes("Error") || stderr.includes("error")) && !stdout) {
454
+ throw new Error(`Gemini error: ${stderr.substring(0, 200)}`);
455
+ }
456
+ }
419
457
  return {
420
458
  output: stdout || "",
421
459
  error: stderr || void 0
@@ -456,6 +494,20 @@ var AiderExecutor = class {
456
494
  reject: false
457
495
  }
458
496
  );
497
+ if (stderr) {
498
+ if (stderr.includes("429") || stderr.includes("rate limit") || stderr.includes("RateLimitError")) {
499
+ throw new Error("Aider API rate limit reached. Try again later.");
500
+ }
501
+ if (stderr.includes("401") || stderr.includes("AuthenticationError") || stderr.includes("invalid api key")) {
502
+ throw new Error("Aider API authentication failed. Check your API key.");
503
+ }
504
+ if (stderr.includes("402") || stderr.includes("insufficient") || stderr.includes("billing")) {
505
+ throw new Error("Aider API billing error. Check your account credits.");
506
+ }
507
+ if ((stderr.includes("Error") || stderr.includes("error")) && !stdout) {
508
+ throw new Error(`Aider error: ${stderr.substring(0, 200)}`);
509
+ }
510
+ }
459
511
  return {
460
512
  output: stdout || "",
461
513
  error: stderr || void 0
@@ -495,6 +547,20 @@ var OllamaExecutor = class {
495
547
  reject: false
496
548
  }
497
549
  );
550
+ if (stderr) {
551
+ if (stderr.includes("connection refused") || stderr.includes("ECONNREFUSED")) {
552
+ throw new Error("Ollama server not running. Start it with: ollama serve");
553
+ }
554
+ if (stderr.includes("model") && (stderr.includes("not found") || stderr.includes("does not exist"))) {
555
+ throw new Error(`Ollama model '${this.model}' not found. Run: ollama pull ${this.model}`);
556
+ }
557
+ if (stderr.includes("out of memory") || stderr.includes("OOM")) {
558
+ throw new Error("Ollama out of memory. Try a smaller model or increase system memory.");
559
+ }
560
+ if ((stderr.includes("Error") || stderr.includes("error")) && !stdout) {
561
+ throw new Error(`Ollama error: ${stderr.substring(0, 200)}`);
562
+ }
563
+ }
498
564
  return {
499
565
  output: stdout || "",
500
566
  error: stderr || void 0