frontend-guardian 0.1.19 → 0.1.21

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/dist/cli.js +4 -3
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -351,9 +351,10 @@ 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-1.5-flash", contents: prompt });
355
- const text = res.text;
356
- return (text ?? "").trim();
354
+ const res = await ai.models.generateContent({ model: "gemini-2.0-flash", contents: prompt });
355
+ const r = res;
356
+ const text = typeof r?.text === "string" ? r.text : r?.candidates?.[0]?.content?.parts?.find((p) => typeof p?.text === "string")?.text ?? "";
357
+ return text.trim();
357
358
  }
358
359
  async function getSuggestFromBackend(issueTitle, detected) {
359
360
  const url = process.env.FRONTEND_GUARDIAN_SUGGEST_URL || DEFAULT_SUGGEST_API;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frontend-guardian",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Scan frontend projects for Tailwind & component consistency (Phase 1 CLI)",
5
5
  "type": "module",
6
6
  "bin": {