mcp-server-gemini 1.1.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/CHANGELOG.md +155 -0
- package/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/config/constants.js +71 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/models.js +121 -0
- package/dist/config/models.js.map +1 -0
- package/dist/enhanced-stdio-server.js +1164 -0
- package/dist/enhanced-stdio-server.js.map +1 -0
- package/dist/i18n.js +109 -0
- package/dist/i18n.js.map +1 -0
- package/dist/server.js +251 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/analyze-codebase.js +373 -0
- package/dist/tools/analyze-codebase.js.map +1 -0
- package/dist/tools/analyze-content.js +295 -0
- package/dist/tools/analyze-content.js.map +1 -0
- package/dist/tools/brainstorm.js +237 -0
- package/dist/tools/brainstorm.js.map +1 -0
- package/dist/tools/definitions.js +375 -0
- package/dist/tools/definitions.js.map +1 -0
- package/dist/tools/fix-ui.js +262 -0
- package/dist/tools/fix-ui.js.map +1 -0
- package/dist/tools/generate-ui.js +311 -0
- package/dist/tools/generate-ui.js.map +1 -0
- package/dist/tools/index.js +17 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/list-models.js +30 -0
- package/dist/tools/list-models.js.map +1 -0
- package/dist/tools/multimodal-query.js +83 -0
- package/dist/tools/multimodal-query.js.map +1 -0
- package/dist/tools/search.js +94 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/error-handler.js +69 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/file-reader.js +470 -0
- package/dist/utils/file-reader.js.map +1 -0
- package/dist/utils/gemini-client.js +184 -0
- package/dist/utils/gemini-client.js.map +1 -0
- package/dist/utils/security.js +370 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/utils/validators.js +150 -0
- package/dist/utils/validators.js.map +1 -0
- package/dist/windows-utils.js +175 -0
- package/dist/windows-utils.js.map +1 -0
- package/package.json +69 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.1.0] - 2025-11-26
|
|
9
|
+
|
|
10
|
+
### 🚀 File System Access & Tool Enhancement
|
|
11
|
+
|
|
12
|
+
This version adds direct file system access to tools, eliminating the need to pass file contents as parameters.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **File System Access Module** (`src/utils/file-reader.ts`):
|
|
17
|
+
- `readFile()` - Read single file with language detection
|
|
18
|
+
- `readFiles()` - Batch read multiple files
|
|
19
|
+
- `readDirectory()` - Read entire directory with glob filtering
|
|
20
|
+
- Automatic binary file detection and exclusion
|
|
21
|
+
|
|
22
|
+
- **Security Module** (`src/utils/security.ts`):
|
|
23
|
+
- Path traversal attack prevention using `path.relative`
|
|
24
|
+
- Sensitive file protection (`.env`, `.ssh`, credentials, etc.)
|
|
25
|
+
- Directory whitelist validation
|
|
26
|
+
- Symlink detection
|
|
27
|
+
- File size and count limits
|
|
28
|
+
|
|
29
|
+
- **New Tool Parameters**:
|
|
30
|
+
- `analyze_codebase`: `directory`, `filePaths`, `include`, `exclude`
|
|
31
|
+
- `analyze_content`: `filePath` with auto language detection
|
|
32
|
+
- `generate_ui`: `techContext`, `configPath` for tech stack context
|
|
33
|
+
- `fix_ui_from_screenshot`: `sourceCodePath`, `relatedFiles`
|
|
34
|
+
- `brainstorm`: `contextFilePath`, `contextFiles` for project context
|
|
35
|
+
|
|
36
|
+
- **Structured Model Information** in `list_models`:
|
|
37
|
+
- `capabilities`: Detailed capability flags (vision, function calling, etc.)
|
|
38
|
+
- `useCases`: Recommended use cases in Chinese
|
|
39
|
+
- `recommendations`: Model recommendations by scenario
|
|
40
|
+
|
|
41
|
+
### Changed
|
|
42
|
+
|
|
43
|
+
- **Security Improvements**:
|
|
44
|
+
- Fixed directory whitelist bypass vulnerability (prefix matching issue)
|
|
45
|
+
- Fixed path traversal detection to allow legitimate filenames like `vendor..lib.js`
|
|
46
|
+
- Using `path.relative` for safer path validation
|
|
47
|
+
|
|
48
|
+
- All tools maintain **backward compatibility** with existing parameters
|
|
49
|
+
|
|
50
|
+
### Dependencies
|
|
51
|
+
|
|
52
|
+
- Added `micromatch` for glob pattern matching
|
|
53
|
+
- Added `fast-glob` for directory traversal
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## [1.0.1] - 2025-11-26
|
|
58
|
+
|
|
59
|
+
### 🎉 Major Rewrite - LKbaba Specialized Version
|
|
60
|
+
|
|
61
|
+
This version is a complete rewrite focused on **UI generation and frontend development**, designed to complement Claude Code.
|
|
62
|
+
|
|
63
|
+
### Added
|
|
64
|
+
|
|
65
|
+
- **8 Specialized Tools**:
|
|
66
|
+
- `gemini_generate_ui` - Generate UI components from description or design images
|
|
67
|
+
- `gemini_multimodal_query` - Analyze images with natural language queries
|
|
68
|
+
- `gemini_fix_ui_from_screenshot` - Diagnose and fix UI issues from screenshots
|
|
69
|
+
- `gemini_create_animation` - Create interactive animations (CSS/Canvas/WebGL/Three.js)
|
|
70
|
+
- `gemini_analyze_content` - Analyze code, documents, or data
|
|
71
|
+
- `gemini_analyze_codebase` - Analyze entire codebase using 1M token context
|
|
72
|
+
- `gemini_brainstorm` - Generate creative ideas with feasibility assessment
|
|
73
|
+
- `list_models` - List available Gemini models
|
|
74
|
+
|
|
75
|
+
- **4 Supported Models**:
|
|
76
|
+
- `gemini-3-pro-preview` (default) - Latest and most powerful for UI generation
|
|
77
|
+
- `gemini-2.5-pro` - Stable fallback option
|
|
78
|
+
- `gemini-2.5-flash` - Cost-effective for high-frequency tasks
|
|
79
|
+
- `gemini-2.5-flash-lite` - Maximum cost savings
|
|
80
|
+
|
|
81
|
+
- **Proxy Support** - Automatic proxy configuration for users behind VPN/proxy
|
|
82
|
+
- **File Path Support** - Image tools now accept file paths, automatically converted to Base64
|
|
83
|
+
- **Modular Architecture** - Clean separation of concerns with tools, utils, and config directories
|
|
84
|
+
|
|
85
|
+
### Changed
|
|
86
|
+
|
|
87
|
+
- Complete project restructure for better maintainability
|
|
88
|
+
- Updated to Gemini 3.0 Pro as default model
|
|
89
|
+
- Simplified from 6 generic tools to 8 specialized tools
|
|
90
|
+
- Improved error handling and validation
|
|
91
|
+
- Enhanced system prompts for better output quality
|
|
92
|
+
|
|
93
|
+
### Removed
|
|
94
|
+
|
|
95
|
+
- Legacy WebSocket implementation
|
|
96
|
+
- Generic text generation tool (replaced with specialized tools)
|
|
97
|
+
- Token counting tool (not needed for this use case)
|
|
98
|
+
- Embedding tool (not relevant for UI generation)
|
|
99
|
+
- Help system (simplified documentation)
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Previous Versions (Original Project)
|
|
104
|
+
|
|
105
|
+
The following versions are from the original [aliargun/mcp-server-gemini](https://github.com/aliargun/mcp-server-gemini) project.
|
|
106
|
+
|
|
107
|
+
## [4.2.2] - 2025-07-08
|
|
108
|
+
|
|
109
|
+
### Fixed
|
|
110
|
+
- Fixed image truncation issue by adding crlfDelay: Infinity to readline interface
|
|
111
|
+
- Added proper UTF-8 encoding for stdin to handle large Base64 data
|
|
112
|
+
|
|
113
|
+
## [4.2.1] - 2025-07-08
|
|
114
|
+
|
|
115
|
+
### Fixed
|
|
116
|
+
- Fixed conversation context role validation error
|
|
117
|
+
|
|
118
|
+
## [4.2.0] - 2025-07-08
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
- Cleaned up repository by removing legacy WebSocket implementation files
|
|
122
|
+
|
|
123
|
+
### Security
|
|
124
|
+
- Performed comprehensive security audit
|
|
125
|
+
|
|
126
|
+
## [4.1.0] - 2025-07-07
|
|
127
|
+
|
|
128
|
+
### Added
|
|
129
|
+
- Self-documenting `get_help` tool
|
|
130
|
+
- MCP resources for documentation access
|
|
131
|
+
|
|
132
|
+
## [4.0.0] - 2025-07-07
|
|
133
|
+
|
|
134
|
+
### Added
|
|
135
|
+
- Support for Gemini 2.5 series with thinking capabilities
|
|
136
|
+
- 5 powerful tools: generate_text, analyze_image, count_tokens, list_models, embed_text
|
|
137
|
+
- JSON mode, Google Search grounding, system instructions
|
|
138
|
+
|
|
139
|
+
### Changed
|
|
140
|
+
- Complete rewrite to use stdio-based MCP protocol
|
|
141
|
+
|
|
142
|
+
## [3.0.0] - 2025-07-07
|
|
143
|
+
|
|
144
|
+
### Changed
|
|
145
|
+
- Migrated from WebSocket to stdio-based communication
|
|
146
|
+
|
|
147
|
+
## [2.0.0] - 2025-07-07
|
|
148
|
+
|
|
149
|
+
### Changed
|
|
150
|
+
- Updated from deprecated @google/generative-ai to @google/genai SDK
|
|
151
|
+
|
|
152
|
+
## [1.0.0] - 2024-12-15
|
|
153
|
+
|
|
154
|
+
### Added
|
|
155
|
+
- Initial release with WebSocket-based MCP server
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Ali Argün
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Gemini MCP Server
|
|
2
|
+
|
|
3
|
+
> **Give Claude Code the power of Gemini 3.0**
|
|
4
|
+
|
|
5
|
+
An MCP server that connects Claude Code to Google's Gemini 3.0 Pro, unlocking capabilities that complement Claude's strengths.
|
|
6
|
+
|
|
7
|
+
## Why Gemini + Claude?
|
|
8
|
+
|
|
9
|
+
| Gemini's Strengths | Use Case |
|
|
10
|
+
|-------------------|----------|
|
|
11
|
+
| **1M Token Context** | Analyze entire codebases in one shot |
|
|
12
|
+
| **Google Search Grounding** | Get real-time documentation & latest info |
|
|
13
|
+
| **#1 UI Generation** | Design-to-code with pixel-perfect accuracy |
|
|
14
|
+
| **Multimodal Vision** | Understand screenshots, diagrams, designs |
|
|
15
|
+
|
|
16
|
+
> **Philosophy**: Claude is the commander, Gemini is the specialist.
|
|
17
|
+
|
|
18
|
+
## Quick Start
|
|
19
|
+
|
|
20
|
+
### 1. Get API Key
|
|
21
|
+
|
|
22
|
+
Visit [Google AI Studio](https://aistudio.google.com/apikey) and create an API key.
|
|
23
|
+
|
|
24
|
+
### 2. Configure Claude Code
|
|
25
|
+
|
|
26
|
+
Add to your MCP config file:
|
|
27
|
+
|
|
28
|
+
- **Mac**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
29
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
30
|
+
- **Linux**: `~/.config/Claude/claude_desktop_config.json`
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"mcpServers": {
|
|
35
|
+
"gemini": {
|
|
36
|
+
"command": "npx",
|
|
37
|
+
"args": ["-y", "github:LKbaba/Gemini-mcp"],
|
|
38
|
+
"env": {
|
|
39
|
+
"GEMINI_API_KEY": "your_api_key_here"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Restart Claude Code
|
|
47
|
+
|
|
48
|
+
## Tools (8)
|
|
49
|
+
|
|
50
|
+
### Research & Search
|
|
51
|
+
| Tool | Description |
|
|
52
|
+
|------|-------------|
|
|
53
|
+
| `gemini_search` | Web search with Google Search grounding. Get real-time info, latest docs, current events. |
|
|
54
|
+
|
|
55
|
+
### Analysis (1M Token Context)
|
|
56
|
+
| Tool | Description |
|
|
57
|
+
|------|-------------|
|
|
58
|
+
| `gemini_analyze_codebase` | Analyze entire projects with 1M token context. Supports directory path, file paths, or direct content. |
|
|
59
|
+
| `gemini_analyze_content` | Analyze code, documents, or data. Supports file path or direct content input. |
|
|
60
|
+
|
|
61
|
+
### UI & Visual
|
|
62
|
+
| Tool | Description |
|
|
63
|
+
|------|-------------|
|
|
64
|
+
| `gemini_generate_ui` | Generate UI components from description or design image. Supports React, Vue, Svelte, vanilla. |
|
|
65
|
+
| `gemini_fix_ui_from_screenshot` | Visual Debug Loop - diagnose UI issues from screenshots and output git diff patches. |
|
|
66
|
+
| `gemini_multimodal_query` | Analyze images with natural language. Understand designs, diagrams, screenshots. |
|
|
67
|
+
|
|
68
|
+
### Creative & Utility
|
|
69
|
+
| Tool | Description |
|
|
70
|
+
|------|-------------|
|
|
71
|
+
| `gemini_brainstorm` | Generate creative ideas with project context. Supports reading README, PRD files. |
|
|
72
|
+
| `list_models` | List available Gemini models with capabilities and context windows. |
|
|
73
|
+
|
|
74
|
+
## Usage Examples
|
|
75
|
+
|
|
76
|
+
### Analyze a Large Codebase
|
|
77
|
+
```
|
|
78
|
+
"Use Gemini to analyze the ./src directory for architectural patterns and potential issues"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Search for Latest Documentation
|
|
82
|
+
```
|
|
83
|
+
"Search for the latest Next.js 15 App Router documentation"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Design to Code
|
|
87
|
+
```
|
|
88
|
+
"Generate a pricing card component matching this Figma screenshot" (attach image)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Visual Debug Loop
|
|
92
|
+
```
|
|
93
|
+
"Fix the layout bug in this screenshot. Source file: ./src/components/Header.tsx" (attach screenshot)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Brainstorm with Context
|
|
97
|
+
```
|
|
98
|
+
"Brainstorm feature ideas based on this project's README.md"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Proxy Configuration
|
|
102
|
+
|
|
103
|
+
<details>
|
|
104
|
+
<summary>For users behind proxy/VPN</summary>
|
|
105
|
+
|
|
106
|
+
Add proxy environment variable to your config:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"gemini": {
|
|
112
|
+
"command": "npx",
|
|
113
|
+
"args": ["-y", "github:LKbaba/Gemini-mcp"],
|
|
114
|
+
"env": {
|
|
115
|
+
"GEMINI_API_KEY": "your_api_key_here",
|
|
116
|
+
"HTTPS_PROXY": "http://127.0.0.1:7897"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
## Supported Models
|
|
125
|
+
|
|
126
|
+
| Model | Context | Best For |
|
|
127
|
+
|-------|---------|----------|
|
|
128
|
+
| `gemini-3-pro-preview` | 1M tokens | UI generation, complex analysis (default) |
|
|
129
|
+
| `gemini-2.5-pro` | 1M tokens | General coding, fallback |
|
|
130
|
+
| `gemini-2.5-flash` | 1M tokens | Fast tasks, cost optimization |
|
|
131
|
+
|
|
132
|
+
## Local Development
|
|
133
|
+
|
|
134
|
+
<details>
|
|
135
|
+
<summary>Build from source</summary>
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
git clone https://github.com/LKbaba/Gemini-mcp.git
|
|
139
|
+
cd Gemini-mcp
|
|
140
|
+
npm install
|
|
141
|
+
npm run build
|
|
142
|
+
export GEMINI_API_KEY="your_api_key_here"
|
|
143
|
+
npm start
|
|
144
|
+
```
|
|
145
|
+
</details>
|
|
146
|
+
|
|
147
|
+
## Project Structure
|
|
148
|
+
|
|
149
|
+
```
|
|
150
|
+
src/
|
|
151
|
+
├── config/
|
|
152
|
+
│ ├── models.ts # Model configurations
|
|
153
|
+
│ └── constants.ts # Global constants
|
|
154
|
+
├── tools/
|
|
155
|
+
│ ├── definitions.ts # MCP tool definitions
|
|
156
|
+
│ ├── generate-ui.ts # UI generation
|
|
157
|
+
│ ├── multimodal-query.ts # Multimodal queries
|
|
158
|
+
│ ├── fix-ui.ts # Visual Debug Loop
|
|
159
|
+
│ ├── analyze-content.ts # Content analysis
|
|
160
|
+
│ ├── analyze-codebase.ts # Codebase analysis
|
|
161
|
+
│ ├── brainstorm.ts # Brainstorming
|
|
162
|
+
│ ├── search.ts # Web search
|
|
163
|
+
│ └── list-models.ts # Model listing
|
|
164
|
+
├── utils/
|
|
165
|
+
│ ├── gemini-client.ts # Gemini API client
|
|
166
|
+
│ ├── file-reader.ts # File system access
|
|
167
|
+
│ ├── security.ts # Path validation
|
|
168
|
+
│ ├── validators.ts # Parameter validation
|
|
169
|
+
│ └── error-handler.ts # Error handling
|
|
170
|
+
├── types.ts # Type definitions
|
|
171
|
+
└── server.ts # Main server
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Credits
|
|
175
|
+
|
|
176
|
+
Based on [aliargun/mcp-server-gemini](https://github.com/aliargun/mcp-server-gemini)
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
|
|
180
|
+
MIT
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global constant definitions
|
|
3
|
+
*/
|
|
4
|
+
// MCP protocol version
|
|
5
|
+
export const MCP_VERSION = '2024-11-05';
|
|
6
|
+
// Server information
|
|
7
|
+
export const SERVER_INFO = {
|
|
8
|
+
name: 'mcp-server-gemini',
|
|
9
|
+
version: '1.1.0',
|
|
10
|
+
description: 'Specialized MCP server for Gemini 3.0 Pro focused on UI generation and frontend development',
|
|
11
|
+
author: 'LKbaba',
|
|
12
|
+
basedOn: 'aliargun/mcp-server-gemini v4.2.2'
|
|
13
|
+
};
|
|
14
|
+
// API configuration
|
|
15
|
+
export const API_CONFIG = {
|
|
16
|
+
timeout: 60000, // 60 seconds
|
|
17
|
+
maxRetries: 3,
|
|
18
|
+
retryDelay: 1000, // 1 second
|
|
19
|
+
maxImageSize: 10 * 1024 * 1024, // 10MB
|
|
20
|
+
};
|
|
21
|
+
// Tool names
|
|
22
|
+
export const TOOL_NAMES = {
|
|
23
|
+
GENERATE_UI: 'gemini_generate_ui',
|
|
24
|
+
MULTIMODAL_QUERY: 'gemini_multimodal_query',
|
|
25
|
+
FIX_UI: 'gemini_fix_ui_from_screenshot',
|
|
26
|
+
// CREATE_ANIMATION removed - animation can be generated via generate_ui
|
|
27
|
+
ANALYZE_CONTENT: 'gemini_analyze_content',
|
|
28
|
+
ANALYZE_CODEBASE: 'gemini_analyze_codebase',
|
|
29
|
+
BRAINSTORM: 'gemini_brainstorm',
|
|
30
|
+
SEARCH: 'gemini_search',
|
|
31
|
+
LIST_MODELS: 'list_models'
|
|
32
|
+
};
|
|
33
|
+
// Error codes
|
|
34
|
+
export const ERROR_CODES = {
|
|
35
|
+
INVALID_REQUEST: -32600,
|
|
36
|
+
METHOD_NOT_FOUND: -32601,
|
|
37
|
+
INVALID_PARAMS: -32602,
|
|
38
|
+
INTERNAL_ERROR: -32603,
|
|
39
|
+
PARSE_ERROR: -32700,
|
|
40
|
+
API_ERROR: -32000,
|
|
41
|
+
TIMEOUT: -32001,
|
|
42
|
+
RATE_LIMIT: -32002,
|
|
43
|
+
MODEL_NOT_SUPPORTED: -32003
|
|
44
|
+
};
|
|
45
|
+
// Default parameters
|
|
46
|
+
export const DEFAULT_PARAMS = {
|
|
47
|
+
temperature: 0.7,
|
|
48
|
+
maxTokens: 8192,
|
|
49
|
+
topP: 0.95,
|
|
50
|
+
topK: 40
|
|
51
|
+
};
|
|
52
|
+
// Supported frameworks
|
|
53
|
+
export const FRAMEWORKS = ['vanilla', 'react', 'vue', 'svelte'];
|
|
54
|
+
// ANIMATION_TECHNOLOGIES removed - animation tool has been removed
|
|
55
|
+
// Supported styles
|
|
56
|
+
export const UI_STYLES = ['modern', 'minimal', 'glassmorphism', 'neumorphism'];
|
|
57
|
+
// Output formats
|
|
58
|
+
export const OUTPUT_FORMATS = ['text', 'code', 'json', 'markdown'];
|
|
59
|
+
// Content types
|
|
60
|
+
export const CONTENT_TYPES = ['code', 'document', 'data', 'auto'];
|
|
61
|
+
// Analysis task types
|
|
62
|
+
export const ANALYSIS_TASKS = ['summarize', 'review', 'explain', 'optimize', 'debug'];
|
|
63
|
+
// Codebase analysis focus areas
|
|
64
|
+
export const CODEBASE_FOCUS = ['architecture', 'security', 'performance', 'dependencies', 'patterns'];
|
|
65
|
+
// Brainstorm styles
|
|
66
|
+
export const BRAINSTORM_STYLES = ['innovative', 'practical', 'radical'];
|
|
67
|
+
// Feasibility levels
|
|
68
|
+
export const FEASIBILITY_LEVELS = ['low', 'medium', 'high'];
|
|
69
|
+
// Severity levels
|
|
70
|
+
export const SEVERITY_LEVELS = ['high', 'medium', 'low'];
|
|
71
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources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5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Supported Gemini model list
|
|
8
|
+
* Curated 3 models focused on UI generation and frontend development
|
|
9
|
+
*/
|
|
10
|
+
export const SUPPORTED_MODELS = {
|
|
11
|
+
'gemini-3-pro-preview': {
|
|
12
|
+
id: 'gemini-3-pro-preview',
|
|
13
|
+
name: 'Gemini 3.0 Pro Preview',
|
|
14
|
+
description: 'Latest and most powerful model, #1 on WebDev Arena for UI generation',
|
|
15
|
+
contextWindow: 1_048_576, // 1M tokens
|
|
16
|
+
outputLimit: 65_536,
|
|
17
|
+
capabilities: {
|
|
18
|
+
maxInputTokens: 1_048_576,
|
|
19
|
+
maxOutputTokens: 65_536,
|
|
20
|
+
supportsVision: true,
|
|
21
|
+
supportsFunctionCalling: true,
|
|
22
|
+
supportsStreaming: true,
|
|
23
|
+
supportsThinking: true,
|
|
24
|
+
supportsSystemInstructions: true
|
|
25
|
+
},
|
|
26
|
+
features: ['thinking', 'multimodal', 'function_calling', 'grounding', 'system_instructions'],
|
|
27
|
+
bestFor: ['UI generation', 'Frontend development', 'Design to code', 'Interactive animations', 'Complex reasoning'],
|
|
28
|
+
useCases: ['UI generation', 'Frontend development', 'Design to code', 'Interactive animations', 'Complex reasoning'],
|
|
29
|
+
thinking: true,
|
|
30
|
+
lastUpdate: 'January 2026',
|
|
31
|
+
isDefault: true
|
|
32
|
+
},
|
|
33
|
+
'gemini-3-flash-preview': {
|
|
34
|
+
id: 'gemini-3-flash-preview',
|
|
35
|
+
name: 'Gemini 3.0 Flash Preview',
|
|
36
|
+
description: 'Fast and efficient 3.0 model with excellent price/performance ratio',
|
|
37
|
+
contextWindow: 1_048_576, // 1M tokens
|
|
38
|
+
outputLimit: 65_536,
|
|
39
|
+
capabilities: {
|
|
40
|
+
maxInputTokens: 1_048_576,
|
|
41
|
+
maxOutputTokens: 65_536,
|
|
42
|
+
supportsVision: true,
|
|
43
|
+
supportsFunctionCalling: true,
|
|
44
|
+
supportsStreaming: true,
|
|
45
|
+
supportsThinking: true,
|
|
46
|
+
supportsSystemInstructions: true
|
|
47
|
+
},
|
|
48
|
+
features: ['thinking', 'multimodal', 'function_calling', 'grounding', 'system_instructions'],
|
|
49
|
+
bestFor: ['Quick Q&A', 'Real-time analysis', 'Batch processing', 'Cost optimization'],
|
|
50
|
+
useCases: ['Quick Q&A', 'Real-time analysis', 'Batch processing', 'Daily coding tasks'],
|
|
51
|
+
thinking: true,
|
|
52
|
+
lastUpdate: 'January 2026',
|
|
53
|
+
isDefault: false
|
|
54
|
+
},
|
|
55
|
+
'gemini-2.5-pro': {
|
|
56
|
+
id: 'gemini-2.5-pro',
|
|
57
|
+
name: 'Gemini 2.5 Pro',
|
|
58
|
+
description: 'Stable production model with excellent coding capabilities',
|
|
59
|
+
contextWindow: 1_048_576, // 1M tokens
|
|
60
|
+
outputLimit: 65_536,
|
|
61
|
+
capabilities: {
|
|
62
|
+
maxInputTokens: 1_048_576,
|
|
63
|
+
maxOutputTokens: 65_536,
|
|
64
|
+
supportsVision: true,
|
|
65
|
+
supportsFunctionCalling: true,
|
|
66
|
+
supportsStreaming: true,
|
|
67
|
+
supportsThinking: true,
|
|
68
|
+
supportsSystemInstructions: true
|
|
69
|
+
},
|
|
70
|
+
features: ['thinking', 'multimodal', 'function_calling', 'grounding', 'system_instructions'],
|
|
71
|
+
bestFor: ['General coding', 'Large codebase analysis', 'Fallback option'],
|
|
72
|
+
useCases: ['General coding', 'Large codebase analysis', 'Code review', 'Documentation generation'],
|
|
73
|
+
thinking: true,
|
|
74
|
+
lastUpdate: 'June 2025',
|
|
75
|
+
isDefault: false
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Get default model
|
|
80
|
+
*/
|
|
81
|
+
export function getDefaultModel() {
|
|
82
|
+
return SUPPORTED_MODELS['gemini-3-pro-preview'];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get model configuration
|
|
86
|
+
* @param modelId - Model ID
|
|
87
|
+
* @returns Model configuration, returns default model if not found
|
|
88
|
+
*/
|
|
89
|
+
export function getModelConfig(modelId) {
|
|
90
|
+
if (!modelId) {
|
|
91
|
+
return getDefaultModel();
|
|
92
|
+
}
|
|
93
|
+
return SUPPORTED_MODELS[modelId] || getDefaultModel();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Validate if model is supported
|
|
97
|
+
* @param modelId - Model ID
|
|
98
|
+
* @returns Whether the model is supported
|
|
99
|
+
*/
|
|
100
|
+
export function isModelSupported(modelId) {
|
|
101
|
+
return modelId in SUPPORTED_MODELS;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Get all supported models list
|
|
105
|
+
*/
|
|
106
|
+
export function getAllModels() {
|
|
107
|
+
return Object.values(SUPPORTED_MODELS);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Model selection recommendations
|
|
111
|
+
*/
|
|
112
|
+
export const MODEL_RECOMMENDATIONS = {
|
|
113
|
+
ui_generation: 'gemini-3-pro-preview',
|
|
114
|
+
animation: 'gemini-3-pro-preview',
|
|
115
|
+
multimodal: 'gemini-3-pro-preview',
|
|
116
|
+
codebase_analysis: 'gemini-2.5-pro',
|
|
117
|
+
batch_processing: 'gemini-3-flash-preview',
|
|
118
|
+
quick_tasks: 'gemini-3-flash-preview',
|
|
119
|
+
fallback: 'gemini-2.5-pro'
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/config/models.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmDH;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgC;IAC3D,sBAAsB,EAAE;QACtB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,sEAAsE;QACnF,aAAa,EAAE,SAAS,EAAE,YAAY;QACtC,WAAW,EAAE,MAA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