@houtini/gemini-mcp 1.4.5 → 2.2.0
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/README.md +314 -834
- package/claude_desktop_config_example.json +1 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +8 -4
- package/dist/config/index.js.map +1 -1
- package/dist/config/types.d.ts +5 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/image-viewer/image-viewer-app.html +180 -0
- package/dist/image-viewer/src/ui/image-viewer.html +324 -0
- package/dist/index-new.d.ts +3 -0
- package/dist/index-new.d.ts.map +1 -0
- package/dist/index-new.js +7 -0
- package/dist/index-new.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -172
- package/dist/index.js.map +1 -1
- package/dist/landing-page-viewer/src/ui/landing-page-viewer.html +330 -0
- package/dist/services/gemini/export.d.ts +5 -0
- package/dist/services/gemini/export.d.ts.map +1 -0
- package/dist/services/gemini/export.js +5 -0
- package/dist/services/gemini/export.js.map +1 -0
- package/dist/services/gemini/image-service.d.ts +45 -0
- package/dist/services/gemini/image-service.d.ts.map +1 -0
- package/dist/services/gemini/image-service.js +248 -0
- package/dist/services/gemini/image-service.js.map +1 -0
- package/dist/services/gemini/index.d.ts +7 -2
- package/dist/services/gemini/index.d.ts.map +1 -1
- package/dist/services/gemini/index.js +132 -56
- package/dist/services/gemini/index.js.map +1 -1
- package/dist/services/gemini/types.d.ts +32 -0
- package/dist/services/gemini/types.d.ts.map +1 -1
- package/dist/services/gemini/video-service.d.ts +58 -0
- package/dist/services/gemini/video-service.d.ts.map +1 -0
- package/dist/services/gemini/video-service.js +325 -0
- package/dist/services/gemini/video-service.js.map +1 -0
- package/dist/services/media-server.d.ts +28 -0
- package/dist/services/media-server.d.ts.map +1 -0
- package/dist/services/media-server.js +195 -0
- package/dist/services/media-server.js.map +1 -0
- package/dist/svg-viewer/src/ui/svg-viewer.html +325 -0
- package/dist/tools/gemini-chat.d.ts.map +1 -1
- package/dist/tools/gemini-chat.js +7 -1
- package/dist/tools/gemini-chat.js.map +1 -1
- package/dist/tools/gemini-deep-research.d.ts +1 -2
- package/dist/tools/gemini-deep-research.d.ts.map +1 -1
- package/dist/tools/gemini-deep-research.js +11 -51
- package/dist/tools/gemini-deep-research.js.map +1 -1
- package/dist/tools/gemini-help.d.ts +3 -0
- package/dist/tools/gemini-help.d.ts.map +1 -0
- package/dist/tools/gemini-help.js +534 -0
- package/dist/tools/gemini-help.js.map +1 -0
- package/dist/tools/gemini-prompt-assistant.d.ts +20 -0
- package/dist/tools/gemini-prompt-assistant.d.ts.map +1 -0
- package/dist/tools/gemini-prompt-assistant.js +129 -0
- package/dist/tools/gemini-prompt-assistant.js.map +1 -0
- package/dist/tools/generate-landing-page.d.ts +15 -0
- package/dist/tools/generate-landing-page.d.ts.map +1 -0
- package/dist/tools/generate-landing-page.js +66 -0
- package/dist/tools/generate-landing-page.js.map +1 -0
- package/dist/tools/generate-svg.d.ts +14 -0
- package/dist/tools/generate-svg.d.ts.map +1 -0
- package/dist/tools/generate-svg.js +106 -0
- package/dist/tools/generate-svg.js.map +1 -0
- package/dist/tools/generate-video.d.ts +24 -0
- package/dist/tools/generate-video.d.ts.map +1 -0
- package/dist/tools/generate-video.js +163 -0
- package/dist/tools/generate-video.js.map +1 -0
- package/dist/tools/image-prompt-assistant.d.ts +3 -0
- package/dist/tools/image-prompt-assistant.d.ts.map +1 -0
- package/dist/tools/image-prompt-assistant.js +790 -0
- package/dist/tools/image-prompt-assistant.js.map +1 -0
- package/dist/tools/load-image-from-path.d.ts +11 -0
- package/dist/tools/load-image-from-path.d.ts.map +1 -0
- package/dist/tools/load-image-from-path.js +100 -0
- package/dist/tools/load-image-from-path.js.map +1 -0
- package/dist/tools/prompt-library/charts.d.ts +325 -0
- package/dist/tools/prompt-library/charts.d.ts.map +1 -0
- package/dist/tools/prompt-library/charts.js +384 -0
- package/dist/tools/prompt-library/charts.js.map +1 -0
- package/dist/tools/prompt-library/index.d.ts +8 -0
- package/dist/tools/prompt-library/index.d.ts.map +1 -0
- package/dist/tools/prompt-library/index.js +10 -0
- package/dist/tools/prompt-library/index.js.map +1 -0
- package/dist/tools/register-analyze-image.d.ts +3 -0
- package/dist/tools/register-analyze-image.d.ts.map +1 -0
- package/dist/tools/register-analyze-image.js +67 -0
- package/dist/tools/register-analyze-image.js.map +1 -0
- package/dist/tools/register-chat.d.ts +3 -0
- package/dist/tools/register-chat.d.ts.map +1 -0
- package/dist/tools/register-chat.js +71 -0
- package/dist/tools/register-chat.js.map +1 -0
- package/dist/tools/register-deep-research.d.ts +3 -0
- package/dist/tools/register-deep-research.d.ts.map +1 -0
- package/dist/tools/register-deep-research.js +59 -0
- package/dist/tools/register-deep-research.js.map +1 -0
- package/dist/tools/register-describe-image.d.ts +3 -0
- package/dist/tools/register-describe-image.d.ts.map +1 -0
- package/dist/tools/register-describe-image.js +59 -0
- package/dist/tools/register-describe-image.js.map +1 -0
- package/dist/tools/register-image-gen.d.ts +3 -0
- package/dist/tools/register-image-gen.d.ts.map +1 -0
- package/dist/tools/register-image-gen.js +235 -0
- package/dist/tools/register-image-gen.js.map +1 -0
- package/dist/tools/register-landing-page.d.ts +3 -0
- package/dist/tools/register-landing-page.d.ts.map +1 -0
- package/dist/tools/register-landing-page.js +79 -0
- package/dist/tools/register-landing-page.js.map +1 -0
- package/dist/tools/register-list-models.d.ts +3 -0
- package/dist/tools/register-list-models.d.ts.map +1 -0
- package/dist/tools/register-list-models.js +33 -0
- package/dist/tools/register-list-models.js.map +1 -0
- package/dist/tools/register-load-image.d.ts +3 -0
- package/dist/tools/register-load-image.d.ts.map +1 -0
- package/dist/tools/register-load-image.js +66 -0
- package/dist/tools/register-load-image.js.map +1 -0
- package/dist/tools/register-svg.d.ts +3 -0
- package/dist/tools/register-svg.d.ts.map +1 -0
- package/dist/tools/register-svg.js +84 -0
- package/dist/tools/register-svg.js.map +1 -0
- package/dist/tools/register-video.d.ts +3 -0
- package/dist/tools/register-video.d.ts.map +1 -0
- package/dist/tools/register-video.js +118 -0
- package/dist/tools/register-video.js.map +1 -0
- package/dist/tools/register-viewers.d.ts +8 -0
- package/dist/tools/register-viewers.d.ts.map +1 -0
- package/dist/tools/register-viewers.js +89 -0
- package/dist/tools/register-viewers.js.map +1 -0
- package/dist/tools/schemas.d.ts +33 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +39 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools/types.d.ts +12 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/dist/tools/types.js +2 -0
- package/dist/tools/types.js.map +1 -0
- package/dist/ui/image-viewer.d.ts +2 -0
- package/dist/ui/image-viewer.d.ts.map +1 -0
- package/dist/ui/image-viewer.js +42 -0
- package/dist/ui/image-viewer.js.map +1 -0
- package/dist/utils/chart-design-system.d.ts +92 -0
- package/dist/utils/chart-design-system.d.ts.map +1 -0
- package/dist/utils/chart-design-system.js +235 -0
- package/dist/utils/chart-design-system.js.map +1 -0
- package/dist/utils/image-compress.d.ts +9 -0
- package/dist/utils/image-compress.d.ts.map +1 -0
- package/dist/utils/image-compress.js +43 -0
- package/dist/utils/image-compress.js.map +1 -0
- package/dist/utils/image-utils.d.ts +9 -0
- package/dist/utils/image-utils.d.ts.map +1 -0
- package/dist/utils/image-utils.js +257 -0
- package/dist/utils/image-utils.js.map +1 -0
- package/dist/utils/resolve-images.d.ts +29 -0
- package/dist/utils/resolve-images.d.ts.map +1 -0
- package/dist/utils/resolve-images.js +56 -0
- package/dist/utils/resolve-images.js.map +1 -0
- package/dist/utils/tool-wrapper.d.ts +13 -0
- package/dist/utils/tool-wrapper.d.ts.map +1 -0
- package/dist/utils/tool-wrapper.js +22 -0
- package/dist/utils/tool-wrapper.js.map +1 -0
- package/dist/utils/video-utils.d.ts +16 -0
- package/dist/utils/video-utils.d.ts.map +1 -0
- package/dist/utils/video-utils.js +319 -0
- package/dist/utils/video-utils.js.map +1 -0
- package/dist/video-viewer/src/ui/video-viewer.html +310 -0
- package/package.json +21 -7
- package/server.json +30 -29
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
import { enhanceChartPrompt, getChartColorPalette, validateChartPrompt } from './prompt-library/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Build the guide text for the "template" request type.
|
|
5
|
+
*/
|
|
6
|
+
function templateGuide(use_case) {
|
|
7
|
+
let useCaseBlock = '';
|
|
8
|
+
if (use_case === 'portrait') {
|
|
9
|
+
useCaseBlock = `
|
|
10
|
+
### Portrait Photography Template
|
|
11
|
+
|
|
12
|
+
**Structure:**
|
|
13
|
+
"[Shot type] portrait of [subject description], [location/environment], lighting is [lighting type], shot on [camera/film], [aperture], [color grade]"
|
|
14
|
+
|
|
15
|
+
**Example:**
|
|
16
|
+
"A close-up portrait of an elderly fisherman with a weathered face and thick grey beard, wearing a yellow raincoat. Standing on a rainy dock in Norway. Lighting is soft overcast diffused light. Shot on Kodak Portra 400, 85mm lens, f/1.8 aperture for blurry ocean background. Desaturated with cool blue tones."
|
|
17
|
+
|
|
18
|
+
**Key Variables:**
|
|
19
|
+
• **Shot Types:** Close-up, medium, wide, extreme close-up, environmental
|
|
20
|
+
• **Lighting:** Golden hour, rim lighting, chiaroscuro, soft diffused, dramatic
|
|
21
|
+
• **Lenses:** 50mm (natural), 85mm (flattering), 100mm (compressed)
|
|
22
|
+
• **Aperture:** f/1.2-2.8 (bokeh), f/5.6-8 (balanced), f/11+ (sharp background)
|
|
23
|
+
• **Film Stock:** Kodak Portra 400 (warm skin), Fuji Pro 400H (cool), Ilford HP5 (B&W)
|
|
24
|
+
|
|
25
|
+
**Common Mistakes to Avoid:**
|
|
26
|
+
✗ "Beautiful person" → ✓ "Person with defined cheekbones and expressive eyes"
|
|
27
|
+
✗ "Good lighting" → ✓ "Soft window light from camera left creating gentle shadows"
|
|
28
|
+
✗ "Professional photo" → ✓ "Shot on medium format digital, 80mm lens, f/2.8"
|
|
29
|
+
`;
|
|
30
|
+
}
|
|
31
|
+
else if (use_case === 'product') {
|
|
32
|
+
useCaseBlock = `
|
|
33
|
+
### Product Photography Template
|
|
34
|
+
|
|
35
|
+
**Structure:**
|
|
36
|
+
"[Product] placed on [surface], surrounded by [props], lighting is [studio setup], [camera angle], [resolution focus]"
|
|
37
|
+
|
|
38
|
+
**Example:**
|
|
39
|
+
"A luxury perfume bottle made of amber glass placed on rough dark slate rock. Surrounded by splashes of water and white jasmine flowers. Lighting is dramatic rim lighting to highlight glass contours, with soft fill light from front. Macro photography, f/2.8, extremely sharp focus on brand label, 8k resolution textures."
|
|
40
|
+
|
|
41
|
+
**Key Variables:**
|
|
42
|
+
• **Surfaces:** Slate, marble, wood grain, brushed metal, white seamless
|
|
43
|
+
• **Props:** Seasonal elements, brand-relevant items, texture contrast
|
|
44
|
+
• **Lighting:** Rim (outline), backlighting (glow), soft diffused (flattering)
|
|
45
|
+
• **Angles:** 45° (dynamic), straight-on (editorial), overhead flat lay
|
|
46
|
+
• **Focus:** Macro (extreme detail), selective focus (depth), full sharp
|
|
47
|
+
|
|
48
|
+
**Composition Rules:**
|
|
49
|
+
• Rule of thirds for dynamic placement
|
|
50
|
+
• Negative space for luxury/minimalism
|
|
51
|
+
• Depth layers (foreground, product, background)
|
|
52
|
+
• Color harmony (complementary or analogous)
|
|
53
|
+
`;
|
|
54
|
+
}
|
|
55
|
+
else if (use_case === 'cinematic') {
|
|
56
|
+
useCaseBlock = `
|
|
57
|
+
### Cinematic Concept Art Template
|
|
58
|
+
|
|
59
|
+
**Structure:**
|
|
60
|
+
"[View type] of [environment] featuring [key element], style is [art style], lighting is [atmospheric], [color palette], [render engine]"
|
|
61
|
+
|
|
62
|
+
**Example:**
|
|
63
|
+
"Wide establishing shot of futuristic cyberpunk favela built vertically into massive canyon. Neon signs in Japanese illuminate fog. Lone cyborg figure on ledge in foreground looking down. Cinematic concept art, matte painting style. Volumetric blue and pink neon mixed with deep shadows. Unreal Engine 5 render, hyper-detailed, dystopian atmosphere."
|
|
64
|
+
|
|
65
|
+
**Key Variables:**
|
|
66
|
+
• **Views:** Establishing wide, dramatic low angle, hero shot, aerial
|
|
67
|
+
• **Atmosphere:** Volumetric fog, god rays, dust particles, haze
|
|
68
|
+
• **Time:** Golden hour, blue hour, midday harsh, night illuminated
|
|
69
|
+
• **Color Theory:** Teal/orange (blockbuster), monochrome, desaturated, neon
|
|
70
|
+
• **Render:** Unreal Engine 5, Octane, Blender Cycles, photorealistic
|
|
71
|
+
|
|
72
|
+
**Mood Keywords:**
|
|
73
|
+
• Epic: "Towering," "vast," "monumental," "awe-inspiring"
|
|
74
|
+
• Dystopian: "Gritty," "abandoned," "decay," "harsh lighting"
|
|
75
|
+
• Fantasy: "Ethereal," "magical," "mysterious," "enchanted"
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
if (!use_case) {
|
|
79
|
+
useCaseBlock = `
|
|
80
|
+
### Universal Template (All Use Cases)
|
|
81
|
+
|
|
82
|
+
**Basic Structure:**
|
|
83
|
+
"[Medium] showing [subject] [action] in [environment], [lighting description], [technical camera specs], [style/aesthetic]"
|
|
84
|
+
|
|
85
|
+
**Example Breakdown:**
|
|
86
|
+
|
|
87
|
+
1. **Medium:** Photography, oil painting, 3D render, watercolor, vector art
|
|
88
|
+
2. **Subject:** Be specific - age, clothing texture, expression
|
|
89
|
+
3. **Action:** Active verbs - "sipping," "gazing," "running through"
|
|
90
|
+
4. **Environment:** Specific location with texture details
|
|
91
|
+
5. **Lighting:** See lighting_guide for full options
|
|
92
|
+
6. **Technical:** Camera, lens, aperture, film stock
|
|
93
|
+
7. **Style:** Film noir, cyberpunk, minimalist, vintage
|
|
94
|
+
|
|
95
|
+
**Quick Reference:**
|
|
96
|
+
• More words = More control (but diminishing returns after ~75 words)
|
|
97
|
+
• Natural sentences > keyword lists
|
|
98
|
+
• Specific nouns > vague adjectives
|
|
99
|
+
• Technical terms signal photorealism intent
|
|
100
|
+
`;
|
|
101
|
+
}
|
|
102
|
+
return `# Image Generation Template Builder
|
|
103
|
+
|
|
104
|
+
${use_case ? `## Specialized Template: ${use_case.toUpperCase()}` : '## Universal Template Structure'}
|
|
105
|
+
|
|
106
|
+
**Framework:** [Medium] + [Subject/Action] + [Environment] + [Lighting] + [Camera/Technical] + [Style/Aesthetic]
|
|
107
|
+
|
|
108
|
+
${useCaseBlock}
|
|
109
|
+
|
|
110
|
+
**Next Steps:**
|
|
111
|
+
• Use \`gemini_prompt_assistant request_type="lighting_guide"\` for lighting options
|
|
112
|
+
• Use \`gemini_prompt_assistant request_type="optimize_prompt"\` with your draft
|
|
113
|
+
• Use \`gemini_prompt_assistant request_type="troubleshoot"\` if results aren't matching`;
|
|
114
|
+
}
|
|
115
|
+
const LIGHTING_GUIDE = `# Comprehensive Lighting Guide
|
|
116
|
+
|
|
117
|
+
## Decision Tree: Choose Lighting by Mood
|
|
118
|
+
|
|
119
|
+
**DRAMATIC/INTENSE** → Chiaroscuro, rim lighting, harsh directional
|
|
120
|
+
**ROMANTIC/WARM** → Golden hour, soft diffused, candlelight
|
|
121
|
+
**MYSTERIOUS/MOODY** → Low-key, volumetric fog, blue hour
|
|
122
|
+
**PROFESSIONAL/CLEAN** → Softbox studio, even lighting, no shadows
|
|
123
|
+
**EPIC/CINEMATIC** → God rays, volumetric, backlighting
|
|
124
|
+
|
|
125
|
+
## Complete Lighting Techniques
|
|
126
|
+
|
|
127
|
+
### Golden Hour
|
|
128
|
+
**Effect:** Warm, soft, low-angle sun, long shadows, romantic glow
|
|
129
|
+
**Best For:** Portraits, travel, outdoor scenes
|
|
130
|
+
**Keywords:** "Golden hour sunlight," "warm glow," "soft directional light"
|
|
131
|
+
**Technical:** Color temp 3000-4000K, shoot 1hr before sunset/after sunrise
|
|
132
|
+
|
|
133
|
+
### Blue Hour
|
|
134
|
+
**Effect:** Cool twilight, melancholic, serene, deep blue sky
|
|
135
|
+
**Best For:** Cityscapes, moody atmospheric shots
|
|
136
|
+
**Keywords:** "Blue hour twilight," "cool ambient light," "dusk atmosphere"
|
|
137
|
+
|
|
138
|
+
### Chiaroscuro (High Contrast)
|
|
139
|
+
**Effect:** Dramatic light/dark contrast, Renaissance painting style
|
|
140
|
+
**Best For:** Film noir, dramatic portraits, mystery
|
|
141
|
+
**Keywords:** "Chiaroscuro lighting," "high contrast shadows," "dramatic light"
|
|
142
|
+
|
|
143
|
+
### Rim Lighting (Backlit)
|
|
144
|
+
**Effect:** Light outline around subject, separates from background
|
|
145
|
+
**Best For:** Hero shots, silhouettes, atmospheric separation
|
|
146
|
+
**Keywords:** "Rim lit," "backlit," "edge lighting," "halo effect"
|
|
147
|
+
|
|
148
|
+
### Volumetric / God Rays
|
|
149
|
+
**Effect:** Visible light beams through fog/dust/smoke
|
|
150
|
+
**Best For:** Epic fantasy, forests, atmospheric drama
|
|
151
|
+
**Keywords:** "Volumetric lighting," "god rays," "light shafts," "beams cutting through mist"
|
|
152
|
+
|
|
153
|
+
### Softbox / Diffused Studio
|
|
154
|
+
**Effect:** Even, shadowless, flattering, professional
|
|
155
|
+
**Best For:** Headshots, beauty, product photography
|
|
156
|
+
**Keywords:** "Soft diffused studio lighting," "even illumination," "no harsh shadows"
|
|
157
|
+
|
|
158
|
+
### Hard / Harsh Light
|
|
159
|
+
**Effect:** Sharp shadows, high contrast, edgy
|
|
160
|
+
**Best For:** Fashion, street photography, graphic looks
|
|
161
|
+
**Keywords:** "Harsh direct sunlight," "hard shadows," "high noon light"
|
|
162
|
+
|
|
163
|
+
### Practical Lighting (In-Scene Sources)
|
|
164
|
+
**Effect:** Light from objects in frame (lamps, neon, screens)
|
|
165
|
+
**Best For:** Cinematic narrative, moody interiors
|
|
166
|
+
**Keywords:** "Lit by neon signs," "practical lamp lighting," "ambient screen glow"
|
|
167
|
+
|
|
168
|
+
### Candlelight / Warm Interior
|
|
169
|
+
**Effect:** Intimate, flickering, warm yellow glow
|
|
170
|
+
**Best For:** Romantic scenes, cozy atmosphere
|
|
171
|
+
**Keywords:** "Candlelit," "warm flickering light," "soft amber glow"
|
|
172
|
+
|
|
173
|
+
## Combination Techniques
|
|
174
|
+
|
|
175
|
+
**Three-Point Lighting (Studio Standard):**
|
|
176
|
+
"Studio three-point lighting with key light from camera left, fill light from right at half intensity, and rim light from behind"
|
|
177
|
+
|
|
178
|
+
**Natural + Fill:**
|
|
179
|
+
"Natural window light from left with subtle fill reflector to soften shadows"
|
|
180
|
+
|
|
181
|
+
**Mixed Temperatures:**
|
|
182
|
+
"Warm tungsten interior lights contrasting with cool blue exterior daylight through windows"
|
|
183
|
+
|
|
184
|
+
## Common Mistakes
|
|
185
|
+
|
|
186
|
+
✗ "Good lighting" → Too vague
|
|
187
|
+
✓ "Soft overhead diffused light creating gentle shadows under cheekbones"
|
|
188
|
+
|
|
189
|
+
✗ "Dramatic" → Subjective
|
|
190
|
+
✓ "Chiaroscuro lighting with single hard source from camera right"
|
|
191
|
+
|
|
192
|
+
✗ Conflicting lights → "Silhouette with front lighting"
|
|
193
|
+
✓ Pick one primary source direction`;
|
|
194
|
+
const COLOR_GUIDE = `# Color Grading & Palette Guide
|
|
195
|
+
|
|
196
|
+
## Color Theory for AI Generation
|
|
197
|
+
|
|
198
|
+
### Popular Film Color Grades
|
|
199
|
+
|
|
200
|
+
**Teal and Orange (Hollywood Blockbuster)**
|
|
201
|
+
• Effect: Warm skin tones pop against cool backgrounds
|
|
202
|
+
• Use: Action, commercial, modern cinematic
|
|
203
|
+
• Keywords: "Teal and orange color grade," "orange skin tones with cyan background"
|
|
204
|
+
|
|
205
|
+
**Monochromatic**
|
|
206
|
+
• Effect: Variations of single hue, artistic unity
|
|
207
|
+
• Use: Conceptual art, editorial, moody pieces
|
|
208
|
+
• Keywords: "Monochromatic crimson palette," "variations of deep blue"
|
|
209
|
+
|
|
210
|
+
**Pastel / High-Key**
|
|
211
|
+
• Effect: Light, airy, low contrast, desaturated
|
|
212
|
+
• Use: Wes Anderson style, dreamy, vintage
|
|
213
|
+
• Keywords: "Pastel color palette," "high-key lighting," "soft muted tones"
|
|
214
|
+
|
|
215
|
+
**Desaturated / Muted**
|
|
216
|
+
• Effect: Gritty, realistic, subdued
|
|
217
|
+
• Use: War photography, documentary, somber moods
|
|
218
|
+
• Keywords: "Desaturated colors," "muted palette," "low saturation"
|
|
219
|
+
|
|
220
|
+
**Neon / Synthwave**
|
|
221
|
+
• Effect: High saturation purples, pinks, cyans
|
|
222
|
+
• Use: Cyberpunk, 80s retro, vaporwave
|
|
223
|
+
• Keywords: "Neon synthwave colors," "vibrant purple and cyan," "electric pink glow"
|
|
224
|
+
|
|
225
|
+
**Kodachrome Vintage**
|
|
226
|
+
• Effect: Rich reds and yellows, high contrast
|
|
227
|
+
• Use: 1950s-70s nostalgic look
|
|
228
|
+
• Keywords: "Kodachrome film colors," "vintage high contrast," "rich warm tones"
|
|
229
|
+
|
|
230
|
+
**Bleach Bypass**
|
|
231
|
+
• Effect: Reduced saturation, high contrast, gritty
|
|
232
|
+
• Use: Action, thriller, intense drama
|
|
233
|
+
• Keywords: "Bleach bypass look," "high contrast desaturated"
|
|
234
|
+
|
|
235
|
+
**Sepia / Vintage B&W Tones**
|
|
236
|
+
• Effect: Warm brown tones, historical feel
|
|
237
|
+
• Use: Nostalgia, historical, timeless
|
|
238
|
+
• Keywords: "Sepia tone," "warm vintage brown wash"
|
|
239
|
+
|
|
240
|
+
## Color Harmony Approaches
|
|
241
|
+
|
|
242
|
+
**Complementary** (Opposite on color wheel)
|
|
243
|
+
• Blue/Orange, Red/Green, Purple/Yellow
|
|
244
|
+
• Creates visual tension and balance
|
|
245
|
+
|
|
246
|
+
**Analogous** (Adjacent on wheel)
|
|
247
|
+
• Blue/Green/Teal, Red/Orange/Yellow
|
|
248
|
+
• Harmonious and soothing
|
|
249
|
+
|
|
250
|
+
**Triadic** (Three equally spaced)
|
|
251
|
+
• Red/Yellow/Blue, Purple/Orange/Green
|
|
252
|
+
• Vibrant but balanced
|
|
253
|
+
|
|
254
|
+
## Temperature Control
|
|
255
|
+
|
|
256
|
+
**Warm Palette:** Oranges, yellows, reds → Cozy, energetic, passionate
|
|
257
|
+
**Cool Palette:** Blues, greens, purples → Calm, professional, melancholic
|
|
258
|
+
**Neutral:** Greys, browns, beiges → Timeless, sophisticated, minimal
|
|
259
|
+
|
|
260
|
+
## Practical Examples
|
|
261
|
+
|
|
262
|
+
**Commercial Product:**
|
|
263
|
+
"Clean white background with subtle warm highlights, high-key exposure, minimal color grading"
|
|
264
|
+
|
|
265
|
+
**Film Noir:**
|
|
266
|
+
"Deep blacks and bright whites, high contrast black and white, dramatic shadows"
|
|
267
|
+
|
|
268
|
+
**Cyberpunk Scene:**
|
|
269
|
+
"Neon pink and electric cyan color grading with deep shadows, high saturation, teal and magenta split toning"
|
|
270
|
+
|
|
271
|
+
**Natural Documentary:**
|
|
272
|
+
"Neutral color temperature, accurate skin tones, slight contrast boost, no stylized grading"`;
|
|
273
|
+
const LENS_GUIDE = `# Camera Lens & Technical Specifications Guide
|
|
274
|
+
|
|
275
|
+
## Focal Length Decision Tree
|
|
276
|
+
|
|
277
|
+
**Want EXPANSIVE view with CONTEXT** → 16-35mm (wide angle)
|
|
278
|
+
**Want NATURAL human perspective** → 40-50mm (standard)
|
|
279
|
+
**Want FLATTERING portraits** → 85-135mm (portrait)
|
|
280
|
+
**Want COMPRESSED backgrounds** → 200mm+ (telephoto)
|
|
281
|
+
|
|
282
|
+
## Complete Focal Length Guide
|
|
283
|
+
|
|
284
|
+
### Ultra-Wide (16-24mm)
|
|
285
|
+
**Effect:** Expansive view, slight barrel distortion, exaggerated depth
|
|
286
|
+
**Best For:** Landscapes, architecture, dynamic action
|
|
287
|
+
**Keywords:** "Shot on 16mm ultra-wide lens," "expansive field of view"
|
|
288
|
+
**Characteristics:** Makes foreground huge, background tiny
|
|
289
|
+
|
|
290
|
+
### Wide Angle (28-35mm)
|
|
291
|
+
**Effect:** Broad view, natural slight distortion, documentary feel
|
|
292
|
+
**Best For:** Environmental portraits, street, reportage
|
|
293
|
+
**Keywords:** "35mm documentary lens," "wide environmental context"
|
|
294
|
+
**Characteristics:** Less distortion than ultra-wide but still spacious
|
|
295
|
+
|
|
296
|
+
### Standard (40-50mm)
|
|
297
|
+
**Effect:** Natural human eye perspective, no distortion
|
|
298
|
+
**Best For:** General photography, authentic representation
|
|
299
|
+
**Keywords:** "Shot on 50mm standard lens," "natural perspective"
|
|
300
|
+
**Characteristics:** "What you see is what you get"
|
|
301
|
+
|
|
302
|
+
### Portrait (85-100mm)
|
|
303
|
+
**Effect:** Flattering facial compression, beautiful bokeh
|
|
304
|
+
**Best For:** Headshots, beauty, character portraits
|
|
305
|
+
**Keywords:** "85mm portrait lens," "flattering facial compression"
|
|
306
|
+
**Characteristics:** Industry standard for portraits
|
|
307
|
+
|
|
308
|
+
### Telephoto (135-200mm)
|
|
309
|
+
**Effect:** Strong background compression, shallow DOF
|
|
310
|
+
**Best For:** Isolated subjects, wildlife, sports
|
|
311
|
+
**Keywords:** "200mm telephoto," "compressed background"
|
|
312
|
+
**Characteristics:** Makes background appear closer and larger
|
|
313
|
+
|
|
314
|
+
### Super Telephoto (300mm+)
|
|
315
|
+
**Effect:** Extreme compression, very shallow DOF, isolating
|
|
316
|
+
**Best For:** Wildlife, sports, distant subjects
|
|
317
|
+
**Keywords:** "600mm super telephoto," "extreme background blur"
|
|
318
|
+
|
|
319
|
+
## Aperture Guide (f-stop)
|
|
320
|
+
|
|
321
|
+
### Wide Open (f/1.2 - f/2.8)
|
|
322
|
+
**Effect:** Extremely shallow depth of field, creamy bokeh, low light capability
|
|
323
|
+
**Use:** Portraits, subject isolation, bokeh backgrounds
|
|
324
|
+
**Keywords:** "f/1.2 aperture," "shallow depth of field," "bokeh background"
|
|
325
|
+
|
|
326
|
+
### Medium (f/4 - f/5.6)
|
|
327
|
+
**Effect:** Moderate DOF, good sharpness, balanced
|
|
328
|
+
**Use:** General photography, lifestyle, travel
|
|
329
|
+
**Keywords:** "f/4 aperture," "balanced depth of field"
|
|
330
|
+
|
|
331
|
+
### Narrow (f/8 - f/16)
|
|
332
|
+
**Effect:** Deep depth of field, everything sharp, landscape mode
|
|
333
|
+
**Use:** Landscapes, architecture, group photos
|
|
334
|
+
**Keywords:** "f/11 aperture," "deep focus," "sharp throughout"
|
|
335
|
+
|
|
336
|
+
## Angle & Perspective
|
|
337
|
+
|
|
338
|
+
**Eye Level:** Neutral, relatable, documentary
|
|
339
|
+
**Low Angle:** Subject appears powerful, dominant, heroic
|
|
340
|
+
**High Angle:** Subject appears vulnerable, small, submissive
|
|
341
|
+
**Bird's Eye:** Overhead, pattern-revealing, graphic
|
|
342
|
+
**Dutch Angle:** Tilted horizon, creates tension, disorientation
|
|
343
|
+
|
|
344
|
+
## Film Emulation Types
|
|
345
|
+
|
|
346
|
+
**Kodak Portra 400:** Gold standard for portraits, excellent skin, fine grain, warm
|
|
347
|
+
**Fujifilm Velvia 50:** High saturation, high contrast, landscapes
|
|
348
|
+
**Ilford HP5 Plus:** Classic B&W, gritty grain, journalism look
|
|
349
|
+
**CineStill 800T:** Tungsten balanced, distinct "halation" glow around lights
|
|
350
|
+
**Polaroid SX-70:** Soft focus, vintage borders, washed colors
|
|
351
|
+
|
|
352
|
+
## Example Combinations
|
|
353
|
+
|
|
354
|
+
**Cinematic Portrait:**
|
|
355
|
+
"Shot on 85mm lens, f/1.4 aperture creating shallow depth of field with creamy bokeh, Kodak Portra 400 film emulation"
|
|
356
|
+
|
|
357
|
+
**Epic Landscape:**
|
|
358
|
+
"Captured on 24mm wide-angle lens, f/11 aperture for front-to-back sharpness, Fujifilm Velvia 50 film stock"
|
|
359
|
+
|
|
360
|
+
**Street Photography:**
|
|
361
|
+
"Shot on 35mm lens at f/5.6, Ilford HP5 Plus black and white film, natural perspective"`;
|
|
362
|
+
const STYLE_GUIDE = `# Style & Aesthetic Reference Guide
|
|
363
|
+
|
|
364
|
+
## Major Aesthetic Categories
|
|
365
|
+
|
|
366
|
+
### Film Noir (1940s-50s)
|
|
367
|
+
**Visual DNA:** High contrast B&W, dramatic shadows, chiaroscuro, cigarette smoke
|
|
368
|
+
**Lighting:** Hard single source, venetian blind shadows, rain-wet streets
|
|
369
|
+
**Keywords:** "Film noir aesthetic," "1940s detective style," "high contrast black and white"
|
|
370
|
+
**Mood:** Mystery, danger, sophistication
|
|
371
|
+
|
|
372
|
+
### Cyberpunk / Neon Noir
|
|
373
|
+
**Visual DNA:** Neon pink/cyan, wet reflective streets, high-tech low-life, rain
|
|
374
|
+
**Lighting:** Practical neon signs, volumetric fog, colored gels
|
|
375
|
+
**Keywords:** "Cyberpunk aesthetic," "neon-soaked streets," "dystopian future"
|
|
376
|
+
**Mood:** Tech dystopia, noir updated for 2050
|
|
377
|
+
|
|
378
|
+
### Vintage Americana (1950s-70s)
|
|
379
|
+
**Visual DNA:** Kodachrome colors, diners, vintage cars, optimistic
|
|
380
|
+
**Lighting:** Bright, saturated, sunny, nostalgic
|
|
381
|
+
**Keywords:** "1960s Kodachrome aesthetic," "vintage Americana," "mid-century modern"
|
|
382
|
+
**Mood:** Nostalgia, innocence, golden age
|
|
383
|
+
|
|
384
|
+
### Minimalist / Scandinavian
|
|
385
|
+
**Visual DNA:** Clean lines, negative space, neutral palette, functional beauty
|
|
386
|
+
**Lighting:** Even, soft, natural window light
|
|
387
|
+
**Keywords:** "Minimalist composition," "Scandinavian design," "clean simple aesthetic"
|
|
388
|
+
**Mood:** Calm, sophisticated, timeless
|
|
389
|
+
|
|
390
|
+
### Wes Anderson Symmetry
|
|
391
|
+
**Visual DNA:** Perfect symmetry, pastel palette, quirky details, flat frontal compositions
|
|
392
|
+
**Lighting:** Even, soft, pastel-colored
|
|
393
|
+
**Keywords:** "Wes Anderson style," "perfectly symmetrical composition," "pastel color palette"
|
|
394
|
+
**Mood:** Whimsical, nostalgic, meticulous
|
|
395
|
+
|
|
396
|
+
### Moody Editorial
|
|
397
|
+
**Visual DNA:** Desaturated, dramatic lighting, fashion-forward, artistic
|
|
398
|
+
**Lighting:** Dramatic single source, shadows emphasized
|
|
399
|
+
**Keywords:** "Editorial fashion lighting," "moody desaturated tones," "artistic composition"
|
|
400
|
+
**Mood:** Sophisticated, high-fashion, artistic
|
|
401
|
+
|
|
402
|
+
### Natural Documentary
|
|
403
|
+
**Visual DNA:** Candid, authentic, unposed, real moments
|
|
404
|
+
**Lighting:** Available light, no styling, pure observation
|
|
405
|
+
**Keywords:** "Documentary photography," "candid moment," "natural light"
|
|
406
|
+
**Mood:** Authentic, truthful, unmanipulated
|
|
407
|
+
|
|
408
|
+
### Surreal / Dreamlike
|
|
409
|
+
**Visual DNA:** Impossible scenarios, ethereal, soft focus, floating elements
|
|
410
|
+
**Lighting:** Soft diffused, magical hour, otherworldly
|
|
411
|
+
**Keywords:** "Surreal dreamlike atmosphere," "ethereal quality," "magical realism"
|
|
412
|
+
**Mood:** Fantasy, subconscious, impossible
|
|
413
|
+
|
|
414
|
+
### Gritty Realism
|
|
415
|
+
**Visual DNA:** Desaturated, high grain, harsh reality, unflinching
|
|
416
|
+
**Lighting:** Harsh natural light, no flattery, documentary style
|
|
417
|
+
**Keywords:** "Gritty realistic aesthetic," "high film grain," "raw unfiltered"
|
|
418
|
+
**Mood:** Truth, hardship, reality
|
|
419
|
+
|
|
420
|
+
## Combining Styles
|
|
421
|
+
|
|
422
|
+
You can mix aesthetics for unique results:
|
|
423
|
+
|
|
424
|
+
**"Cyberpunk + Wes Anderson":**
|
|
425
|
+
"Symmetrical composition of a neon-lit futuristic street in pastel pink and mint green, perfectly centered character, whimsical retrofuturism"
|
|
426
|
+
|
|
427
|
+
**"Film Noir + Colorized":**
|
|
428
|
+
"1940s detective aesthetic with dramatic chiaroscuro lighting but rendered in desaturated color with teal and orange tones"
|
|
429
|
+
|
|
430
|
+
**"Minimalist + Volumetric":**
|
|
431
|
+
"Clean Scandinavian interior with single subject, but dramatic god rays cutting through window creating volumetric atmosphere"`;
|
|
432
|
+
function optimizePromptGuide(current_prompt) {
|
|
433
|
+
if (!current_prompt) {
|
|
434
|
+
return `## How to Use Prompt Optimization
|
|
435
|
+
|
|
436
|
+
**Include your current prompt:**
|
|
437
|
+
\`\`\`
|
|
438
|
+
gemini_prompt_assistant(
|
|
439
|
+
request_type="optimize_prompt",
|
|
440
|
+
current_prompt="Your current image prompt here",
|
|
441
|
+
desired_outcome="What you're trying to achieve"
|
|
442
|
+
)
|
|
443
|
+
\`\`\`
|
|
444
|
+
|
|
445
|
+
**I will analyze and provide:**
|
|
446
|
+
• Structural improvements
|
|
447
|
+
• Specificity suggestions
|
|
448
|
+
• Technical additions
|
|
449
|
+
• Enhanced rewritten version
|
|
450
|
+
• Alternative approaches`;
|
|
451
|
+
}
|
|
452
|
+
const hasTechnical = /\b(f\/\d\.?\d?|mm\s|lens|aperture|lighting|shot on)\b/gi.test(current_prompt);
|
|
453
|
+
const isDetailed = current_prompt.length > 50;
|
|
454
|
+
const hasMood = /\b(cinematic|dramatic|moody|atmospheric)\b/gi.test(current_prompt);
|
|
455
|
+
const hasVague = /\b(beautiful|nice|good|amazing)\b/gi.test(current_prompt);
|
|
456
|
+
const noCamera = !/\b(f\/\d|mm|aperture)\b/gi.test(current_prompt);
|
|
457
|
+
const noLighting = !/\b(lighting|lit|illuminated|shadow)\b/gi.test(current_prompt);
|
|
458
|
+
return `## Your Current Prompt
|
|
459
|
+
\`\`\`
|
|
460
|
+
${current_prompt}
|
|
461
|
+
\`\`\`
|
|
462
|
+
|
|
463
|
+
## Analysis & Optimization
|
|
464
|
+
|
|
465
|
+
**Strengths Detected:**
|
|
466
|
+
${hasTechnical ? '✓ Contains technical camera specifications - good for photorealism' : '⚠ Missing technical specifications'}
|
|
467
|
+
${isDetailed ? '✓ Detailed prompt with good length' : '⚠ Prompt might be too brief for complex results'}
|
|
468
|
+
${hasMood ? '✓ Includes mood/aesthetic keywords' : '⚠ Could benefit from mood descriptors'}
|
|
469
|
+
|
|
470
|
+
**Optimization Suggestions:**
|
|
471
|
+
|
|
472
|
+
1. **Structure:** Convert to framework format:
|
|
473
|
+
- Medium/Format (what kind of image)
|
|
474
|
+
- Subject + Action (who/what doing what)
|
|
475
|
+
- Environment (where)
|
|
476
|
+
- Lighting (how lit)
|
|
477
|
+
- Technical (camera/lens)
|
|
478
|
+
- Style (aesthetic mood)
|
|
479
|
+
|
|
480
|
+
2. **Specificity Upgrades:**
|
|
481
|
+
${hasVague ? ' • Replace vague adjectives ("beautiful") with specific descriptors' : ''}
|
|
482
|
+
${noCamera ? ' • Add camera specs: lens focal length, aperture value' : ''}
|
|
483
|
+
${noLighting ? ' • Specify lighting type and direction' : ''}
|
|
484
|
+
|
|
485
|
+
3. **Enhanced Version:**
|
|
486
|
+
\`\`\`
|
|
487
|
+
[I can provide an optimized version - would you like me to rewrite it?]
|
|
488
|
+
\`\`\`
|
|
489
|
+
|
|
490
|
+
4. **Alternative Approaches:**
|
|
491
|
+
• If aiming for photorealism → Add film stock, camera model
|
|
492
|
+
• If aiming for illustration → Specify art medium, artist style
|
|
493
|
+
• If aiming for cinematic → Add color grade, aspect ratio
|
|
494
|
+
|
|
495
|
+
**Next Steps:**
|
|
496
|
+
• Use \`gemini_prompt_assistant request_type="template"\` for structure
|
|
497
|
+
• Use \`desired_outcome="[specific goal]"\` for targeted improvements`;
|
|
498
|
+
}
|
|
499
|
+
function troubleshootGuide(current_prompt, desired_outcome) {
|
|
500
|
+
if (!current_prompt || !desired_outcome) {
|
|
501
|
+
return `## How to Use Troubleshooting
|
|
502
|
+
|
|
503
|
+
**Describe what's going wrong:**
|
|
504
|
+
\`\`\`
|
|
505
|
+
gemini_prompt_assistant(
|
|
506
|
+
request_type="troubleshoot",
|
|
507
|
+
current_prompt="Your prompt that's not working",
|
|
508
|
+
desired_outcome="What you want instead"
|
|
509
|
+
)
|
|
510
|
+
\`\`\`
|
|
511
|
+
|
|
512
|
+
**I will diagnose and suggest:**
|
|
513
|
+
• Root cause of the problem
|
|
514
|
+
• Specific prompt modifications
|
|
515
|
+
• Alternative approaches
|
|
516
|
+
• Test variations to try`;
|
|
517
|
+
}
|
|
518
|
+
return `## Analyzing Your Issue
|
|
519
|
+
|
|
520
|
+
**Your Prompt:** ${current_prompt}
|
|
521
|
+
**Desired Outcome:** ${desired_outcome}
|
|
522
|
+
|
|
523
|
+
## Common Problems & Solutions
|
|
524
|
+
|
|
525
|
+
**PROBLEM: Hands look distorted or have wrong number of fingers**
|
|
526
|
+
• Solution: Keep hands in simple, visible poses
|
|
527
|
+
• Avoid: Intertwined fingers, hidden hands, complex gestures
|
|
528
|
+
• Try: "Hands resting naturally at sides" or "Single hand visible holding object"
|
|
529
|
+
|
|
530
|
+
**PROBLEM: Face doesn't look realistic**
|
|
531
|
+
• Solution: Add specific facial feature details
|
|
532
|
+
• Avoid: Generic "beautiful face"
|
|
533
|
+
• Try: "Defined cheekbones, expressive brown eyes, subtle smile lines"
|
|
534
|
+
|
|
535
|
+
**PROBLEM: Lighting looks flat or wrong**
|
|
536
|
+
• Solution: Specify light source direction and quality
|
|
537
|
+
• Avoid: "Good lighting" or "well-lit"
|
|
538
|
+
• Try: "Soft window light from camera left creating gentle shadows on right side of face"
|
|
539
|
+
|
|
540
|
+
**PROBLEM: Colors look oversaturated or wrong**
|
|
541
|
+
• Solution: Specify color grade or film stock
|
|
542
|
+
• Avoid: "Vibrant colors" without context
|
|
543
|
+
• Try: "Muted desaturated palette" or "Kodak Portra 400 natural skin tones"
|
|
544
|
+
|
|
545
|
+
**PROBLEM: Composition is boring or generic**
|
|
546
|
+
• Solution: Specify angle, framing, rule of thirds
|
|
547
|
+
• Avoid: "Take a photo of"
|
|
548
|
+
• Try: "Low angle shot looking up at subject, rule of thirds composition"
|
|
549
|
+
|
|
550
|
+
**PROBLEM: Background is distracting or wrong**
|
|
551
|
+
• Solution: Control depth of field and background description
|
|
552
|
+
• Avoid: Not mentioning background
|
|
553
|
+
• Try: "Shot at f/1.8 creating blurry bokeh background" or "Against seamless white background"
|
|
554
|
+
|
|
555
|
+
**PROBLEM: Style is inconsistent or unexpected**
|
|
556
|
+
• Solution: Pick ONE clear style reference
|
|
557
|
+
• Avoid: Mixing too many styles
|
|
558
|
+
• Try: Choose either "film noir" OR "pastel Wes Anderson" not both
|
|
559
|
+
|
|
560
|
+
**PROBLEM: Text in image has typos or errors**
|
|
561
|
+
• Solution: Keep text short, use simple fonts, specify clearly
|
|
562
|
+
• Avoid: Long paragraphs of text
|
|
563
|
+
• Try: "Sign with text: 'OPEN' in bold red letters"
|
|
564
|
+
|
|
565
|
+
**PROBLEM: Getting illustration when you want photo**
|
|
566
|
+
• Solution: Add photorealistic keywords and camera specs
|
|
567
|
+
• Avoid: Art style keywords
|
|
568
|
+
• Try: "Hyper-realistic photography, shot on 85mm lens, Canon 5D"
|
|
569
|
+
|
|
570
|
+
**PROBLEM: Getting photo when you want illustration**
|
|
571
|
+
• Solution: Remove camera specs, add art medium
|
|
572
|
+
• Avoid: Technical photo terms
|
|
573
|
+
• Try: "Oil painting on canvas" or "Digital illustration, Procreate style"
|
|
574
|
+
|
|
575
|
+
## Your Specific Recommendations:
|
|
576
|
+
|
|
577
|
+
[Based on your inputs, I would provide targeted advice here]`;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Handle chart-specific request types using the prompt library.
|
|
581
|
+
*/
|
|
582
|
+
function handleChartRequest(request_type, current_prompt, color_scheme, chart_type, emphasis) {
|
|
583
|
+
if (request_type === 'chart_design') {
|
|
584
|
+
const basePrompt = current_prompt || 'Professional data visualization';
|
|
585
|
+
const enhanced = enhanceChartPrompt(basePrompt, {
|
|
586
|
+
colorScheme: (color_scheme || 'professional'),
|
|
587
|
+
chartType: (chart_type || 'bar'),
|
|
588
|
+
emphasis: (emphasis || 'data-ink')
|
|
589
|
+
});
|
|
590
|
+
return `# Enhanced Chart Design Prompt
|
|
591
|
+
|
|
592
|
+
${enhanced}
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
**USAGE:**
|
|
597
|
+
Pass the enhanced prompt above to \`generate_image\` with \`aspectRatio: "16:9"\`.
|
|
598
|
+
|
|
599
|
+
**CUSTOMISE:**
|
|
600
|
+
• \`color_scheme\`: professional, editorial, scientific, minimal, dark, storytelling, financial, terminal, modernist
|
|
601
|
+
• \`chart_type\`: line, bar, scatter, pie, area, heatmap, network, treemap
|
|
602
|
+
• \`emphasis\`: data-ink, storytelling, exploration, presentation`;
|
|
603
|
+
}
|
|
604
|
+
if (request_type === 'optimize_chart') {
|
|
605
|
+
if (!current_prompt) {
|
|
606
|
+
return `## How to Use Chart Optimization
|
|
607
|
+
|
|
608
|
+
Provide your current chart prompt:
|
|
609
|
+
\`\`\`
|
|
610
|
+
gemini_prompt_assistant(
|
|
611
|
+
request_type="optimize_chart",
|
|
612
|
+
current_prompt="Your chart generation prompt here",
|
|
613
|
+
color_scheme="storytelling"
|
|
614
|
+
)
|
|
615
|
+
\`\`\``;
|
|
616
|
+
}
|
|
617
|
+
const validation = validateChartPrompt(current_prompt);
|
|
618
|
+
const enhanced = enhanceChartPrompt(current_prompt, {
|
|
619
|
+
colorScheme: (color_scheme || 'professional'),
|
|
620
|
+
chartType: (chart_type || 'bar'),
|
|
621
|
+
emphasis: (emphasis || 'data-ink')
|
|
622
|
+
});
|
|
623
|
+
let response = `# Chart Prompt Optimization
|
|
624
|
+
|
|
625
|
+
**Original Prompt:**
|
|
626
|
+
${current_prompt}
|
|
627
|
+
|
|
628
|
+
`;
|
|
629
|
+
if (validation.warnings.length > 0) {
|
|
630
|
+
response += `**Warnings:**\n`;
|
|
631
|
+
validation.warnings.forEach(w => response += `• ${w}\n`);
|
|
632
|
+
response += `\n`;
|
|
633
|
+
}
|
|
634
|
+
if (validation.suggestions.length > 0) {
|
|
635
|
+
response += `**Suggestions:**\n`;
|
|
636
|
+
validation.suggestions.forEach(s => response += `• ${s}\n`);
|
|
637
|
+
response += `\n`;
|
|
638
|
+
}
|
|
639
|
+
response += `**Optimised Prompt:**\n${enhanced}`;
|
|
640
|
+
return response;
|
|
641
|
+
}
|
|
642
|
+
if (request_type === 'validate_chart') {
|
|
643
|
+
if (!current_prompt) {
|
|
644
|
+
return 'Error: current_prompt required for validation. Pass your chart generation prompt to check for anti-patterns.';
|
|
645
|
+
}
|
|
646
|
+
const validation = validateChartPrompt(current_prompt);
|
|
647
|
+
let response = `# Chart Prompt Validation
|
|
648
|
+
|
|
649
|
+
**Prompt:** ${current_prompt}
|
|
650
|
+
|
|
651
|
+
**Status:** ${validation.valid ? 'Looks good' : 'Issues found'}
|
|
652
|
+
|
|
653
|
+
`;
|
|
654
|
+
if (validation.warnings.length > 0) {
|
|
655
|
+
response += `\n**Warnings:**\n`;
|
|
656
|
+
validation.warnings.forEach(w => response += `• ${w}\n`);
|
|
657
|
+
}
|
|
658
|
+
if (validation.suggestions.length > 0) {
|
|
659
|
+
response += `\n**Suggestions:**\n`;
|
|
660
|
+
validation.suggestions.forEach(s => response += `• ${s}\n`);
|
|
661
|
+
}
|
|
662
|
+
return response;
|
|
663
|
+
}
|
|
664
|
+
if (request_type === 'get_palette') {
|
|
665
|
+
const scheme = (color_scheme || 'professional');
|
|
666
|
+
const palette = getChartColorPalette(scheme);
|
|
667
|
+
return `# ${(color_scheme || 'professional').charAt(0).toUpperCase() + (color_scheme || 'professional').slice(1)} Colour Palette
|
|
668
|
+
|
|
669
|
+
**Description:** ${palette.description}
|
|
670
|
+
|
|
671
|
+
**Primary Colours:**
|
|
672
|
+
${palette.primary.map((c) => `• ${c}`).join('\n')}
|
|
673
|
+
|
|
674
|
+
**Neutral Greys:**
|
|
675
|
+
${palette.neutral.map((c) => `• ${c}`).join('\n')}
|
|
676
|
+
|
|
677
|
+
**Accent Colours:**
|
|
678
|
+
${palette.accent.map((c) => `• ${c}`).join('\n')}
|
|
679
|
+
|
|
680
|
+
**Usage in Prompt:**
|
|
681
|
+
"Use ${color_scheme || 'professional'} colour palette: primary ${palette.primary.slice(0, 3).join(', ')}; neutral greys ${palette.neutral[0]} to ${palette.neutral[palette.neutral.length - 1]}"
|
|
682
|
+
|
|
683
|
+
**All Available Schemes:**
|
|
684
|
+
• professional — IBM Carbon, Tailwind-inspired
|
|
685
|
+
• editorial — FiveThirtyEight, Economist-inspired
|
|
686
|
+
• scientific — Nature, Science journal-inspired
|
|
687
|
+
• minimal — Edward Tufte data-ink approach
|
|
688
|
+
• dark — Observable, GitHub dark mode
|
|
689
|
+
• storytelling — Cole Nussbaumer Knaflic strategic highlighting
|
|
690
|
+
• financial — Financial Times editorial
|
|
691
|
+
• terminal — Bloomberg/Fintech high-density
|
|
692
|
+
• modernist — W.E.B. Du Bois bold geometric`;
|
|
693
|
+
}
|
|
694
|
+
return `Unknown chart request type: ${request_type}`;
|
|
695
|
+
}
|
|
696
|
+
export function registerPromptAssistant(server) {
|
|
697
|
+
server.registerTool('gemini_prompt_assistant', {
|
|
698
|
+
title: 'Image & Chart Prompt Assistant',
|
|
699
|
+
description: 'Get expert prompt templates and guidance for Gemini image generation. ' +
|
|
700
|
+
'Covers photography (portraits, products, cinematic), chart/diagram design ' +
|
|
701
|
+
'(9 professional design systems including FT, Bloomberg, Tufte, Du Bois), ' +
|
|
702
|
+
'lighting, colour grading, lens simulation, and style aesthetics. ' +
|
|
703
|
+
'For charts: use chart_design with a color_scheme to get a full professional design system prompt.',
|
|
704
|
+
inputSchema: {
|
|
705
|
+
request_type: z
|
|
706
|
+
.enum([
|
|
707
|
+
'template',
|
|
708
|
+
'lighting_guide',
|
|
709
|
+
'color_guide',
|
|
710
|
+
'lens_guide',
|
|
711
|
+
'style_guide',
|
|
712
|
+
'optimize_prompt',
|
|
713
|
+
'troubleshoot',
|
|
714
|
+
'chart_design',
|
|
715
|
+
'optimize_chart',
|
|
716
|
+
'validate_chart',
|
|
717
|
+
'get_palette',
|
|
718
|
+
])
|
|
719
|
+
.describe('Type of assistance needed'),
|
|
720
|
+
use_case: z
|
|
721
|
+
.enum([
|
|
722
|
+
'portrait',
|
|
723
|
+
'product',
|
|
724
|
+
'landscape',
|
|
725
|
+
'cinematic',
|
|
726
|
+
'editorial',
|
|
727
|
+
'abstract',
|
|
728
|
+
'architecture',
|
|
729
|
+
'food',
|
|
730
|
+
'fashion',
|
|
731
|
+
])
|
|
732
|
+
.optional()
|
|
733
|
+
.describe('Specific use case for template (photography request types)'),
|
|
734
|
+
current_prompt: z.string().optional().describe('Current prompt to optimize or troubleshoot'),
|
|
735
|
+
desired_outcome: z.string().optional().describe('Description of what you want to achieve'),
|
|
736
|
+
color_scheme: z
|
|
737
|
+
.enum([
|
|
738
|
+
'professional',
|
|
739
|
+
'editorial',
|
|
740
|
+
'scientific',
|
|
741
|
+
'minimal',
|
|
742
|
+
'dark',
|
|
743
|
+
'storytelling',
|
|
744
|
+
'financial',
|
|
745
|
+
'terminal',
|
|
746
|
+
'modernist',
|
|
747
|
+
])
|
|
748
|
+
.optional()
|
|
749
|
+
.describe('Chart colour scheme / design system (for chart_design, optimize_chart, get_palette)'),
|
|
750
|
+
chart_type: z
|
|
751
|
+
.enum(['line', 'bar', 'scatter', 'area', 'pie', 'network', 'heatmap', 'treemap'])
|
|
752
|
+
.optional()
|
|
753
|
+
.describe('Chart type for chart-specific guidelines'),
|
|
754
|
+
emphasis: z
|
|
755
|
+
.enum(['data-ink', 'storytelling', 'exploration', 'presentation'])
|
|
756
|
+
.optional()
|
|
757
|
+
.describe('Design emphasis / audience priority'),
|
|
758
|
+
},
|
|
759
|
+
}, async ({ request_type, use_case, current_prompt, desired_outcome, color_scheme, chart_type, emphasis }) => {
|
|
760
|
+
// Chart request types — route to prompt library
|
|
761
|
+
const chartTypes = ['chart_design', 'optimize_chart', 'validate_chart', 'get_palette'];
|
|
762
|
+
if (chartTypes.includes(request_type)) {
|
|
763
|
+
const content = handleChartRequest(request_type, current_prompt, color_scheme, chart_type, emphasis);
|
|
764
|
+
return { content: [{ type: 'text', text: content }] };
|
|
765
|
+
}
|
|
766
|
+
// Photography/image request types — existing static guides
|
|
767
|
+
const guides = {
|
|
768
|
+
template: templateGuide(use_case),
|
|
769
|
+
lighting_guide: LIGHTING_GUIDE,
|
|
770
|
+
color_guide: COLOR_GUIDE,
|
|
771
|
+
lens_guide: LENS_GUIDE,
|
|
772
|
+
style_guide: STYLE_GUIDE,
|
|
773
|
+
optimize_prompt: `# Prompt Optimization Analysis\n\n${optimizePromptGuide(current_prompt)}`,
|
|
774
|
+
troubleshoot: `# Troubleshooting Image Generation Issues\n\n${troubleshootGuide(current_prompt, desired_outcome)}`,
|
|
775
|
+
};
|
|
776
|
+
const content = guides[request_type];
|
|
777
|
+
if (!content) {
|
|
778
|
+
return {
|
|
779
|
+
content: [{
|
|
780
|
+
type: 'text',
|
|
781
|
+
text: `Unknown request type: ${request_type}\n\nAvailable:\n` +
|
|
782
|
+
`Photography: template, lighting_guide, color_guide, lens_guide, style_guide, optimize_prompt, troubleshoot\n` +
|
|
783
|
+
`Charts: chart_design, optimize_chart, validate_chart, get_palette`,
|
|
784
|
+
}],
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
return { content: [{ type: 'text', text: content }] };
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
//# sourceMappingURL=image-prompt-assistant.js.map
|