@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const timeoutTestArgsSchema = z.object({
|
|
3
|
+
duration: z
|
|
4
|
+
.number()
|
|
5
|
+
.min(10)
|
|
6
|
+
.describe('Duration in milliseconds (minimum 10ms)'),
|
|
7
|
+
});
|
|
8
|
+
export const timeoutTestTool = {
|
|
9
|
+
name: 'timeout-test',
|
|
10
|
+
description: 'Test timeout prevention by running for a specified duration',
|
|
11
|
+
zodSchema: timeoutTestArgsSchema,
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
duration: {
|
|
16
|
+
type: 'number',
|
|
17
|
+
description: 'Duration in milliseconds (minimum 10ms)',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
required: ['duration'],
|
|
21
|
+
},
|
|
22
|
+
prompt: {
|
|
23
|
+
description: 'Test the timeout prevention system by running a long operation',
|
|
24
|
+
},
|
|
25
|
+
category: 'simple',
|
|
26
|
+
execute: async (args, _onProgress) => {
|
|
27
|
+
const duration = args.duration;
|
|
28
|
+
const steps = Math.ceil(duration / 5000); // Progress every 5 seconds
|
|
29
|
+
const stepDuration = duration / steps;
|
|
30
|
+
const startTime = Date.now();
|
|
31
|
+
const results = [];
|
|
32
|
+
results.push(`Starting timeout test for ${duration}ms (${duration / 1000}s)`);
|
|
33
|
+
for (let i = 1; i <= steps; i++) {
|
|
34
|
+
await new Promise((resolve) => setTimeout(resolve, stepDuration));
|
|
35
|
+
const elapsed = Date.now() - startTime;
|
|
36
|
+
results.push(`Step ${i}/${steps} completed - Elapsed: ${Math.round(elapsed / 1000)}s`);
|
|
37
|
+
}
|
|
38
|
+
const totalElapsed = Date.now() - startTime;
|
|
39
|
+
results.push(`\nTimeout test completed successfully!`);
|
|
40
|
+
results.push(`Target duration: ${duration}ms`);
|
|
41
|
+
results.push(`Actual duration: ${totalElapsed}ms`);
|
|
42
|
+
return results.join('\n');
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=timeout-test.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-test.tool.js","sourceRoot":"","sources":["../../src/tools/timeout-test.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,EAAE,CAAC;SACP,QAAQ,CAAC,yCAAyC,CAAC;CACvD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,6DAA6D;IAC1E,SAAS,EAAE,qBAAqB;IAChC,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yCAAyC;aACvD;SACF;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB;IACD,MAAM,EAAE;QACN,WAAW,EACT,gEAAgE;KACnE;IACD,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,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emas for the Gemini MCP Server
|
|
3
|
+
*/
|
|
4
|
+
export interface ToolArguments {
|
|
5
|
+
prompt?: string;
|
|
6
|
+
model?: string;
|
|
7
|
+
sandbox?: boolean | string;
|
|
8
|
+
changeMode?: boolean | string;
|
|
9
|
+
chunkIndex?: number | string;
|
|
10
|
+
chunkCacheKey?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
methodology?: string;
|
|
13
|
+
domain?: string;
|
|
14
|
+
constraints?: string;
|
|
15
|
+
existingContext?: string;
|
|
16
|
+
ideaCount?: number;
|
|
17
|
+
includeAnalysis?: boolean;
|
|
18
|
+
[key: string]: string | boolean | number | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface ServerConfig {
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
}
|
|
24
|
+
export type ProgressCallback = (newOutput: string) => void;
|
|
25
|
+
export declare const TOOLS: {
|
|
26
|
+
readonly GEMINI: "gemini";
|
|
27
|
+
readonly WEB_SEARCH: "web-search";
|
|
28
|
+
readonly ANALYZE_MEDIA: "analyze-media";
|
|
29
|
+
readonly SHELL: "shell";
|
|
30
|
+
readonly BRAINSTORM: "brainstorm";
|
|
31
|
+
readonly FETCH_CHUNK: "fetch-chunk";
|
|
32
|
+
readonly PING: "ping";
|
|
33
|
+
readonly HELP: "help";
|
|
34
|
+
readonly TIMEOUT_TEST: "timeout-test";
|
|
35
|
+
};
|
|
36
|
+
export type ToolName = (typeof TOOLS)[keyof typeof TOOLS];
|
|
37
|
+
export declare const MODELS: {
|
|
38
|
+
readonly PRO: "gemini-3-pro-preview";
|
|
39
|
+
readonly FLASH: "gemini-3-flash-preview";
|
|
40
|
+
readonly FLASH_LITE: "gemini-2.5-flash-lite";
|
|
41
|
+
};
|
|
42
|
+
export type ModelName = (typeof MODELS)[keyof typeof MODELS];
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":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
// Tool constants
|
|
5
|
+
export const TOOLS = {
|
|
6
|
+
GEMINI: 'gemini',
|
|
7
|
+
WEB_SEARCH: 'web-search',
|
|
8
|
+
ANALYZE_MEDIA: 'analyze-media',
|
|
9
|
+
SHELL: 'shell',
|
|
10
|
+
BRAINSTORM: 'brainstorm',
|
|
11
|
+
FETCH_CHUNK: 'fetch-chunk',
|
|
12
|
+
PING: 'ping',
|
|
13
|
+
HELP: 'help',
|
|
14
|
+
TIMEOUT_TEST: 'timeout-test',
|
|
15
|
+
};
|
|
16
|
+
// Model constants - Using Gemini 3 as defaults
|
|
17
|
+
export const MODELS = {
|
|
18
|
+
PRO: 'gemini-3-pro-preview',
|
|
19
|
+
FLASH: 'gemini-3-flash-preview',
|
|
20
|
+
FLASH_LITE: 'gemini-2.5-flash-lite', // No Gemini 3 lite yet
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgCH,iBAAiB;AACjB,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;IAC9B,KAAK,EAAE,OAAO;IACd,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,cAAc;CACpB,CAAC;AAIX,+CAA+C;AAC/C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,EAAE,sBAAsB;IAC3B,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE,uBAAuB,EAAE,uBAAuB;CACpD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChangeModeEdit } from './changeModeParser.js';
|
|
2
|
+
export interface EditChunk {
|
|
3
|
+
edits: ChangeModeEdit[];
|
|
4
|
+
chunkIndex: number;
|
|
5
|
+
totalChunks: number;
|
|
6
|
+
hasMore: boolean;
|
|
7
|
+
estimatedChars: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function chunkChangeModeEdits(edits: ChangeModeEdit[], maxCharsPerChunk?: number): EditChunk[];
|
|
10
|
+
export declare function summarizeChunking(chunks: EditChunk[]): string;
|
|
11
|
+
//# sourceMappingURL=changeModeChunker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeModeChunker.d.ts","sourceRoot":"","sources":["../../src/utils/changeModeChunker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAoBD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,cAAc,EAAE,EACvB,gBAAgB,GAAE,MAAc,GAC/B,SAAS,EAAE,CA0Eb;AAgBD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAoB7D"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
function estimateEditSize(edit) {
|
|
2
|
+
const jsonOverhead = 250;
|
|
3
|
+
const contentSize = edit.filename.length * 2 + edit.oldCode.length + edit.newCode.length;
|
|
4
|
+
return jsonOverhead + contentSize;
|
|
5
|
+
}
|
|
6
|
+
function groupEditsByFile(edits) {
|
|
7
|
+
const groups = new Map();
|
|
8
|
+
for (const edit of edits) {
|
|
9
|
+
const fileEdits = groups.get(edit.filename) || [];
|
|
10
|
+
fileEdits.push(edit);
|
|
11
|
+
groups.set(edit.filename, fileEdits);
|
|
12
|
+
}
|
|
13
|
+
return groups;
|
|
14
|
+
}
|
|
15
|
+
export function chunkChangeModeEdits(edits, maxCharsPerChunk = 20000) {
|
|
16
|
+
if (edits.length === 0) {
|
|
17
|
+
return [
|
|
18
|
+
{
|
|
19
|
+
edits: [],
|
|
20
|
+
chunkIndex: 1,
|
|
21
|
+
totalChunks: 1,
|
|
22
|
+
hasMore: false,
|
|
23
|
+
estimatedChars: 0,
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
const chunks = [];
|
|
28
|
+
const fileGroups = groupEditsByFile(edits);
|
|
29
|
+
let currentChunk = [];
|
|
30
|
+
let currentSize = 0;
|
|
31
|
+
for (const [, fileEdits] of fileGroups) {
|
|
32
|
+
const fileSize = fileEdits.reduce((sum, edit) => sum + estimateEditSize(edit), 0);
|
|
33
|
+
if (fileSize > maxCharsPerChunk) {
|
|
34
|
+
if (currentChunk.length > 0) {
|
|
35
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
36
|
+
currentChunk = [];
|
|
37
|
+
currentSize = 0;
|
|
38
|
+
}
|
|
39
|
+
for (const edit of fileEdits) {
|
|
40
|
+
const editSize = estimateEditSize(edit);
|
|
41
|
+
if (currentSize + editSize > maxCharsPerChunk &&
|
|
42
|
+
currentChunk.length > 0) {
|
|
43
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
44
|
+
currentChunk = [];
|
|
45
|
+
currentSize = 0;
|
|
46
|
+
}
|
|
47
|
+
currentChunk.push(edit);
|
|
48
|
+
currentSize += editSize;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (currentSize + fileSize > maxCharsPerChunk &&
|
|
53
|
+
currentChunk.length > 0) {
|
|
54
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
55
|
+
currentChunk = [];
|
|
56
|
+
currentSize = 0;
|
|
57
|
+
}
|
|
58
|
+
currentChunk.push(...fileEdits);
|
|
59
|
+
currentSize += fileSize;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (currentChunk.length > 0) {
|
|
63
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
64
|
+
}
|
|
65
|
+
const totalChunks = chunks.length;
|
|
66
|
+
return chunks.map((chunk, index) => ({
|
|
67
|
+
...chunk,
|
|
68
|
+
totalChunks,
|
|
69
|
+
hasMore: index < totalChunks - 1,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
function createChunk(edits, chunkIndex, totalChunks, estimatedChars) {
|
|
73
|
+
return {
|
|
74
|
+
edits,
|
|
75
|
+
chunkIndex,
|
|
76
|
+
totalChunks,
|
|
77
|
+
hasMore: false,
|
|
78
|
+
estimatedChars,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function summarizeChunking(chunks) {
|
|
82
|
+
const totalEdits = chunks.reduce((sum, chunk) => sum + chunk.edits.length, 0);
|
|
83
|
+
const totalChars = chunks.reduce((sum, chunk) => sum + chunk.estimatedChars, 0);
|
|
84
|
+
return `Chunking Summary:
|
|
85
|
+
# edits: ${totalEdits}
|
|
86
|
+
# chunks: ${chunks.length}
|
|
87
|
+
est chars: ${totalChars.toLocaleString()}
|
|
88
|
+
mean size: ${Math.round(totalChars / chunks.length).toLocaleString()} chars
|
|
89
|
+
|
|
90
|
+
Chunks:
|
|
91
|
+
${chunks
|
|
92
|
+
.map((chunk) => ` Chunk ${chunk.chunkIndex}: ${chunk.edits.length} edits, ~${chunk.estimatedChars.toLocaleString()} chars`)
|
|
93
|
+
.join('\n')}`;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=changeModeChunker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeModeChunker.js","sourceRoot":"","sources":["../../src/utils/changeModeChunker.ts"],"names":[],"mappings":"AAUA,SAAS,gBAAgB,CAAC,IAAoB;IAC5C,MAAM,YAAY,GAAG,GAAG,CAAC;IACzB,MAAM,WAAW,GACf,IAAI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,cAAc,CAAC,cAAc,EAAE,QAAQ,CAC9G;SACA,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ChangeModeEdit {
|
|
2
|
+
filename: string;
|
|
3
|
+
oldStartLine: number;
|
|
4
|
+
oldEndLine: number;
|
|
5
|
+
oldCode: string;
|
|
6
|
+
newStartLine: number;
|
|
7
|
+
newEndLine: number;
|
|
8
|
+
newCode: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function parseChangeModeOutput(geminiResponse: string): ChangeModeEdit[];
|
|
11
|
+
export declare function validateChangeModeEdits(edits: ChangeModeEdit[]): {
|
|
12
|
+
valid: boolean;
|
|
13
|
+
errors: string[];
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=changeModeParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeModeParser.d.ts","sourceRoot":"","sources":["../../src/utils/changeModeParser.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,MAAM,GACrB,cAAc,EAAE,CAqElB;AACD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG;IAChE,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CA6BA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export function parseChangeModeOutput(geminiResponse) {
|
|
2
|
+
const edits = [];
|
|
3
|
+
const markdownPattern = /\*\*FILE:\s*(.+?):(\d+)\*\*\s*\n```\s*\nOLD:\s*\n([\s\S]*?)\nNEW:\s*\n([\s\S]*?)\n```/g;
|
|
4
|
+
let match;
|
|
5
|
+
while ((match = markdownPattern.exec(geminiResponse)) !== null) {
|
|
6
|
+
const [, filename, startLineStr, oldCodeRaw, newCodeRaw] = match;
|
|
7
|
+
const oldCode = oldCodeRaw.trimEnd();
|
|
8
|
+
const newCode = newCodeRaw.trimEnd();
|
|
9
|
+
const startLine = parseInt(startLineStr, 10);
|
|
10
|
+
const oldLineCount = oldCode === '' ? 0 : oldCode.split('\n').length;
|
|
11
|
+
const newLineCount = newCode === '' ? 0 : newCode.split('\n').length;
|
|
12
|
+
const oldEndLine = startLine + (oldLineCount > 0 ? oldLineCount - 1 : 0);
|
|
13
|
+
const newStartLine = startLine;
|
|
14
|
+
const newEndLine = newStartLine + (newLineCount > 0 ? newLineCount - 1 : 0);
|
|
15
|
+
edits.push({
|
|
16
|
+
filename: filename.trim(),
|
|
17
|
+
oldStartLine: startLine,
|
|
18
|
+
oldEndLine: oldEndLine,
|
|
19
|
+
oldCode: oldCode,
|
|
20
|
+
newStartLine: newStartLine,
|
|
21
|
+
newEndLine: newEndLine,
|
|
22
|
+
newCode: newCode,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
if (edits.length === 0) {
|
|
26
|
+
const editPattern = /\/old\/ \* (.+?) 'start:' (\d+)\n([\s\S]*?)\n\/\/ 'end:' (\d+)\s*\n\s*\\new\\ \* (.+?) 'start:' (\d+)\n([\s\S]*?)\n\/\/ 'end:' (\d+)/g;
|
|
27
|
+
while ((match = editPattern.exec(geminiResponse)) !== null) {
|
|
28
|
+
const [, oldFilename, oldStartLine, oldCode, oldEndLine, newFilename, newStartLine, newCode, newEndLine,] = match;
|
|
29
|
+
if (oldFilename !== newFilename) {
|
|
30
|
+
console.warn(`[changeModeParser] Filename mismatch: ${oldFilename} vs ${newFilename}`);
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
edits.push({
|
|
34
|
+
filename: oldFilename.trim(),
|
|
35
|
+
oldStartLine: parseInt(oldStartLine, 10),
|
|
36
|
+
oldEndLine: parseInt(oldEndLine, 10),
|
|
37
|
+
oldCode: oldCode.trimEnd(),
|
|
38
|
+
newStartLine: parseInt(newStartLine, 10),
|
|
39
|
+
newEndLine: parseInt(newEndLine, 10),
|
|
40
|
+
newCode: newCode.trimEnd(),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return edits;
|
|
45
|
+
}
|
|
46
|
+
export function validateChangeModeEdits(edits) {
|
|
47
|
+
const errors = [];
|
|
48
|
+
for (const edit of edits) {
|
|
49
|
+
if (!edit.filename) {
|
|
50
|
+
errors.push('Edit missing filename');
|
|
51
|
+
}
|
|
52
|
+
if (edit.oldStartLine > edit.oldEndLine) {
|
|
53
|
+
errors.push(`Invalid line range for ${edit.filename}: ${edit.oldStartLine} > ${edit.oldEndLine}`);
|
|
54
|
+
}
|
|
55
|
+
if (edit.newStartLine > edit.newEndLine) {
|
|
56
|
+
errors.push(`Invalid new line range for ${edit.filename}: ${edit.newStartLine} > ${edit.newEndLine}`);
|
|
57
|
+
}
|
|
58
|
+
if (!edit.oldCode && !edit.newCode) {
|
|
59
|
+
errors.push(`Empty edit for ${edit.filename}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
valid: errors.length === 0,
|
|
64
|
+
errors,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=changeModeParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeModeParser.js","sourceRoot":"","sources":["../../src/utils/changeModeParser.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,qBAAqB,CACnC,cAAsB;IAEtB,MAAM,KAAK,GAAqB,EAAE,CAAC;IACnC,MAAM,eAAe,GACnB,wFAAwF,CAAC;IAE3F,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,eAAe,CA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Y,MAAM,IAAI,CAAC,UAAU,EAAE,CACrF,CAAC;QACJ,CAAC;QAED,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,MAAM,CAAC,IAAI,CACT,8BAA8B,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY,MAAM,IAAI,CAAC,UAAU,EAAE,CACzF,CAAC;QACJ,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ChangeModeEdit } from './changeModeParser.js';
|
|
2
|
+
export declare function formatChangeModeResponse(edits: ChangeModeEdit[], chunkInfo?: {
|
|
3
|
+
current: number;
|
|
4
|
+
total: number;
|
|
5
|
+
cacheKey?: string;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function summarizeChangeModeEdits(edits: ChangeModeEdit[], isPartialView?: boolean): string;
|
|
8
|
+
//# sourceMappingURL=changeModeTranslator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeModeTranslator.d.ts","sourceRoot":"","sources":["../../src/utils/changeModeTranslator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,cAAc,EAAE,EACvB,SAAS,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAChE,MAAM,CAuDR;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,cAAc,EAAE,EACvB,aAAa,CAAC,EAAE,OAAO,GACtB,MAAM,CAkBR"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export function formatChangeModeResponse(edits, chunkInfo) {
|
|
2
|
+
const header = chunkInfo && chunkInfo.total > 1
|
|
3
|
+
? `[CHANGEMODE OUTPUT - Chunk ${chunkInfo.current} of ${chunkInfo.total}]
|
|
4
|
+
|
|
5
|
+
Gemini has analyzed your codebase and generated edits across ${chunkInfo.total} chunks.
|
|
6
|
+
This chunk contains ${edits.length} complete edit${edits.length === 1 ? '' : 's'} that can be applied independently.
|
|
7
|
+
|
|
8
|
+
Each chunk contains self-contained edits grouped by file. You can safely apply these edits
|
|
9
|
+
before fetching the next chunk.
|
|
10
|
+
|
|
11
|
+
`
|
|
12
|
+
: `[CHANGEMODE OUTPUT - Gemini has analyzed the files and provided these edits]
|
|
13
|
+
|
|
14
|
+
I have prepared ${edits.length} modification${edits.length === 1 ? '' : 's'} for your codebase.
|
|
15
|
+
|
|
16
|
+
IMPORTANT: Apply these edits directly WITHOUT reading the files first. The edits below contain exact text matches from the current file contents.
|
|
17
|
+
|
|
18
|
+
`;
|
|
19
|
+
const instructions = edits
|
|
20
|
+
.map((edit, index) => {
|
|
21
|
+
return `### Edit ${index + 1}: ${edit.filename}
|
|
22
|
+
|
|
23
|
+
Replace this exact text:
|
|
24
|
+
\`\`\`
|
|
25
|
+
${edit.oldCode}
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
With this text:
|
|
29
|
+
\`\`\`
|
|
30
|
+
${edit.newCode}
|
|
31
|
+
\`\`\`
|
|
32
|
+
`;
|
|
33
|
+
})
|
|
34
|
+
.join('\n');
|
|
35
|
+
let footer = `
|
|
36
|
+
---
|
|
37
|
+
Apply these edits in order. Each edit uses exact string matching, so the old_str must match exactly what appears between the code blocks.`;
|
|
38
|
+
if (chunkInfo && chunkInfo.current < chunkInfo.total && chunkInfo.cacheKey) {
|
|
39
|
+
footer += `
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
**Next Step**: After applying the edits above, retrieve the next chunk (${chunkInfo.current + 1} of ${chunkInfo.total}) using:
|
|
43
|
+
|
|
44
|
+
\`\`\`
|
|
45
|
+
fetch-chunk cacheKey="${chunkInfo.cacheKey}" chunkIndex=${chunkInfo.current + 1}
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
There ${chunkInfo.total - chunkInfo.current === 1 ? 'is' : 'are'} ${chunkInfo.total - chunkInfo.current} more chunk${chunkInfo.total - chunkInfo.current === 1 ? '' : 's'} containing additional edits.
|
|
49
|
+
|
|
50
|
+
**CONTINUE**: You are working on a multi-chunk changeMode response. After applying these edits, fetch the next chunk to continue with the remaining modifications.`;
|
|
51
|
+
}
|
|
52
|
+
return header + instructions + footer;
|
|
53
|
+
}
|
|
54
|
+
export function summarizeChangeModeEdits(edits, isPartialView) {
|
|
55
|
+
// for user
|
|
56
|
+
const fileGroups = new Map();
|
|
57
|
+
// Count edits per file
|
|
58
|
+
for (const edit of edits) {
|
|
59
|
+
fileGroups.set(edit.filename, (fileGroups.get(edit.filename) || 0) + 1);
|
|
60
|
+
}
|
|
61
|
+
const summary = Array.from(fileGroups.entries())
|
|
62
|
+
.map(([file, count]) => `- ${file}: ${count} edit${count === 1 ? '' : 's'}`)
|
|
63
|
+
.join('\n');
|
|
64
|
+
const title = isPartialView
|
|
65
|
+
? `ChangeMode Summary (Complete analysis across all chunks):`
|
|
66
|
+
: `ChangeMode Summary:`;
|
|
67
|
+
return `${title}
|
|
68
|
+
Total edits: ${edits.length}${isPartialView ? ' (across all chunks)' : ''}
|
|
69
|
+
Files affected: ${fileGroups.size}
|
|
70
|
+
|
|
71
|
+
${summary}`;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=changeModeTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"changeModeTranslator.js","sourceRoot":"","sources":["../../src/utils/changeMode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original prompt (used for hash generation)
|
|
5
|
+
* @param chunks The parsed and chunked edits
|
|
6
|
+
* @returns A short cache key for retrieval
|
|
7
|
+
*/
|
|
8
|
+
export declare function cacheChunks(prompt: string, chunks: EditChunk[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves cached chunks if they exist and haven't expired
|
|
11
|
+
* @param cacheKey The cache key returned from cacheChunks
|
|
12
|
+
* @returns The cached chunks or null if expired/not found
|
|
13
|
+
*/
|
|
14
|
+
export declare function getChunks(cacheKey: string): EditChunk[] | null;
|
|
15
|
+
export declare function getCacheStats(): {
|
|
16
|
+
size: number;
|
|
17
|
+
ttl: number;
|
|
18
|
+
maxSize: number;
|
|
19
|
+
cacheDir: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function clearCache(): void;
|
|
22
|
+
//# sourceMappingURL=chunkCache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunkCache.d.ts","sourceRoot":"","sources":["../../src/utils/chunkCache.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAsBnD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAwBvE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,IAAI,CA4B9D;AAiED,wBAAgB,aAAa,IAAI;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAeA;AAED,wBAAgB,UAAU,IAAI,IAAI,CAgBjC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { createHash } from 'crypto';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
import { Logger } from './logger.js';
|
|
6
|
+
const CACHE_DIR = path.join(os.tmpdir(), 'gemini-mcp-chunks');
|
|
7
|
+
const CACHE_TTL = 10 * 60 * 1000;
|
|
8
|
+
const MAX_CACHE_FILES = 50;
|
|
9
|
+
function ensureCacheDir() {
|
|
10
|
+
if (!fs.existsSync(CACHE_DIR)) {
|
|
11
|
+
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Caches chunks from a changeMode response
|
|
16
|
+
* @param prompt The original prompt (used for hash generation)
|
|
17
|
+
* @param chunks The parsed and chunked edits
|
|
18
|
+
* @returns A short cache key for retrieval
|
|
19
|
+
*/
|
|
20
|
+
export function cacheChunks(prompt, chunks) {
|
|
21
|
+
ensureCacheDir();
|
|
22
|
+
cleanExpiredFiles(); // Cleanup on each write
|
|
23
|
+
// Generate deterministic cache key from prompt
|
|
24
|
+
const promptHash = createHash('sha256').update(prompt).digest('hex');
|
|
25
|
+
const cacheKey = promptHash.slice(0, 8);
|
|
26
|
+
const filePath = path.join(CACHE_DIR, `${cacheKey}.json`);
|
|
27
|
+
// Store with metadata
|
|
28
|
+
const cacheData = {
|
|
29
|
+
chunks,
|
|
30
|
+
timestamp: Date.now(),
|
|
31
|
+
promptHash,
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
fs.writeFileSync(filePath, JSON.stringify(cacheData));
|
|
35
|
+
Logger.debug(`Cached ${chunks.length} chunks to file: ${cacheKey}.json`);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
Logger.error(`Failed to cache chunks: ${error}`);
|
|
39
|
+
}
|
|
40
|
+
enforceFileLimits();
|
|
41
|
+
return cacheKey;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves cached chunks if they exist and haven't expired
|
|
45
|
+
* @param cacheKey The cache key returned from cacheChunks
|
|
46
|
+
* @returns The cached chunks or null if expired/not found
|
|
47
|
+
*/
|
|
48
|
+
export function getChunks(cacheKey) {
|
|
49
|
+
const filePath = path.join(CACHE_DIR, `${cacheKey}.json`);
|
|
50
|
+
try {
|
|
51
|
+
if (!fs.existsSync(filePath)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const fileContent = fs.readFileSync(filePath, 'utf-8');
|
|
55
|
+
const data = JSON.parse(fileContent);
|
|
56
|
+
if (Date.now() - data.timestamp > CACHE_TTL) {
|
|
57
|
+
fs.unlinkSync(filePath);
|
|
58
|
+
Logger.debug(`Cache expired for ${cacheKey}, deleted file`);
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
Logger.debug(`Cache hit for ${cacheKey}, returning ${data.chunks.length} chunks`);
|
|
62
|
+
return data.chunks;
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
Logger.debug(`Cache read error for ${cacheKey}: ${error}`);
|
|
66
|
+
try {
|
|
67
|
+
fs.unlinkSync(filePath); // Clean up bad file
|
|
68
|
+
}
|
|
69
|
+
catch { }
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function cleanExpiredFiles() {
|
|
74
|
+
try {
|
|
75
|
+
ensureCacheDir();
|
|
76
|
+
const files = fs.readdirSync(CACHE_DIR);
|
|
77
|
+
const now = Date.now();
|
|
78
|
+
let cleaned = 0;
|
|
79
|
+
for (const file of files) {
|
|
80
|
+
if (!file.endsWith('.json'))
|
|
81
|
+
continue;
|
|
82
|
+
const filePath = path.join(CACHE_DIR, file);
|
|
83
|
+
try {
|
|
84
|
+
const stats = fs.statSync(filePath);
|
|
85
|
+
if (now - stats.mtimeMs > CACHE_TTL) {
|
|
86
|
+
fs.unlinkSync(filePath);
|
|
87
|
+
cleaned++;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
// Individual file error - continue with others
|
|
92
|
+
Logger.debug(`Error checking file ${file}: ${error}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (cleaned > 0) {
|
|
96
|
+
Logger.debug(`Cleaned ${cleaned} expired cache files`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
// Non-critical, just log
|
|
101
|
+
Logger.debug(`Cache cleanup error: ${error}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// maximum file count limit (FIFO) --> LRU?
|
|
105
|
+
function enforceFileLimits() {
|
|
106
|
+
try {
|
|
107
|
+
const files = fs
|
|
108
|
+
.readdirSync(CACHE_DIR)
|
|
109
|
+
.filter((f) => f.endsWith('.json'))
|
|
110
|
+
.map((f) => ({
|
|
111
|
+
name: f,
|
|
112
|
+
path: path.join(CACHE_DIR, f),
|
|
113
|
+
mtime: fs.statSync(path.join(CACHE_DIR, f)).mtimeMs,
|
|
114
|
+
}))
|
|
115
|
+
.sort((a, b) => a.mtime - b.mtime); // Oldest first
|
|
116
|
+
// Remove oldest files if over limit
|
|
117
|
+
if (files.length > MAX_CACHE_FILES) {
|
|
118
|
+
const toRemove = files.slice(0, files.length - MAX_CACHE_FILES);
|
|
119
|
+
for (const file of toRemove) {
|
|
120
|
+
try {
|
|
121
|
+
fs.unlinkSync(file.path);
|
|
122
|
+
}
|
|
123
|
+
catch { }
|
|
124
|
+
}
|
|
125
|
+
Logger.debug(`Removed ${toRemove.length} old cache files to enforce limit`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
Logger.debug(`Error enforcing file limits: ${error}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export function getCacheStats() {
|
|
133
|
+
ensureCacheDir();
|
|
134
|
+
let size = 0;
|
|
135
|
+
try {
|
|
136
|
+
const files = fs.readdirSync(CACHE_DIR);
|
|
137
|
+
size = files.filter((f) => f.endsWith('.json')).length;
|
|
138
|
+
}
|
|
139
|
+
catch { }
|
|
140
|
+
return {
|
|
141
|
+
size,
|
|
142
|
+
ttl: CACHE_TTL,
|
|
143
|
+
maxSize: MAX_CACHE_FILES,
|
|
144
|
+
cacheDir: CACHE_DIR,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
export function clearCache() {
|
|
148
|
+
// !
|
|
149
|
+
try {
|
|
150
|
+
ensureCacheDir();
|
|
151
|
+
const files = fs.readdirSync(CACHE_DIR);
|
|
152
|
+
for (const file of files) {
|
|
153
|
+
if (file.endsWith('.json')) {
|
|
154
|
+
fs.unlinkSync(path.join(CACHE_DIR, file));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
Logger.debug('Cache emptied');
|
|
158
|
+
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
Logger.error(`Failed to empty cache: ${error}`);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=chunkCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunkCache.js","sourceRoot":"","sources":["../../src/utils/chunkCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQrC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,mBAAmB,CAAC,CAAC;AAC9D,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACjC,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B,SAAS,cAAc;IACrB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CA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