cat-gemini-mcp 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +25 -0
- package/README.md +192 -0
- package/dist/constants.d.ts +74 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +73 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +188 -0
- package/dist/index.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 +36 -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 +136 -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 +62 -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 +10 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/registry.d.ts +25 -0
- package/dist/tools/registry.d.ts.map +1 -0
- package/dist/tools/registry.js +80 -0
- package/dist/tools/registry.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 +32 -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 +32 -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 +32 -0
- package/dist/tools/timeout-test.tool.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 +89 -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 +70 -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 +161 -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 +77 -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 +181 -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 +2 -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 +71 -0
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
## Analysis Framework
|
|
31
|
+
For each idea, provide:
|
|
32
|
+
- **Feasibility:** Implementation difficulty (1-5 scale)
|
|
33
|
+
- **Impact:** Potential value/benefit (1-5 scale)
|
|
34
|
+
- **Innovation:** Uniqueness/creativity (1-5 scale)
|
|
35
|
+
- **Quick Assessment:** One-sentence evaluation
|
|
36
|
+
` : ''}
|
|
37
|
+
|
|
38
|
+
## Format
|
|
39
|
+
Present ideas in a structured format:
|
|
40
|
+
|
|
41
|
+
### Idea [N]: [Creative Name]
|
|
42
|
+
**Description:** [2-3 sentence explanation]
|
|
43
|
+
${includeAnalysis ? '**Feasibility:** [1-5] | **Impact:** [1-5] | **Innovation:** [1-5]\n**Assessment:** [Brief evaluation]' : ''}
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
**Before finalizing, review the list: remove near-duplicates and ensure each idea satisfies the constraints.**
|
|
48
|
+
|
|
49
|
+
Begin brainstorming session:`;
|
|
50
|
+
return enhancedPrompt;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Returns methodology-specific instructions for structured brainstorming
|
|
54
|
+
*/
|
|
55
|
+
function getMethodologyInstructions(methodology, domain) {
|
|
56
|
+
const methodologies = {
|
|
57
|
+
'divergent': `**Divergent Thinking Approach:**
|
|
58
|
+
- Generate maximum quantity of ideas without self-censoring
|
|
59
|
+
- Build on wild or seemingly impractical ideas
|
|
60
|
+
- Combine unrelated concepts for unexpected solutions
|
|
61
|
+
- Use "Yes, and..." thinking to expand each concept
|
|
62
|
+
- Postpone evaluation until all ideas are generated`,
|
|
63
|
+
'convergent': `**Convergent Thinking Approach:**
|
|
64
|
+
- Focus on refining and improving existing concepts
|
|
65
|
+
- Synthesize related ideas into stronger solutions
|
|
66
|
+
- Apply critical evaluation criteria
|
|
67
|
+
- Prioritize based on feasibility and impact
|
|
68
|
+
- Develop implementation pathways for top ideas`,
|
|
69
|
+
'scamper': `**SCAMPER Creative Triggers:**
|
|
70
|
+
- **Substitute:** What can be substituted or replaced?
|
|
71
|
+
- **Combine:** What can be combined or merged?
|
|
72
|
+
- **Adapt:** What can be adapted from other domains?
|
|
73
|
+
- **Modify:** What can be magnified, minimized, or altered?
|
|
74
|
+
- **Put to other use:** How else can this be used?
|
|
75
|
+
- **Eliminate:** What can be removed or simplified?
|
|
76
|
+
- **Reverse:** What can be rearranged or reversed?`,
|
|
77
|
+
'design-thinking': `**Human-Centered Design Thinking:**
|
|
78
|
+
- **Empathize:** Consider user needs, pain points, and contexts
|
|
79
|
+
- **Define:** Frame problems from user perspective
|
|
80
|
+
- **Ideate:** Generate user-focused solutions
|
|
81
|
+
- **Consider Journey:** Think through complete user experience
|
|
82
|
+
- **Prototype Mindset:** Focus on testable, iterative concepts`,
|
|
83
|
+
'lateral': `**Lateral Thinking Approach:**
|
|
84
|
+
- Make unexpected connections between unrelated fields
|
|
85
|
+
- Challenge fundamental assumptions
|
|
86
|
+
- Use random word association to trigger new directions
|
|
87
|
+
- Apply metaphors and analogies from other domains
|
|
88
|
+
- Reverse conventional thinking patterns`,
|
|
89
|
+
'auto': `**AI-Optimized Approach:**
|
|
90
|
+
${domain ? `Given the ${domain} domain, I'll apply the most effective combination of:` : 'I\'ll intelligently combine multiple methodologies:'}
|
|
91
|
+
- Divergent exploration with domain-specific knowledge
|
|
92
|
+
- SCAMPER triggers and lateral thinking
|
|
93
|
+
- Human-centered perspective for practical value`
|
|
94
|
+
};
|
|
95
|
+
return methodologies[methodology] || methodologies['auto'];
|
|
96
|
+
}
|
|
97
|
+
const brainstormArgsSchema = z.object({
|
|
98
|
+
prompt: z.string().min(1).describe("Primary brainstorming challenge or question to explore"),
|
|
99
|
+
model: z.string().optional().describe("Optional model to use (e.g., 'gemini-3-flash'). If not specified, uses the default model (gemini-3-pro)."),
|
|
100
|
+
methodology: z.enum(['divergent', 'convergent', 'scamper', 'design-thinking', 'lateral', 'auto']).default('auto').describe("Brainstorming framework: 'divergent' (generate many ideas), 'convergent' (refine existing), 'scamper' (systematic triggers), 'design-thinking' (human-centered), 'lateral' (unexpected connections), 'auto' (AI selects best)"),
|
|
101
|
+
domain: z.string().optional().describe("Domain context for specialized brainstorming (e.g., 'software', 'business', 'creative', 'research', 'product', 'marketing')"),
|
|
102
|
+
constraints: z.string().optional().describe("Known limitations, requirements, or boundaries (budget, time, technical, legal, etc.)"),
|
|
103
|
+
existingContext: z.string().optional().describe("Background information, previous attempts, or current state to build upon"),
|
|
104
|
+
ideaCount: z.number().int().positive().default(12).describe("Target number of ideas to generate (default: 10-15)"),
|
|
105
|
+
includeAnalysis: z.boolean().default(true).describe("Include feasibility, impact, and implementation analysis for generated ideas"),
|
|
106
|
+
});
|
|
107
|
+
export const brainstormTool = {
|
|
108
|
+
name: "brainstorm",
|
|
109
|
+
description: "Generate novel ideas with dynamic context gathering. --> Creative frameworks (SCAMPER, Design Thinking, etc.), domain context integration, idea clustering, feasibility analysis, and iterative refinement.",
|
|
110
|
+
zodSchema: brainstormArgsSchema,
|
|
111
|
+
prompt: {
|
|
112
|
+
description: "Generate structured brainstorming prompt with methodology-driven ideation, domain context integration, and analytical evaluation framework",
|
|
113
|
+
},
|
|
114
|
+
category: 'gemini',
|
|
115
|
+
execute: async (args, onProgress) => {
|
|
116
|
+
const { prompt, model, methodology = 'auto', domain, constraints, existingContext, ideaCount = 12, includeAnalysis = true } = args;
|
|
117
|
+
if (!prompt?.trim()) {
|
|
118
|
+
throw new Error("You must provide a valid brainstorming challenge or question to explore");
|
|
119
|
+
}
|
|
120
|
+
let enhancedPrompt = buildBrainstormPrompt({
|
|
121
|
+
prompt: prompt.trim(),
|
|
122
|
+
methodology: methodology,
|
|
123
|
+
domain: domain,
|
|
124
|
+
constraints: constraints,
|
|
125
|
+
existingContext: existingContext,
|
|
126
|
+
ideaCount: ideaCount,
|
|
127
|
+
includeAnalysis: includeAnalysis
|
|
128
|
+
});
|
|
129
|
+
Logger.debug(`Brainstorm: Using methodology '${methodology}' for domain '${domain || 'general'}'`);
|
|
130
|
+
// Report progress to user
|
|
131
|
+
onProgress?.(`Generating ${ideaCount} ideas via ${methodology} methodology...`);
|
|
132
|
+
// Execute with Gemini
|
|
133
|
+
return await executeGeminiCLI(enhancedPrompt, model, false, false, onProgress);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
//# 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,KAAK,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,SAAS,q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AM,EACN,KAAK,EACL,WAAW,GAAG,MAAM,EACpB,MAAM,EACN,WAAW,EACX,eAAe,EACf,SAAS,GAAG,EAAE,EACd,eAAe,GAAG,IAAI,EACvB,GAAG,IAAI,CAAC;QAET,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC7F,CAAC;QAED,IAAI,cAAc,GAAG,qBAAqB,CAAC;YACzC,MAAM,EAAE,MAAM,CAAC,IAAI,EAAY;YAC/B,WAAW,EAAE,WAAqB;YAClC,MAAM,EAAE,MAA4B;YACpC,WAAW,EAAE,WAAiC;YAC9C,eAAe,EAAE,eAAqC;YACtD,SAAS,EAAE,SAAmB;YAC9B,eAAe,EAAE,eAA0B;SAC5C,CAAC,CAAC;QAEH,MAAM,CAAC,KAAK,CAAC,kCAAkC,WAAW,iBAAiB,MAAM,IAAI,SAAS,GAAG,CAAC,CAAC;QAEnG,0BAA0B;QAC1B,UAAU,EAAE,CAAC,cAAc,SAAS,cAAc,WAAW,iBAAiB,CAAC,CAAC;QAEhF,sBAAsB;QACtB,OAAO,MAAM,gBAAgB,CAAC,cAAc,EAAE,KAA2B,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IACvG,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-chunk.tool.d.ts","sourceRoot":"","sources":["../../src/tools/fetch-chunk.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAU5C,eAAO,MAAM,cAAc,EAAE,WAoE5B,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { getChunks } from '../utils/chunkCache.js';
|
|
3
|
+
import { formatChangeModeResponse, summarizeChangeModeEdits } from '../utils/changeModeTranslator.js';
|
|
4
|
+
import { Logger } from '../utils/logger.js';
|
|
5
|
+
const inputSchema = z.object({
|
|
6
|
+
cacheKey: z.string().describe("The cache key provided in the initial changeMode response"),
|
|
7
|
+
chunkIndex: z.number().min(1).describe("Which chunk to retrieve (1-based index)")
|
|
8
|
+
});
|
|
9
|
+
export const fetchChunkTool = {
|
|
10
|
+
name: 'fetch-chunk',
|
|
11
|
+
description: 'Retrieves cached chunks from a changeMode response. Use this to get subsequent chunks after receiving a partial changeMode response.',
|
|
12
|
+
zodSchema: inputSchema,
|
|
13
|
+
prompt: {
|
|
14
|
+
description: 'Fetch the next chunk of a response',
|
|
15
|
+
arguments: [
|
|
16
|
+
{
|
|
17
|
+
name: 'prompt',
|
|
18
|
+
description: 'fetch-chunk cacheKey=<key> chunkIndex=<number>',
|
|
19
|
+
required: true
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
category: 'utility',
|
|
24
|
+
execute: async (args, onProgress) => {
|
|
25
|
+
const { cacheKey, chunkIndex } = args;
|
|
26
|
+
Logger.toolInvocation('fetch-chunk', args);
|
|
27
|
+
Logger.debug(`Fetching chunk ${chunkIndex} with cache key: ${cacheKey}`);
|
|
28
|
+
// Retrieve cached chunks
|
|
29
|
+
const chunks = getChunks(cacheKey);
|
|
30
|
+
if (!chunks) {
|
|
31
|
+
return `❌ Cache miss: No chunks found for cache key "${cacheKey}".
|
|
32
|
+
|
|
33
|
+
Possible reasons:
|
|
34
|
+
1. The cache key is incorrect, Have you ran ask-gemini with changeMode enabled?
|
|
35
|
+
2. The cache has expired (10 minute TTL)
|
|
36
|
+
3. The MCP server was restarted and the file-based cache was cleared
|
|
37
|
+
|
|
38
|
+
Please re-run the original changeMode request to regenerate the chunks.`;
|
|
39
|
+
}
|
|
40
|
+
// Validate chunk index
|
|
41
|
+
if (chunkIndex < 1 || chunkIndex > chunks.length) {
|
|
42
|
+
return `❌ Invalid chunk index: ${chunkIndex}
|
|
43
|
+
|
|
44
|
+
Available chunks: 1 to ${chunks.length}
|
|
45
|
+
You requested: ${chunkIndex}
|
|
46
|
+
|
|
47
|
+
Please use a valid chunk index.`;
|
|
48
|
+
}
|
|
49
|
+
// Get the requested chunk
|
|
50
|
+
const chunk = chunks[chunkIndex - 1];
|
|
51
|
+
// Format the response
|
|
52
|
+
let result = formatChangeModeResponse(chunk.edits, { current: chunkIndex, total: chunks.length, cacheKey });
|
|
53
|
+
// Add summary for first chunk
|
|
54
|
+
if (chunkIndex === 1 && chunks.length > 1) {
|
|
55
|
+
const allEdits = chunks.flatMap(c => c.edits);
|
|
56
|
+
result = summarizeChangeModeEdits(allEdits, true) + '\n\n' + result;
|
|
57
|
+
}
|
|
58
|
+
Logger.debug(`Returning chunk ${chunkIndex} of ${chunks.length} with ${chunk.edits.length} edits`);
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=fetch-chunk.tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-chunk.tool.js","sourceRoot":"","sources":["../../src/tools/fetch-chunk.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AACtG,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,2DAA2D,CAAC;IAC1F,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CAClF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAgB;IACzC,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,sIAAsI;IAEn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AAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YAC9C,MAAM,GAAG,wBAAwB,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC;QACtE,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,mBAAmB,UAAU,OAAO,MAAM,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;QAEnG,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAiBA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Tool Registry Index - Registers all tools
|
|
2
|
+
import { toolRegistry } from './registry.js';
|
|
3
|
+
import { askGeminiTool } from './ask-gemini.tool.js';
|
|
4
|
+
import { pingTool, helpTool } from './simple-tools.js';
|
|
5
|
+
import { brainstormTool } from './brainstorm.tool.js';
|
|
6
|
+
import { fetchChunkTool } from './fetch-chunk.tool.js';
|
|
7
|
+
import { timeoutTestTool } from './timeout-test.tool.js';
|
|
8
|
+
toolRegistry.push(askGeminiTool, pingTool, helpTool, brainstormTool, fetchChunkTool, timeoutTestTool);
|
|
9
|
+
export * from './registry.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,YAAY,CAAC,IAAI,CACf,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,cAAc,EACd,eAAe,CAChB,CAAC;AAEF,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Tool, Prompt } from "@modelcontextprotocol/sdk/types.js";
|
|
2
|
+
import { ToolArguments } from "../constants.js";
|
|
3
|
+
import { ZodTypeAny } from "zod";
|
|
4
|
+
export interface UnifiedTool {
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
zodSchema: ZodTypeAny;
|
|
8
|
+
prompt?: {
|
|
9
|
+
description: string;
|
|
10
|
+
arguments?: Array<{
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
};
|
|
16
|
+
execute: (args: ToolArguments, onProgress?: (newOutput: string) => void) => Promise<string>;
|
|
17
|
+
category?: 'simple' | 'gemini' | 'utility';
|
|
18
|
+
}
|
|
19
|
+
export declare const toolRegistry: UnifiedTool[];
|
|
20
|
+
export declare function toolExists(toolName: string): boolean;
|
|
21
|
+
export declare function getToolDefinitions(): Tool[];
|
|
22
|
+
export declare function getPromptDefinitions(): Prompt[];
|
|
23
|
+
export declare function executeTool(toolName: string, args: ToolArguments, onProgress?: (newOutput: string) => void): Promise<string>;
|
|
24
|
+
export declare function getPromptMessage(toolName: string, args: Record<string, any>): string;
|
|
25
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD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
|
5
|
+
return toolRegistry.some(t => t.name === toolName);
|
|
6
|
+
}
|
|
7
|
+
export function getToolDefinitions() {
|
|
8
|
+
return toolRegistry.map(tool => {
|
|
9
|
+
const raw = zodToJsonSchema(tool.zodSchema, tool.name);
|
|
10
|
+
const def = raw.definitions?.[tool.name] ?? raw;
|
|
11
|
+
const inputSchema = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: def.properties || {},
|
|
14
|
+
required: def.required || [],
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
name: tool.name,
|
|
18
|
+
description: tool.description,
|
|
19
|
+
inputSchema,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function extractPromptArguments(zodSchema) {
|
|
24
|
+
const jsonSchema = zodToJsonSchema(zodSchema);
|
|
25
|
+
const properties = jsonSchema.properties || {};
|
|
26
|
+
const required = jsonSchema.required || [];
|
|
27
|
+
return Object.entries(properties).map(([name, prop]) => ({
|
|
28
|
+
name,
|
|
29
|
+
description: prop.description || `${name} parameter`,
|
|
30
|
+
required: required.includes(name)
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
export function getPromptDefinitions() {
|
|
34
|
+
return toolRegistry
|
|
35
|
+
.filter(tool => tool.prompt)
|
|
36
|
+
.map(tool => ({
|
|
37
|
+
name: tool.name,
|
|
38
|
+
description: tool.prompt.description,
|
|
39
|
+
arguments: tool.prompt.arguments || extractPromptArguments(tool.zodSchema),
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
export async function executeTool(toolName, args, onProgress) {
|
|
43
|
+
const tool = toolRegistry.find(t => t.name === toolName);
|
|
44
|
+
if (!tool) {
|
|
45
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const validatedArgs = tool.zodSchema.parse(args);
|
|
49
|
+
return tool.execute(validatedArgs, onProgress);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error instanceof ZodError) {
|
|
53
|
+
const issues = error.issues.map(issue => `${issue.path.join('.')}: ${issue.message}`).join(', ');
|
|
54
|
+
throw new Error(`Invalid arguments for ${toolName}: ${issues}`);
|
|
55
|
+
}
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export function getPromptMessage(toolName, args) {
|
|
60
|
+
const tool = toolRegistry.find(t => t.name === toolName);
|
|
61
|
+
if (!tool?.prompt) {
|
|
62
|
+
throw new Error(`No prompt defined for tool: ${toolName}`);
|
|
63
|
+
}
|
|
64
|
+
const paramStrings = [];
|
|
65
|
+
if (args.prompt) {
|
|
66
|
+
paramStrings.push(args.prompt);
|
|
67
|
+
}
|
|
68
|
+
Object.entries(args).forEach(([key, value]) => {
|
|
69
|
+
if (key !== 'prompt' && value !== undefined && value !== null && value !== false) {
|
|
70
|
+
if (typeof value === 'boolean' && value) {
|
|
71
|
+
paramStrings.push(`[${key}]`);
|
|
72
|
+
}
|
|
73
|
+
else if (typeof value !== 'boolean') {
|
|
74
|
+
paramStrings.push(`(${key}: ${value})`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return `Use the ${toolName} tool${paramStrings.length > 0 ? ': ' + paramStrings.join(' ') : ''}`;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/tools/registry.ts"],"names":[],"mappings":"AAGA,OAAO,EAAc,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAoBrD,MAAM,CAAC,MAAM,YAAY,GAAkB,EAAE,CAAC;AAC9C,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CA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E,WAYtB,CAAC;AAIF,eAAO,MAAM,QAAQ,EAAE,WAWtB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeCommand } from '../utils/commandExecutor.js';
|
|
3
|
+
const pingArgsSchema = z.object({
|
|
4
|
+
prompt: z.string().default('').describe("Message to echo "),
|
|
5
|
+
});
|
|
6
|
+
export const pingTool = {
|
|
7
|
+
name: "ping",
|
|
8
|
+
description: "Echo",
|
|
9
|
+
zodSchema: pingArgsSchema,
|
|
10
|
+
prompt: {
|
|
11
|
+
description: "Echo test message with structured response.",
|
|
12
|
+
},
|
|
13
|
+
category: 'simple',
|
|
14
|
+
execute: async (args, onProgress) => {
|
|
15
|
+
const message = args.prompt || args.message || "Pong!";
|
|
16
|
+
return executeCommand("echo", [message], onProgress);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const helpArgsSchema = z.object({});
|
|
20
|
+
export const helpTool = {
|
|
21
|
+
name: "Help",
|
|
22
|
+
description: "receive help information",
|
|
23
|
+
zodSchema: helpArgsSchema,
|
|
24
|
+
prompt: {
|
|
25
|
+
description: "receive help information",
|
|
26
|
+
},
|
|
27
|
+
category: 'simple',
|
|
28
|
+
execute: async (args, onProgress) => {
|
|
29
|
+
return executeCommand("gemini", ["-help"], onProgress);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=simple-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple-tools.js","sourceRoot":"","sources":["../../src/tools/simple-tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAE7D,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC;CAC5D,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAgB;IACnC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE;QACN,WAAW,EAAE,6CAA6C;KAC3D;IACD,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC;QACvD,OAAO,cAAc,CAAC,MAAM,EAAE,CAAC,OAAiB,CAAC,EAAE,UAAU,CAAC,CAAC;IACjE,CAAC;CACF,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAEpC,MAAM,CAAC,MAAM,QAAQ,GAAgB;IACnC,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,0BAA0B;IACvC,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE;QACN,WAAW,EAAE,0BAA0B;KACxC;IACD,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE;QAClC,OAAO,cAAc,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;IACzD,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example: Adding a new tool with the unified registry
|
|
3
|
+
* To add this tool:
|
|
4
|
+
* 1. Rename this file to remove .example (test-tool.ts)
|
|
5
|
+
* 2. Import and register in src/tools/index.ts:
|
|
6
|
+
* import { testTool } from './test-tool.js';
|
|
7
|
+
* toolRegistry.push(testTool);
|
|
8
|
+
*
|
|
9
|
+
* That's it! No more editing multiple files.
|
|
10
|
+
*/
|
|
11
|
+
import { UnifiedTool } from './registry.js';
|
|
12
|
+
export declare const testTool: UnifiedTool;
|
|
13
|
+
//# sourceMappingURL=test-tool.example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-tool.example.d.ts","sourceRoot":"","sources":["../../src/tools/test-tool.example.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,eAAO,MAAM,QAAQ,EAAE,WAgBtB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example: Adding a new tool with the unified registry
|
|
3
|
+
* To add this tool:
|
|
4
|
+
* 1. Rename this file to remove .example (test-tool.ts)
|
|
5
|
+
* 2. Import and register in src/tools/index.ts:
|
|
6
|
+
* import { testTool } from './test-tool.js';
|
|
7
|
+
* toolRegistry.push(testTool);
|
|
8
|
+
*
|
|
9
|
+
* That's it! No more editing multiple files.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
const testToolArgsSchema = z.object({
|
|
13
|
+
message: z.string().describe("Test message to echo"), // Required field (no .optional())
|
|
14
|
+
});
|
|
15
|
+
export const testTool = {
|
|
16
|
+
name: "test-tool",
|
|
17
|
+
description: "A test tool demonstrating the simplified registration",
|
|
18
|
+
zodSchema: testToolArgsSchema,
|
|
19
|
+
prompt: {
|
|
20
|
+
description: "Test the new unified tool registration",
|
|
21
|
+
arguments: [{
|
|
22
|
+
name: "message",
|
|
23
|
+
description: "Message to test with",
|
|
24
|
+
required: true
|
|
25
|
+
}]
|
|
26
|
+
},
|
|
27
|
+
category: 'utility',
|
|
28
|
+
execute: async (args) => {
|
|
29
|
+
return `Test tool received: ${args.message}`;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=test-tool.example.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-tool.example.js","sourceRoot":"","sources":["../../src/tools/test-tool.example.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,kCAAkC;CACzF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,QAAQ,GAAgB;IACnC,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,uDAAuD;IACpE,SAAS,EAAE,kBAAkB;IAC7B,MAAM,EAAE;QACN,WAAW,EAAE,wCAAwC;QACrD,SAAS,EAAE,CAAC;gBACV,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,sBAAsB;gBACnC,QAAQ,EAAE,IAAI;aACf,CAAC;KACH;IACD,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,OAAO,uBAAuB,IAAI,CAAC,OAAO,EAAE,CAAC;IAC/C,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timeout-test.tool.d.ts","sourceRoot":"","sources":["../../src/tools/timeout-test.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C,eAAO,MAAM,eAAe,EAAE,WA8B7B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const timeoutTestArgsSchema = z.object({
|
|
3
|
+
duration: z.number().min(10).describe("Duration in milliseconds (minimum 10ms)"),
|
|
4
|
+
});
|
|
5
|
+
export const timeoutTestTool = {
|
|
6
|
+
name: "timeout-test",
|
|
7
|
+
description: "Test timeout prevention by running for a specified duration",
|
|
8
|
+
zodSchema: timeoutTestArgsSchema,
|
|
9
|
+
prompt: {
|
|
10
|
+
description: "Test the timeout prevention system by running a long operation",
|
|
11
|
+
},
|
|
12
|
+
category: 'simple',
|
|
13
|
+
execute: async (args, onProgress) => {
|
|
14
|
+
const duration = args.duration;
|
|
15
|
+
const steps = Math.ceil(duration / 5000); // Progress every 5 seconds
|
|
16
|
+
const stepDuration = duration / steps;
|
|
17
|
+
const startTime = Date.now();
|
|
18
|
+
const results = [];
|
|
19
|
+
results.push(`Starting timeout test for ${duration}ms (${duration / 1000}s)`);
|
|
20
|
+
for (let i = 1; i <= steps; i++) {
|
|
21
|
+
await new Promise(resolve => setTimeout(resolve, stepDuration));
|
|
22
|
+
const elapsed = Date.now() - startTime;
|
|
23
|
+
results.push(`Step ${i}/${steps} completed - Elapsed: ${Math.round(elapsed / 1000)}s`);
|
|
24
|
+
}
|
|
25
|
+
const totalElapsed = Date.now() - startTime;
|
|
26
|
+
results.push(`\nTimeout test completed successfully!`);
|
|
27
|
+
results.push(`Target duration: ${duration}ms`);
|
|
28
|
+
results.push(`Actual duration: ${totalElapsed}ms`);
|
|
29
|
+
return results.join('\n');
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//# 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,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;CACjF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,6DAA6D;IAC1E,SAAS,EAAE,qBAAqB;IAChC,MAAM,EAAE;QACN,WAAW,EAAE,gEAAgE;KAC9E;IACD,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE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Chunk {
|
|
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;AAgBD,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,cAAc,EAAE,EACvB,gBAAgB,GAAE,MAAc,GAC/B,SAAS,EAAE,CAyDb;AAgBD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAc7D"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
edits: [],
|
|
19
|
+
chunkIndex: 1,
|
|
20
|
+
totalChunks: 1,
|
|
21
|
+
hasMore: false,
|
|
22
|
+
estimatedChars: 0
|
|
23
|
+
}];
|
|
24
|
+
}
|
|
25
|
+
const chunks = [];
|
|
26
|
+
const fileGroups = groupEditsByFile(edits);
|
|
27
|
+
let currentChunk = [];
|
|
28
|
+
let currentSize = 0;
|
|
29
|
+
for (const [filename, fileEdits] of fileGroups) {
|
|
30
|
+
const fileSize = fileEdits.reduce((sum, edit) => sum + estimateEditSize(edit), 0);
|
|
31
|
+
if (fileSize > maxCharsPerChunk) {
|
|
32
|
+
if (currentChunk.length > 0) {
|
|
33
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
34
|
+
currentChunk = [];
|
|
35
|
+
currentSize = 0;
|
|
36
|
+
}
|
|
37
|
+
for (const edit of fileEdits) {
|
|
38
|
+
const editSize = estimateEditSize(edit);
|
|
39
|
+
if (currentSize + editSize > maxCharsPerChunk && currentChunk.length > 0) {
|
|
40
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
41
|
+
currentChunk = [];
|
|
42
|
+
currentSize = 0;
|
|
43
|
+
}
|
|
44
|
+
currentChunk.push(edit);
|
|
45
|
+
currentSize += editSize;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
if (currentSize + fileSize > maxCharsPerChunk && currentChunk.length > 0) {
|
|
50
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
51
|
+
currentChunk = [];
|
|
52
|
+
currentSize = 0;
|
|
53
|
+
}
|
|
54
|
+
currentChunk.push(...fileEdits);
|
|
55
|
+
currentSize += fileSize;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (currentChunk.length > 0) {
|
|
59
|
+
chunks.push(createChunk(currentChunk, chunks.length + 1, 0, currentSize));
|
|
60
|
+
}
|
|
61
|
+
const totalChunks = chunks.length;
|
|
62
|
+
return chunks.map((chunk, index) => ({
|
|
63
|
+
...chunk,
|
|
64
|
+
totalChunks,
|
|
65
|
+
hasMore: index < totalChunks - 1
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
function createChunk(edits, chunkIndex, totalChunks, estimatedChars) {
|
|
69
|
+
return {
|
|
70
|
+
edits,
|
|
71
|
+
chunkIndex,
|
|
72
|
+
totalChunks,
|
|
73
|
+
hasMore: false,
|
|
74
|
+
estimatedChars
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export function summarizeChunking(chunks) {
|
|
78
|
+
const totalEdits = chunks.reduce((sum, chunk) => sum + chunk.edits.length, 0);
|
|
79
|
+
const totalChars = chunks.reduce((sum, chunk) => sum + chunk.estimatedChars, 0);
|
|
80
|
+
return `Chunking Summary:
|
|
81
|
+
# edits: ${totalEdits}
|
|
82
|
+
# chunks: ${chunks.length}
|
|
83
|
+
est chars: ${totalChars.toLocaleString()}
|
|
84
|
+
mean size: ${Math.round(totalChars / chunks.length).toLocaleString()} chars
|
|
85
|
+
|
|
86
|
+
Chunks:
|
|
87
|
+
${chunks.map(chunk => ` Chunk ${chunk.chunkIndex}: ${chunk.edits.length} edits, ~${chunk.estimatedChars.toLocaleString()} chars`).join('\n')}`;
|
|
88
|
+
}
|
|
89
|
+
//# 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;IAAC,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAA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