@tuannvm/gemini-mcp-server 1.0.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/LICENSE +25 -0
- package/README.md +381 -0
- package/dist/constants.d.ts +58 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +64 -0
- package/dist/constants.js.map +1 -0
- package/dist/errors.d.ts +24 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +57 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +19 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +166 -0
- package/dist/server.js.map +1 -0
- package/dist/tools/analyze-media.tool.d.ts +3 -0
- package/dist/tools/analyze-media.tool.d.ts.map +1 -0
- package/dist/tools/analyze-media.tool.js +102 -0
- package/dist/tools/analyze-media.tool.js.map +1 -0
- package/dist/tools/ask-gemini.tool.d.ts +3 -0
- package/dist/tools/ask-gemini.tool.d.ts.map +1 -0
- package/dist/tools/ask-gemini.tool.js +86 -0
- package/dist/tools/ask-gemini.tool.js.map +1 -0
- package/dist/tools/brainstorm.tool.d.ts +3 -0
- package/dist/tools/brainstorm.tool.d.ts.map +1 -0
- package/dist/tools/brainstorm.tool.js +220 -0
- package/dist/tools/brainstorm.tool.js.map +1 -0
- package/dist/tools/fetch-chunk.tool.d.ts +3 -0
- package/dist/tools/fetch-chunk.tool.d.ts.map +1 -0
- package/dist/tools/fetch-chunk.tool.js +85 -0
- package/dist/tools/fetch-chunk.tool.js.map +1 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +19 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registry.d.ts +26 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +74 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/search.tool.d.ts +3 -0
- package/dist/tools/search.tool.d.ts.map +1 -0
- package/dist/tools/search.tool.js +86 -0
- package/dist/tools/search.tool.js.map +1 -0
- package/dist/tools/shell.tool.d.ts +3 -0
- package/dist/tools/shell.tool.d.ts.map +1 -0
- package/dist/tools/shell.tool.js +106 -0
- package/dist/tools/shell.tool.js.map +1 -0
- package/dist/tools/simple-tools.d.ts +4 -0
- package/dist/tools/simple-tools.d.ts.map +1 -0
- package/dist/tools/simple-tools.js +48 -0
- package/dist/tools/simple-tools.js.map +1 -0
- package/dist/tools/test-tool.example.d.ts +13 -0
- package/dist/tools/test-tool.example.d.ts.map +1 -0
- package/dist/tools/test-tool.example.js +44 -0
- package/dist/tools/test-tool.example.js.map +1 -0
- package/dist/tools/timeout-test.tool.d.ts +3 -0
- package/dist/tools/timeout-test.tool.d.ts.map +1 -0
- package/dist/tools/timeout-test.tool.js +45 -0
- package/dist/tools/timeout-test.tool.js.map +1 -0
- package/dist/types.d.ts +43 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +22 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/changeModeChunker.d.ts +11 -0
- package/dist/utils/changeModeChunker.d.ts.map +1 -0
- package/dist/utils/changeModeChunker.js +95 -0
- package/dist/utils/changeModeChunker.js.map +1 -0
- package/dist/utils/changeModeParser.d.ts +15 -0
- package/dist/utils/changeModeParser.d.ts.map +1 -0
- package/dist/utils/changeModeParser.js +67 -0
- package/dist/utils/changeModeParser.js.map +1 -0
- package/dist/utils/changeModeTranslator.d.ts +8 -0
- package/dist/utils/changeModeTranslator.d.ts.map +1 -0
- package/dist/utils/changeModeTranslator.js +73 -0
- package/dist/utils/changeModeTranslator.js.map +1 -0
- package/dist/utils/chunkCache.d.ts +22 -0
- package/dist/utils/chunkCache.d.ts.map +1 -0
- package/dist/utils/chunkCache.js +163 -0
- package/dist/utils/chunkCache.js.map +1 -0
- package/dist/utils/commandExecutor.d.ts +2 -0
- package/dist/utils/commandExecutor.d.ts.map +1 -0
- package/dist/utils/commandExecutor.js +74 -0
- package/dist/utils/commandExecutor.js.map +1 -0
- package/dist/utils/geminiExecutor.d.ts +3 -0
- package/dist/utils/geminiExecutor.d.ts.map +1 -0
- package/dist/utils/geminiExecutor.js +182 -0
- package/dist/utils/geminiExecutor.js.map +1 -0
- package/dist/utils/logger.d.ts +13 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +42 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/timeoutManager.d.ts +1 -0
- package/dist/utils/timeoutManager.d.ts.map +1 -0
- package/dist/utils/timeoutManager.js +2 -0
- package/dist/utils/timeoutManager.js.map +1 -0
- package/package.json +68 -0
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini MCP Server implementation
|
|
3
|
+
*/
|
|
4
|
+
import { ServerConfig } from './types.js';
|
|
5
|
+
export declare class GeminiMcpServer {
|
|
6
|
+
private readonly server;
|
|
7
|
+
private readonly config;
|
|
8
|
+
private isProcessing;
|
|
9
|
+
private currentOperationName;
|
|
10
|
+
private latestOutput;
|
|
11
|
+
constructor(config: ServerConfig);
|
|
12
|
+
private setupHandlers;
|
|
13
|
+
private sendNotification;
|
|
14
|
+
private sendProgressNotification;
|
|
15
|
+
private startProgressUpdates;
|
|
16
|
+
private stopProgressUpdates;
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAcH,OAAO,EAAE,YAAY,EAAiB,MAAM,YAAY,CAAC;AAUzD,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,oBAAoB,CAAM;IAClC,OAAO,CAAC,YAAY,CAAM;gBAEd,MAAM,EAAE,YAAY;IAkBhC,OAAO,CAAC,aAAa;YA0EP,gBAAgB;YAQhB,wBAAwB;IAsBtC,OAAO,CAAC,oBAAoB;IA0C5B,OAAO,CAAC,mBAAmB;IAmBrB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAM7B"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gemini MCP Server implementation
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
6
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { Logger } from './utils/logger.js';
|
|
8
|
+
import { PROTOCOL } from './constants.js';
|
|
9
|
+
import { handleError } from './errors.js';
|
|
10
|
+
import { getToolDefinitions, getPromptDefinitions, executeTool, toolExists, getPromptMessage, } from './tools/index.js';
|
|
11
|
+
export class GeminiMcpServer {
|
|
12
|
+
server;
|
|
13
|
+
config;
|
|
14
|
+
isProcessing = false;
|
|
15
|
+
currentOperationName = '';
|
|
16
|
+
latestOutput = '';
|
|
17
|
+
constructor(config) {
|
|
18
|
+
this.config = config;
|
|
19
|
+
this.server = new Server({
|
|
20
|
+
name: config.name,
|
|
21
|
+
version: config.version,
|
|
22
|
+
}, {
|
|
23
|
+
capabilities: {
|
|
24
|
+
tools: {},
|
|
25
|
+
prompts: {},
|
|
26
|
+
logging: {},
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
this.setupHandlers();
|
|
30
|
+
}
|
|
31
|
+
setupHandlers() {
|
|
32
|
+
// tools/list
|
|
33
|
+
this.server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
34
|
+
return { tools: getToolDefinitions() };
|
|
35
|
+
});
|
|
36
|
+
// tools/call
|
|
37
|
+
this.server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
38
|
+
const toolName = request.params.name;
|
|
39
|
+
if (!toolExists(toolName)) {
|
|
40
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
41
|
+
}
|
|
42
|
+
const progressToken = request.params._meta?.progressToken;
|
|
43
|
+
const progressData = this.startProgressUpdates(toolName, progressToken);
|
|
44
|
+
try {
|
|
45
|
+
const args = request.params.arguments || {};
|
|
46
|
+
Logger.toolInvocation(toolName, request.params.arguments);
|
|
47
|
+
const result = await executeTool(toolName, args, (newOutput) => {
|
|
48
|
+
this.latestOutput = newOutput;
|
|
49
|
+
});
|
|
50
|
+
this.stopProgressUpdates(progressData, true);
|
|
51
|
+
return {
|
|
52
|
+
content: [{ type: 'text', text: result }],
|
|
53
|
+
isError: false,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
this.stopProgressUpdates(progressData, false);
|
|
58
|
+
Logger.error(`Error in tool '${toolName}':`, error);
|
|
59
|
+
const errorMessage = handleError(error, toolName);
|
|
60
|
+
return {
|
|
61
|
+
content: [{ type: 'text', text: errorMessage }],
|
|
62
|
+
isError: true,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
// prompts/list
|
|
67
|
+
this.server.setRequestHandler(ListPromptsRequestSchema, async () => {
|
|
68
|
+
return { prompts: getPromptDefinitions() };
|
|
69
|
+
});
|
|
70
|
+
// prompts/get
|
|
71
|
+
this.server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
72
|
+
const promptName = request.params.name;
|
|
73
|
+
const args = request.params.arguments || {};
|
|
74
|
+
const promptMessage = getPromptMessage(promptName, args);
|
|
75
|
+
if (!promptMessage) {
|
|
76
|
+
throw new Error(`Unknown prompt: ${promptName}`);
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
messages: [
|
|
80
|
+
{
|
|
81
|
+
role: 'user',
|
|
82
|
+
content: {
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: promptMessage,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
async sendNotification(method, params) {
|
|
92
|
+
try {
|
|
93
|
+
await this.server.notification({ method, params });
|
|
94
|
+
}
|
|
95
|
+
catch (error) {
|
|
96
|
+
Logger.error('Notification failed:', error);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async sendProgressNotification(progressToken, progress, total, message) {
|
|
100
|
+
if (!progressToken)
|
|
101
|
+
return;
|
|
102
|
+
try {
|
|
103
|
+
const params = { progressToken, progress };
|
|
104
|
+
if (total !== undefined)
|
|
105
|
+
params.total = total;
|
|
106
|
+
if (message)
|
|
107
|
+
params.message = message;
|
|
108
|
+
await this.server.notification({
|
|
109
|
+
method: PROTOCOL.NOTIFICATIONS.PROGRESS,
|
|
110
|
+
params,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
Logger.error('Failed to send progress notification:', error);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
startProgressUpdates(operationName, progressToken) {
|
|
118
|
+
this.isProcessing = true;
|
|
119
|
+
this.currentOperationName = operationName;
|
|
120
|
+
this.latestOutput = '';
|
|
121
|
+
const progressMessages = [
|
|
122
|
+
`Processing ${operationName} - Gemini is analyzing your request...`,
|
|
123
|
+
`Processing ${operationName} - Processing files and generating insights...`,
|
|
124
|
+
`Processing ${operationName} - Creating structured response...`,
|
|
125
|
+
`Processing ${operationName} - Large analysis in progress...`,
|
|
126
|
+
`Processing ${operationName} - Still working on quality results...`,
|
|
127
|
+
];
|
|
128
|
+
let messageIndex = 0;
|
|
129
|
+
let progress = 0;
|
|
130
|
+
if (progressToken) {
|
|
131
|
+
this.sendProgressNotification(progressToken, 0, undefined, `Starting ${operationName}`);
|
|
132
|
+
}
|
|
133
|
+
const progressInterval = setInterval(async () => {
|
|
134
|
+
if (this.isProcessing && progressToken) {
|
|
135
|
+
progress += 1;
|
|
136
|
+
const baseMessage = progressMessages[messageIndex % progressMessages.length];
|
|
137
|
+
const outputPreview = this.latestOutput.slice(-150).trim();
|
|
138
|
+
const message = outputPreview
|
|
139
|
+
? `${baseMessage}\nOutput: ...${outputPreview}`
|
|
140
|
+
: baseMessage;
|
|
141
|
+
await this.sendProgressNotification(progressToken, progress, undefined, message);
|
|
142
|
+
messageIndex++;
|
|
143
|
+
}
|
|
144
|
+
else if (!this.isProcessing) {
|
|
145
|
+
clearInterval(progressInterval);
|
|
146
|
+
}
|
|
147
|
+
}, PROTOCOL.KEEPALIVE_INTERVAL);
|
|
148
|
+
return { interval: progressInterval, progressToken };
|
|
149
|
+
}
|
|
150
|
+
stopProgressUpdates(progressData, success = true) {
|
|
151
|
+
const operationName = this.currentOperationName;
|
|
152
|
+
this.isProcessing = false;
|
|
153
|
+
this.currentOperationName = '';
|
|
154
|
+
clearInterval(progressData.interval);
|
|
155
|
+
if (progressData.progressToken) {
|
|
156
|
+
this.sendProgressNotification(progressData.progressToken, 100, 100, success ? `${operationName} completed successfully` : `${operationName} failed`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async start() {
|
|
160
|
+
Logger.debug(`Starting ${this.config.name} v${this.config.version}`);
|
|
161
|
+
const transport = new StdioServerTransport();
|
|
162
|
+
await this.server.connect(transport);
|
|
163
|
+
Logger.debug(`${this.config.name} listening on stdio`);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,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,oBAAoB,EAAE,CAAC;QAC7C,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,qBAAqB,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-media.tool.d.ts","sourceRoot":"","sources":["../../src/tools/analyze-media.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA0B5C,eAAO,MAAM,gBAAgB,EAAE,WAuG9B,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeCommand } from '../utils/commandExecutor.js';
|
|
3
|
+
import { CLI, MODELS, ERROR_MESSAGES, STATUS_MESSAGES } from '../constants.js';
|
|
4
|
+
import { Logger } from '../utils/logger.js';
|
|
5
|
+
const analyzeMediaArgsSchema = z.object({
|
|
6
|
+
filePath: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.describe('Path to the image or PDF file to analyze. Use @ syntax (e.g., @image.png, @document.pdf)'),
|
|
10
|
+
prompt: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.describe('What to analyze or extract from the media file'),
|
|
14
|
+
model: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Model to use (default: gemini-3-pro-preview for multimodal)'),
|
|
18
|
+
detailed: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.default(false)
|
|
21
|
+
.describe('Provide detailed analysis with more context'),
|
|
22
|
+
});
|
|
23
|
+
export const analyzeMediaTool = {
|
|
24
|
+
name: 'analyze-media',
|
|
25
|
+
description: 'Analyze images, PDFs, or other media files using Gemini multimodal capabilities. Supports screenshots, diagrams, documents, and more.',
|
|
26
|
+
zodSchema: analyzeMediaArgsSchema,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
filePath: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Path to the image or PDF file to analyze. Use @ syntax (e.g., @image.png, @document.pdf)',
|
|
33
|
+
},
|
|
34
|
+
prompt: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'What to analyze or extract from the media file',
|
|
37
|
+
},
|
|
38
|
+
model: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
description: 'Model to use (default: gemini-3-pro-preview for multimodal)',
|
|
41
|
+
},
|
|
42
|
+
detailed: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
default: false,
|
|
45
|
+
description: 'Provide detailed analysis with more context',
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
required: ['filePath', 'prompt'],
|
|
49
|
+
},
|
|
50
|
+
prompt: {
|
|
51
|
+
description: 'Analyze media files (images, PDFs) using Gemini multimodal AI',
|
|
52
|
+
},
|
|
53
|
+
category: 'gemini',
|
|
54
|
+
execute: async (args, onProgress) => {
|
|
55
|
+
const { filePath, prompt, model, detailed } = args;
|
|
56
|
+
if (!filePath?.toString().trim()) {
|
|
57
|
+
throw new Error('Please provide a file path to analyze');
|
|
58
|
+
}
|
|
59
|
+
if (!prompt?.toString().trim()) {
|
|
60
|
+
throw new Error('Please provide a prompt describing what to analyze');
|
|
61
|
+
}
|
|
62
|
+
// Ensure @ prefix for file reference
|
|
63
|
+
const fileRef = filePath.startsWith('@')
|
|
64
|
+
? filePath
|
|
65
|
+
: `@${filePath}`;
|
|
66
|
+
const analysisPrompt = detailed
|
|
67
|
+
? `Analyze this file in detail: ${fileRef}\n\nProvide a comprehensive analysis including:\n1. Overview/Summary\n2. Key elements and their significance\n3. Technical details (if applicable)\n4. Notable observations\n5. Recommendations or insights\n\nUser request: ${prompt}`
|
|
68
|
+
: `Analyze: ${fileRef}\n\n${prompt}`;
|
|
69
|
+
const cmdArgs = [];
|
|
70
|
+
// Use Gemini 3 Pro by default for better multimodal understanding
|
|
71
|
+
cmdArgs.push(CLI.FLAGS.MODEL, model || MODELS.PRO);
|
|
72
|
+
cmdArgs.push(CLI.FLAGS.PROMPT, analysisPrompt);
|
|
73
|
+
try {
|
|
74
|
+
Logger.debug(`Analyzing media: ${fileRef}`);
|
|
75
|
+
const result = await executeCommand(CLI.COMMANDS.GEMINI, cmdArgs, onProgress);
|
|
76
|
+
return `${STATUS_MESSAGES.GEMINI_RESPONSE}\n\n**File:** ${fileRef}\n\n${result}`;
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
80
|
+
// Fallback to flash if pro quota exceeded
|
|
81
|
+
if (errorMessage.includes(ERROR_MESSAGES.QUOTA_EXCEEDED) &&
|
|
82
|
+
model !== MODELS.FLASH) {
|
|
83
|
+
Logger.warn('Pro quota exceeded, trying Flash model...');
|
|
84
|
+
const fallbackArgs = [
|
|
85
|
+
CLI.FLAGS.MODEL,
|
|
86
|
+
MODELS.FLASH,
|
|
87
|
+
CLI.FLAGS.PROMPT,
|
|
88
|
+
analysisPrompt,
|
|
89
|
+
];
|
|
90
|
+
try {
|
|
91
|
+
const result = await executeCommand(CLI.COMMANDS.GEMINI, fallbackArgs, onProgress);
|
|
92
|
+
return `${STATUS_MESSAGES.GEMINI_RESPONSE} (using Flash model)\n\n**File:** ${fileRef}\n\n${result}`;
|
|
93
|
+
}
|
|
94
|
+
catch (fallbackError) {
|
|
95
|
+
throw new Error(`Media analysis failed: ${fallbackError instanceof Error ? fallbackError.message : String(fallbackError)}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
throw new Error(`Media analysis failed: ${errorMessage}`);
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=analyze-media.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-media.tool.js","sourceRoot":"","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sources":["../../src/tools/ask-gemini.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA0C5C,eAAO,MAAM,aAAa,EAAE,WAgF3B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeGeminiCLI, processChangeModeOutput, } from '../utils/geminiExecutor.js';
|
|
3
|
+
import { ERROR_MESSAGES, STATUS_MESSAGES } from '../constants.js';
|
|
4
|
+
const askGeminiArgsSchema = z.object({
|
|
5
|
+
prompt: z
|
|
6
|
+
.string()
|
|
7
|
+
.min(1)
|
|
8
|
+
.describe("Analysis request. Use @ syntax to include files (e.g., '@largefile.js explain what this does') or ask general questions"),
|
|
9
|
+
model: z
|
|
10
|
+
.string()
|
|
11
|
+
.optional()
|
|
12
|
+
.describe("Optional model to use (e.g., 'gemini-3-flash-preview'). If not specified, uses the default model (gemini-3-pro-preview)."),
|
|
13
|
+
sandbox: z
|
|
14
|
+
.boolean()
|
|
15
|
+
.default(false)
|
|
16
|
+
.describe('Use sandbox mode (-s flag) to safely test code changes, execute scripts, or run potentially risky operations in an isolated environment'),
|
|
17
|
+
changeMode: z
|
|
18
|
+
.boolean()
|
|
19
|
+
.default(false)
|
|
20
|
+
.describe('Enable structured change mode - formats prompts to prevent tool errors and returns structured edit suggestions that Claude can apply directly'),
|
|
21
|
+
chunkIndex: z
|
|
22
|
+
.union([z.number(), z.string()])
|
|
23
|
+
.optional()
|
|
24
|
+
.describe('Which chunk to return (1-based)'),
|
|
25
|
+
chunkCacheKey: z
|
|
26
|
+
.string()
|
|
27
|
+
.optional()
|
|
28
|
+
.describe('Optional cache key for continuation'),
|
|
29
|
+
});
|
|
30
|
+
export const askGeminiTool = {
|
|
31
|
+
name: 'gemini',
|
|
32
|
+
description: 'Query Gemini AI. Supports model selection, sandbox mode for safe code execution, and structured change mode for applying edits.',
|
|
33
|
+
zodSchema: askGeminiArgsSchema,
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: 'object',
|
|
36
|
+
properties: {
|
|
37
|
+
prompt: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
description: "Analysis request. Use @ syntax to include files (e.g., '@largefile.js explain what this does') or ask general questions",
|
|
40
|
+
},
|
|
41
|
+
model: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: "Optional model to use (e.g., 'gemini-3-flash-preview'). If not specified, uses the default model (gemini-3-pro-preview).",
|
|
44
|
+
},
|
|
45
|
+
sandbox: {
|
|
46
|
+
type: 'boolean',
|
|
47
|
+
default: false,
|
|
48
|
+
description: 'Use sandbox mode (-s flag) to safely test code changes, execute scripts, or run potentially risky operations in an isolated environment',
|
|
49
|
+
},
|
|
50
|
+
changeMode: {
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
default: false,
|
|
53
|
+
description: 'Enable structured change mode - formats prompts to prevent tool errors and returns structured edit suggestions that Claude can apply directly',
|
|
54
|
+
},
|
|
55
|
+
chunkIndex: {
|
|
56
|
+
type: ['number', 'string'],
|
|
57
|
+
description: 'Which chunk to return (1-based)',
|
|
58
|
+
},
|
|
59
|
+
chunkCacheKey: {
|
|
60
|
+
type: 'string',
|
|
61
|
+
description: 'Optional cache key for continuation',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
required: ['prompt'],
|
|
65
|
+
},
|
|
66
|
+
prompt: {
|
|
67
|
+
description: 'Query Gemini AI with optional sandbox execution and structured change mode.',
|
|
68
|
+
},
|
|
69
|
+
category: 'gemini',
|
|
70
|
+
execute: async (args, onProgress) => {
|
|
71
|
+
const { prompt, model, sandbox, changeMode, chunkIndex, chunkCacheKey } = args;
|
|
72
|
+
if (!prompt?.trim()) {
|
|
73
|
+
throw new Error(ERROR_MESSAGES.NO_PROMPT_PROVIDED);
|
|
74
|
+
}
|
|
75
|
+
if (changeMode && chunkIndex && chunkCacheKey) {
|
|
76
|
+
return processChangeModeOutput('', // empty for cache...
|
|
77
|
+
chunkIndex, chunkCacheKey, prompt);
|
|
78
|
+
}
|
|
79
|
+
const result = await executeGeminiCLI(prompt, model, !!sandbox, !!changeMode, onProgress);
|
|
80
|
+
if (changeMode) {
|
|
81
|
+
return processChangeModeOutput(result, args.chunkIndex, undefined, prompt);
|
|
82
|
+
}
|
|
83
|
+
return `${STATUS_MESSAGES.GEMINI_RESPONSE}\n${result}`; // changeMode false
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=ask-gemini.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ask-gemini.tool.js","sourceRoot":"","sources":["../../src/tools/ask-gemini.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,gBAAgB,EAChB,uBAAuB,GACxB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,yHAAyH,CAC1H;IACH,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,0HAA0H,CAC3H;IACH,OAAO,EAAE,CAAC;SACP,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,yIAAyI,CAC1I;IACH,UAAU,EAAE,CAAC;SACV,OAAO,EAAE;SACT,OAAO,CAAC,KAAK,CAAC;SACd,QAAQ,CACP,+IAA+I,CAChJ;IACH,UAAU,EAAE,CAAC;SACV,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;SAC/B,QAAQ,EAAE;SACV,QAAQ,CAAC,iCAAiC,CAAC;IAC9C,aAAa,EAAE,CAAC;S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AAa,EAAE,CAAC;YAC9C,OAAO,uBAAuB,CAC5B,EAAE,EAAE,qBAAqB;YACzB,UAAoB,EACpB,aAAuB,EACvB,MAAgB,CACjB,CAAC;QACJ,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,gBAAgB,CACnC,MAAgB,EAChB,KAA2B,EAC3B,CAAC,CAAC,OAAO,EACT,CAAC,CAAC,UAAU,EACZ,UAAU,CACX,CAAC;QAEF,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,uBAAuB,CAC5B,MAAM,EACN,IAAI,CAAC,UAAgC,EACrC,SAAS,EACT,MAAgB,CACjB,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,eAAe,CAAC,eAAe,KAAK,MAAM,EAAE,CAAC,CAAC,mBAAmB;IAC7E,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainstorm.tool.d.ts","sourceRoot":"","sources":["../../src/tools/brainstorm.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA2L5C,eAAO,MAAM,cAAc,EAAE,WA+G5B,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Logger } from '../utils/logger.js';
|
|
3
|
+
import { executeGeminiCLI } from '../utils/geminiExecutor.js';
|
|
4
|
+
function buildBrainstormPrompt(config) {
|
|
5
|
+
const { prompt, methodology, domain, constraints, existingContext, ideaCount, includeAnalysis, } = config;
|
|
6
|
+
// Select methodology framework
|
|
7
|
+
let frameworkInstructions = getMethodologyInstructions(methodology, domain);
|
|
8
|
+
let enhancedPrompt = `# BRAINSTORMING SESSION
|
|
9
|
+
|
|
10
|
+
## Core Challenge
|
|
11
|
+
${prompt}
|
|
12
|
+
|
|
13
|
+
## Methodology Framework
|
|
14
|
+
${frameworkInstructions}
|
|
15
|
+
|
|
16
|
+
## Context Engineering
|
|
17
|
+
*Use the following context to inform your reasoning:*
|
|
18
|
+
${domain ? `**Domain Focus:** ${domain} - Apply domain-specific knowledge, terminology, and best practices.` : ''}
|
|
19
|
+
${constraints ? `**Constraints & Boundaries:** ${constraints}` : ''}
|
|
20
|
+
${existingContext ? `**Background Context:** ${existingContext}` : ''}
|
|
21
|
+
|
|
22
|
+
## Output Requirements
|
|
23
|
+
- Generate ${ideaCount} distinct, creative ideas
|
|
24
|
+
- Each idea should be unique and non-obvious
|
|
25
|
+
- Focus on actionable, implementable concepts
|
|
26
|
+
- Use clear, descriptive naming
|
|
27
|
+
- Provide brief explanations for each idea
|
|
28
|
+
|
|
29
|
+
${includeAnalysis
|
|
30
|
+
? `
|
|
31
|
+
## Analysis Framework
|
|
32
|
+
For each idea, provide:
|
|
33
|
+
- **Feasibility:** Implementation difficulty (1-5 scale)
|
|
34
|
+
- **Impact:** Potential value/benefit (1-5 scale)
|
|
35
|
+
- **Innovation:** Uniqueness/creativity (1-5 scale)
|
|
36
|
+
- **Quick Assessment:** One-sentence evaluation
|
|
37
|
+
`
|
|
38
|
+
: ''}
|
|
39
|
+
|
|
40
|
+
## Format
|
|
41
|
+
Present ideas in a structured format:
|
|
42
|
+
|
|
43
|
+
### Idea [N]: [Creative Name]
|
|
44
|
+
**Description:** [2-3 sentence explanation]
|
|
45
|
+
${includeAnalysis ? '**Feasibility:** [1-5] | **Impact:** [1-5] | **Innovation:** [1-5]\n**Assessment:** [Brief evaluation]' : ''}
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
**Before finalizing, review the list: remove near-duplicates and ensure each idea satisfies the constraints.**
|
|
50
|
+
|
|
51
|
+
Begin brainstorming session:`;
|
|
52
|
+
return enhancedPrompt;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Returns methodology-specific instructions for structured brainstorming
|
|
56
|
+
*/
|
|
57
|
+
function getMethodologyInstructions(methodology, domain) {
|
|
58
|
+
const methodologies = {
|
|
59
|
+
divergent: `**Divergent Thinking Approach:**
|
|
60
|
+
- Generate maximum quantity of ideas without self-censoring
|
|
61
|
+
- Build on wild or seemingly impractical ideas
|
|
62
|
+
- Combine unrelated concepts for unexpected solutions
|
|
63
|
+
- Use "Yes, and..." thinking to expand each concept
|
|
64
|
+
- Postpone evaluation until all ideas are generated`,
|
|
65
|
+
convergent: `**Convergent Thinking Approach:**
|
|
66
|
+
- Focus on refining and improving existing concepts
|
|
67
|
+
- Synthesize related ideas into stronger solutions
|
|
68
|
+
- Apply critical evaluation criteria
|
|
69
|
+
- Prioritize based on feasibility and impact
|
|
70
|
+
- Develop implementation pathways for top ideas`,
|
|
71
|
+
scamper: `**SCAMPER Creative Triggers:**
|
|
72
|
+
- **Substitute:** What can be substituted or replaced?
|
|
73
|
+
- **Combine:** What can be combined or merged?
|
|
74
|
+
- **Adapt:** What can be adapted from other domains?
|
|
75
|
+
- **Modify:** What can be magnified, minimized, or altered?
|
|
76
|
+
- **Put to other use:** How else can this be used?
|
|
77
|
+
- **Eliminate:** What can be removed or simplified?
|
|
78
|
+
- **Reverse:** What can be rearranged or reversed?`,
|
|
79
|
+
'design-thinking': `**Human-Centered Design Thinking:**
|
|
80
|
+
- **Empathize:** Consider user needs, pain points, and contexts
|
|
81
|
+
- **Define:** Frame problems from user perspective
|
|
82
|
+
- **Ideate:** Generate user-focused solutions
|
|
83
|
+
- **Consider Journey:** Think through complete user experience
|
|
84
|
+
- **Prototype Mindset:** Focus on testable, iterative concepts`,
|
|
85
|
+
lateral: `**Lateral Thinking Approach:**
|
|
86
|
+
- Make unexpected connections between unrelated fields
|
|
87
|
+
- Challenge fundamental assumptions
|
|
88
|
+
- Use random word association to trigger new directions
|
|
89
|
+
- Apply metaphors and analogies from other domains
|
|
90
|
+
- Reverse conventional thinking patterns`,
|
|
91
|
+
auto: `**AI-Optimized Approach:**
|
|
92
|
+
${domain ? `Given the ${domain} domain, I'll apply the most effective combination of:` : "I'll intelligently combine multiple methodologies:"}
|
|
93
|
+
- Divergent exploration with domain-specific knowledge
|
|
94
|
+
- SCAMPER triggers and lateral thinking
|
|
95
|
+
- Human-centered perspective for practical value`,
|
|
96
|
+
};
|
|
97
|
+
return methodologies[methodology] || methodologies['auto'];
|
|
98
|
+
}
|
|
99
|
+
const brainstormArgsSchema = z.object({
|
|
100
|
+
prompt: z
|
|
101
|
+
.string()
|
|
102
|
+
.min(1)
|
|
103
|
+
.describe('Primary brainstorming challenge or question to explore'),
|
|
104
|
+
model: z
|
|
105
|
+
.string()
|
|
106
|
+
.optional()
|
|
107
|
+
.describe("Optional model to use (e.g., 'gemini-3-flash-preview'). If not specified, uses the default model (gemini-3-pro-preview)."),
|
|
108
|
+
methodology: z
|
|
109
|
+
.enum([
|
|
110
|
+
'divergent',
|
|
111
|
+
'convergent',
|
|
112
|
+
'scamper',
|
|
113
|
+
'design-thinking',
|
|
114
|
+
'lateral',
|
|
115
|
+
'auto',
|
|
116
|
+
])
|
|
117
|
+
.default('auto')
|
|
118
|
+
.describe("Brainstorming framework: 'divergent' (generate many ideas), 'convergent' (refine existing), 'scamper' (systematic triggers), 'design-thinking' (human-centered), 'lateral' (unexpected connections), 'auto' (AI selects best)"),
|
|
119
|
+
domain: z
|
|
120
|
+
.string()
|
|
121
|
+
.optional()
|
|
122
|
+
.describe("Domain context for specialized brainstorming (e.g., 'software', 'business', 'creative', 'research', 'product', 'marketing')"),
|
|
123
|
+
constraints: z
|
|
124
|
+
.string()
|
|
125
|
+
.optional()
|
|
126
|
+
.describe('Known limitations, requirements, or boundaries (budget, time, technical, legal, etc.)'),
|
|
127
|
+
existingContext: z
|
|
128
|
+
.string()
|
|
129
|
+
.optional()
|
|
130
|
+
.describe('Background information, previous attempts, or current state to build upon'),
|
|
131
|
+
ideaCount: z
|
|
132
|
+
.number()
|
|
133
|
+
.int()
|
|
134
|
+
.positive()
|
|
135
|
+
.default(12)
|
|
136
|
+
.describe('Target number of ideas to generate (default: 10-15)'),
|
|
137
|
+
includeAnalysis: z
|
|
138
|
+
.boolean()
|
|
139
|
+
.default(true)
|
|
140
|
+
.describe('Include feasibility, impact, and implementation analysis for generated ideas'),
|
|
141
|
+
});
|
|
142
|
+
export const brainstormTool = {
|
|
143
|
+
name: 'brainstorm',
|
|
144
|
+
description: 'Generate creative ideas using structured frameworks (SCAMPER, Design Thinking, etc.) with domain context, feasibility analysis, and iterative refinement.',
|
|
145
|
+
zodSchema: brainstormArgsSchema,
|
|
146
|
+
inputSchema: {
|
|
147
|
+
type: 'object',
|
|
148
|
+
properties: {
|
|
149
|
+
prompt: {
|
|
150
|
+
type: 'string',
|
|
151
|
+
description: 'Primary brainstorming challenge or question to explore',
|
|
152
|
+
},
|
|
153
|
+
model: {
|
|
154
|
+
type: 'string',
|
|
155
|
+
description: "Optional model to use (e.g., 'gemini-3-flash-preview'). If not specified, uses the default model (gemini-3-pro-preview).",
|
|
156
|
+
},
|
|
157
|
+
methodology: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
enum: [
|
|
160
|
+
'divergent',
|
|
161
|
+
'convergent',
|
|
162
|
+
'scamper',
|
|
163
|
+
'design-thinking',
|
|
164
|
+
'lateral',
|
|
165
|
+
'auto',
|
|
166
|
+
],
|
|
167
|
+
default: 'auto',
|
|
168
|
+
description: "Brainstorming framework: 'divergent' (generate many ideas), 'convergent' (refine existing), 'scamper' (systematic triggers), 'design-thinking' (human-centered), 'lateral' (unexpected connections), 'auto' (AI selects best)",
|
|
169
|
+
},
|
|
170
|
+
domain: {
|
|
171
|
+
type: 'string',
|
|
172
|
+
description: "Domain context for specialized brainstorming (e.g., 'software', 'business', 'creative', 'research', 'product', 'marketing')",
|
|
173
|
+
},
|
|
174
|
+
constraints: {
|
|
175
|
+
type: 'string',
|
|
176
|
+
description: 'Known limitations, requirements, or boundaries (budget, time, technical, legal, etc.)',
|
|
177
|
+
},
|
|
178
|
+
existingContext: {
|
|
179
|
+
type: 'string',
|
|
180
|
+
description: 'Background information, previous attempts, or current state to build upon',
|
|
181
|
+
},
|
|
182
|
+
ideaCount: {
|
|
183
|
+
type: 'integer',
|
|
184
|
+
default: 12,
|
|
185
|
+
description: 'Target number of ideas to generate (default: 10-15)',
|
|
186
|
+
},
|
|
187
|
+
includeAnalysis: {
|
|
188
|
+
type: 'boolean',
|
|
189
|
+
default: true,
|
|
190
|
+
description: 'Include feasibility, impact, and implementation analysis for generated ideas',
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
required: ['prompt'],
|
|
194
|
+
},
|
|
195
|
+
prompt: {
|
|
196
|
+
description: 'Generate creative ideas using structured brainstorming methodologies.',
|
|
197
|
+
},
|
|
198
|
+
category: 'gemini',
|
|
199
|
+
execute: async (args, onProgress) => {
|
|
200
|
+
const { prompt, model, methodology = 'auto', domain, constraints, existingContext, ideaCount = 12, includeAnalysis = true, } = args;
|
|
201
|
+
if (!prompt?.trim()) {
|
|
202
|
+
throw new Error('You must provide a valid brainstorming challenge or question to explore');
|
|
203
|
+
}
|
|
204
|
+
let enhancedPrompt = buildBrainstormPrompt({
|
|
205
|
+
prompt: prompt.trim(),
|
|
206
|
+
methodology: methodology,
|
|
207
|
+
domain: domain,
|
|
208
|
+
constraints: constraints,
|
|
209
|
+
existingContext: existingContext,
|
|
210
|
+
ideaCount: ideaCount,
|
|
211
|
+
includeAnalysis: includeAnalysis,
|
|
212
|
+
});
|
|
213
|
+
Logger.debug(`Brainstorm: Using methodology '${methodology}' for domain '${domain || 'general'}'`);
|
|
214
|
+
// Report progress to user
|
|
215
|
+
onProgress?.(`Generating ${ideaCount} ideas via ${methodology} methodology...`);
|
|
216
|
+
// Execute with Gemini
|
|
217
|
+
return await executeGeminiCLI(enhancedPrompt, model, false, false, onProgress);
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=brainstorm.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainstorm.tool.js","sourceRoot":"","sources":["../../src/tools/brainstorm.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAA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