gemini-design-mcp 3.2.0 → 3.2.2
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/build/lib/gemini.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GoogleGenAI } from "@google/genai";
|
|
1
|
+
import { GoogleGenAI, ThinkingLevel } from "@google/genai";
|
|
2
2
|
const apiKey = process.env.GEMINI_API_KEY;
|
|
3
3
|
if (!apiKey) {
|
|
4
4
|
console.error("ERROR: GEMINI_API_KEY environment variable is required");
|
|
@@ -6,7 +6,7 @@ if (!apiKey) {
|
|
|
6
6
|
process.exit(1);
|
|
7
7
|
}
|
|
8
8
|
export const ai = new GoogleGenAI({ apiKey });
|
|
9
|
-
// Default model - Gemini 3
|
|
9
|
+
// Default model - Gemini 3 Flash Preview (best for design)
|
|
10
10
|
export const DEFAULT_MODEL = "gemini-3-flash-preview";
|
|
11
11
|
export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAULT_MODEL) {
|
|
12
12
|
try {
|
|
@@ -15,6 +15,10 @@ export async function generateWithGemini(systemPrompt, userPrompt, model = DEFAU
|
|
|
15
15
|
contents: userPrompt,
|
|
16
16
|
config: {
|
|
17
17
|
systemInstruction: systemPrompt,
|
|
18
|
+
temperature: 1,
|
|
19
|
+
thinkingConfig: {
|
|
20
|
+
thinkingLevel: ThinkingLevel.LOW,
|
|
21
|
+
},
|
|
18
22
|
},
|
|
19
23
|
});
|
|
20
24
|
return response.text ?? "";
|
|
@@ -3,7 +3,7 @@ export declare const createFrontendSchema: {
|
|
|
3
3
|
request: z.ZodString;
|
|
4
4
|
filePath: z.ZodString;
|
|
5
5
|
techStack: z.ZodString;
|
|
6
|
-
context: z.
|
|
6
|
+
context: z.ZodOptional<z.ZodString>;
|
|
7
7
|
designSystem: z.ZodOptional<z.ZodObject<{
|
|
8
8
|
vibe: z.ZodObject<{
|
|
9
9
|
name: z.ZodString;
|
|
@@ -36,7 +36,7 @@ export declare function createFrontend(params: {
|
|
|
36
36
|
request: string;
|
|
37
37
|
filePath: string;
|
|
38
38
|
techStack: string;
|
|
39
|
-
context
|
|
39
|
+
context?: string;
|
|
40
40
|
designSystem?: {
|
|
41
41
|
vibe: {
|
|
42
42
|
name: string;
|
|
@@ -9,9 +9,9 @@ export const createFrontendSchema = {
|
|
|
9
9
|
"Example: 'src/components/PricingPage.tsx' or 'app/dashboard/page.tsx'"),
|
|
10
10
|
techStack: z.string().describe("The tech stack to use. Be specific. " +
|
|
11
11
|
"Examples: 'React + TypeScript + Tailwind CSS', 'Next.js 14 App Router + shadcn/ui', 'Vue 3 + Composition API + CSS Modules'"),
|
|
12
|
-
context: z.string().
|
|
12
|
+
context: z.string().optional().describe("Existing project code for design consistency. " +
|
|
13
13
|
"Pass relevant files (components, styles, theme config) so Gemini matches your design system. " +
|
|
14
|
-
"
|
|
14
|
+
"Omit this parameter if this is the FIRST file in a new project."),
|
|
15
15
|
designSystem: z.object({
|
|
16
16
|
vibe: z.object({
|
|
17
17
|
name: z.string().describe("Vibe name (e.g., 'Pristine Museum', 'Dark Luxe')"),
|
|
@@ -42,9 +42,9 @@ Interpret this vibe creatively:
|
|
|
42
42
|
- You have freedom in the specific implementation, but the overall feel MUST match this vibe
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
45
|
-
// Build context instructions
|
|
45
|
+
// Build context instructions (ignore empty strings and "null" strings)
|
|
46
46
|
let contextInstructions = '';
|
|
47
|
-
if (context) {
|
|
47
|
+
if (context && context !== "null" && context.trim() !== "") {
|
|
48
48
|
contextInstructions = `
|
|
49
49
|
EXISTING PROJECT CONTEXT (match this design system):
|
|
50
50
|
${context}
|