frontend-guardian 0.1.19 → 0.1.20
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 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -352,8 +352,9 @@ 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
354
|
const res = await ai.models.generateContent({ model: "gemini-1.5-flash", contents: prompt });
|
|
355
|
-
const
|
|
356
|
-
|
|
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;
|