frontend-guardian 0.1.16 → 0.1.17
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.js +3 -6
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -351,7 +351,7 @@ const DEFAULT_SUGGEST_API = "https://frontend-guardian.vercel.app/api/suggest";
|
|
|
351
351
|
async function getGeminiSuggestion(apiKey, issueTitle, detected) {
|
|
352
352
|
const ai = new GoogleGenAI({ apiKey });
|
|
353
353
|
const prompt = `Frontend Guardian found this issue: "${issueTitle}". Detected: ${detected.slice(0, 500)}. Give a brief concrete fix suggestion in 1-2 sentences. No preamble.`;
|
|
354
|
-
const res = await ai.models.generateContent({ model: "gemini-
|
|
354
|
+
const res = await ai.models.generateContent({ model: "gemini-1.5-flash", contents: prompt });
|
|
355
355
|
const text = res.text;
|
|
356
356
|
return (text ?? "").trim();
|
|
357
357
|
}
|
|
@@ -473,11 +473,8 @@ async function main() {
|
|
|
473
473
|
}
|
|
474
474
|
spinner.succeed("Done.");
|
|
475
475
|
}
|
|
476
|
-
catch
|
|
477
|
-
spinner.fail("AI
|
|
478
|
-
if (!apiKey)
|
|
479
|
-
console.error(chalk.yellow(" (Hosted API may be down. Set GEMINI_API_KEY to use your own key.)"));
|
|
480
|
-
console.error(chalk.red(e instanceof Error ? e.message : String(e)));
|
|
476
|
+
catch {
|
|
477
|
+
spinner.fail("AI suggestions not available at the moment.");
|
|
481
478
|
}
|
|
482
479
|
}
|
|
483
480
|
if (failOnScore != null && result.score < failOnScore) {
|