@shakecodeslikecray/whiterose 1.0.7 → 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 +39 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -443,6 +443,17 @@ var GeminiExecutor = class {
|
|
|
443
443
|
reject: false
|
|
444
444
|
}
|
|
445
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
|
+
}
|
|
446
457
|
return {
|
|
447
458
|
output: stdout || "",
|
|
448
459
|
error: stderr || void 0
|
|
@@ -483,6 +494,20 @@ var AiderExecutor = class {
|
|
|
483
494
|
reject: false
|
|
484
495
|
}
|
|
485
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
|
+
}
|
|
486
511
|
return {
|
|
487
512
|
output: stdout || "",
|
|
488
513
|
error: stderr || void 0
|
|
@@ -522,6 +547,20 @@ var OllamaExecutor = class {
|
|
|
522
547
|
reject: false
|
|
523
548
|
}
|
|
524
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
|
+
}
|
|
525
564
|
return {
|
|
526
565
|
output: stdout || "",
|
|
527
566
|
error: stderr || void 0
|