@etheaven/codex-mcp-server 1.3.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/.claude-plugin/marketplace.json +26 -0
- package/.claude-plugin/plugin.json +13 -0
- package/.mcp.json +8 -0
- package/LICENSE +21 -0
- package/README.md +450 -0
- package/dist/constants.d.ts +165 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +154 -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 +195 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/ask-codex.tool.d.ts +3 -0
- package/dist/tools/ask-codex.tool.d.ts.map +1 -0
- package/dist/tools/ask-codex.tool.js +263 -0
- package/dist/tools/ask-codex.tool.js.map +1 -0
- package/dist/tools/batch-codex.tool.d.ts +3 -0
- package/dist/tools/batch-codex.tool.d.ts.map +1 -0
- package/dist/tools/batch-codex.tool.js +140 -0
- package/dist/tools/batch-codex.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 +171 -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 +66 -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 +14 -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 +84 -0
- package/dist/tools/registry.js.map +1 -0
- package/dist/tools/simple-tools.d.ts +5 -0
- package/dist/tools/simple-tools.d.ts.map +1 -0
- package/dist/tools/simple-tools.js +64 -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 +34 -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 +93 -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/changeModeRunner.d.ts +11 -0
- package/dist/utils/changeModeRunner.d.ts.map +1 -0
- package/dist/utils/changeModeRunner.js +133 -0
- package/dist/utils/changeModeRunner.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 +69 -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/codexExecutor.d.ts +47 -0
- package/dist/utils/codexExecutor.d.ts.map +1 -0
- package/dist/utils/codexExecutor.js +296 -0
- package/dist/utils/codexExecutor.js.map +1 -0
- package/dist/utils/commandExecutor.d.ts +29 -0
- package/dist/utils/commandExecutor.d.ts.map +1 -0
- package/dist/utils/commandExecutor.js +158 -0
- package/dist/utils/commandExecutor.js.map +1 -0
- package/dist/utils/logger.d.ts +20 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +83 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/outputParser.d.ts +26 -0
- package/dist/utils/outputParser.d.ts.map +1 -0
- package/dist/utils/outputParser.js +174 -0
- package/dist/utils/outputParser.js.map +1 -0
- package/dist/utils/reviewParser.d.ts +28 -0
- package/dist/utils/reviewParser.d.ts.map +1 -0
- package/dist/utils/reviewParser.js +87 -0
- package/dist/utils/reviewParser.js.map +1 -0
- package/dist/utils/workingDirResolver.d.ts +47 -0
- package/dist/utils/workingDirResolver.d.ts.map +1 -0
- package/dist/utils/workingDirResolver.js +199 -0
- package/dist/utils/workingDirResolver.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"batch-codex.tool.d.ts","sourceRoot":"","sources":["../../src/tools/batch-codex.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAyC5C,eAAO,MAAM,cAAc,EAAE,WA+I5B,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { executeCodex } from '../utils/codexExecutor.js';
|
|
3
|
+
import { SANDBOX_MODES } from '../constants.js';
|
|
4
|
+
// Define task type for batch operations
|
|
5
|
+
const batchTaskSchema = z.object({
|
|
6
|
+
task: z.string().describe('Atomic task description'),
|
|
7
|
+
target: z.string().optional().describe('Target files/directories (use @ syntax)'),
|
|
8
|
+
priority: z.enum(['high', 'normal', 'low']).default('normal').describe('Task priority'),
|
|
9
|
+
});
|
|
10
|
+
const batchCodexArgsSchema = z.object({
|
|
11
|
+
tasks: z.array(batchTaskSchema).min(1).describe('Array of atomic tasks to delegate to Codex'),
|
|
12
|
+
model: z
|
|
13
|
+
.string()
|
|
14
|
+
.optional()
|
|
15
|
+
.describe('Model ID. Recommended: gpt-5.4 (default), gpt-5.3-codex (coding), o3 (reasoning), o4-mini (fast). ' +
|
|
16
|
+
'Use exact model IDs as listed.'),
|
|
17
|
+
reasoningEffort: z
|
|
18
|
+
.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh'])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Reasoning effort: none, minimal, low, medium, high, xhigh.'),
|
|
21
|
+
sandbox: z
|
|
22
|
+
.string()
|
|
23
|
+
.default(SANDBOX_MODES.WORKSPACE_WRITE)
|
|
24
|
+
.describe(`Sandbox mode: ${Object.values(SANDBOX_MODES).join(', ')}`),
|
|
25
|
+
parallel: z.boolean().default(false).describe('Execute tasks in parallel (experimental)'),
|
|
26
|
+
stopOnError: z.boolean().default(true).describe('Stop execution if any task fails'),
|
|
27
|
+
timeout: z.number().optional().describe('Maximum execution time per task in milliseconds'),
|
|
28
|
+
workingDir: z.string().optional().describe('Working directory for execution'),
|
|
29
|
+
search: z
|
|
30
|
+
.boolean()
|
|
31
|
+
.optional()
|
|
32
|
+
.describe('Enable web search for all tasks (activates web_search_request feature)'),
|
|
33
|
+
oss: z.boolean().optional().describe('Use local Ollama server'),
|
|
34
|
+
enableFeatures: z.array(z.string()).optional().describe('Enable feature flags'),
|
|
35
|
+
disableFeatures: z.array(z.string()).optional().describe('Disable feature flags'),
|
|
36
|
+
});
|
|
37
|
+
export const batchCodexTool = {
|
|
38
|
+
name: 'batch-codex',
|
|
39
|
+
description: 'Delegate multiple atomic tasks to Codex for batch processing. Ideal for repetitive operations, mass refactoring, and automated code transformations',
|
|
40
|
+
zodSchema: batchCodexArgsSchema,
|
|
41
|
+
prompt: {
|
|
42
|
+
description: 'Execute multiple atomic Codex tasks in batch mode for efficient automation',
|
|
43
|
+
},
|
|
44
|
+
category: 'codex',
|
|
45
|
+
execute: async (args, onProgress) => {
|
|
46
|
+
const { tasks, model, reasoningEffort, sandbox, parallel, stopOnError, timeout, workingDir, search, oss, enableFeatures, disableFeatures, } = args;
|
|
47
|
+
const taskList = tasks;
|
|
48
|
+
if (!taskList || taskList.length === 0) {
|
|
49
|
+
throw new Error('No tasks provided for batch execution');
|
|
50
|
+
}
|
|
51
|
+
const results = [];
|
|
52
|
+
let failedCount = 0;
|
|
53
|
+
let successCount = 0;
|
|
54
|
+
// Sort tasks by priority
|
|
55
|
+
const sortedTasks = [...taskList].sort((a, b) => {
|
|
56
|
+
const priorityOrder = { high: 0, normal: 1, low: 2 };
|
|
57
|
+
return (priorityOrder[a.priority] -
|
|
58
|
+
priorityOrder[b.priority]);
|
|
59
|
+
});
|
|
60
|
+
if (onProgress) {
|
|
61
|
+
onProgress(`🚀 Starting batch execution of ${sortedTasks.length} tasks...`);
|
|
62
|
+
}
|
|
63
|
+
// Execute tasks sequentially
|
|
64
|
+
// TODO: Implement parallel execution when parallel flag is true
|
|
65
|
+
for (let i = 0; i < sortedTasks.length; i++) {
|
|
66
|
+
const task = sortedTasks[i];
|
|
67
|
+
const taskPrompt = task.target ? `${task.task} in ${task.target}` : task.task;
|
|
68
|
+
if (onProgress) {
|
|
69
|
+
onProgress(`\n[${i + 1}/${sortedTasks.length}] Executing: ${taskPrompt}`);
|
|
70
|
+
}
|
|
71
|
+
// Skip remaining tasks if stopOnError is true and we have failures
|
|
72
|
+
if (stopOnError && failedCount > 0) {
|
|
73
|
+
results.push({
|
|
74
|
+
task: taskPrompt,
|
|
75
|
+
status: 'skipped',
|
|
76
|
+
error: 'Skipped due to previous failure',
|
|
77
|
+
});
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
try {
|
|
81
|
+
const result = await executeCodex(taskPrompt, {
|
|
82
|
+
model: model,
|
|
83
|
+
reasoningEffort: reasoningEffort,
|
|
84
|
+
sandboxMode: sandbox,
|
|
85
|
+
timeout: timeout,
|
|
86
|
+
workingDir: workingDir,
|
|
87
|
+
search: search,
|
|
88
|
+
oss: oss,
|
|
89
|
+
enableFeatures: enableFeatures,
|
|
90
|
+
disableFeatures: disableFeatures,
|
|
91
|
+
}, undefined // No progress for individual tasks to keep output clean
|
|
92
|
+
);
|
|
93
|
+
results.push({
|
|
94
|
+
task: taskPrompt,
|
|
95
|
+
status: 'success',
|
|
96
|
+
output: result.substring(0, 500), // Truncate for summary
|
|
97
|
+
});
|
|
98
|
+
successCount++;
|
|
99
|
+
if (onProgress) {
|
|
100
|
+
onProgress(`✅ Completed: ${task.task}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
105
|
+
results.push({
|
|
106
|
+
task: taskPrompt,
|
|
107
|
+
status: 'failed',
|
|
108
|
+
error: errorMessage,
|
|
109
|
+
});
|
|
110
|
+
failedCount++;
|
|
111
|
+
if (onProgress) {
|
|
112
|
+
onProgress(`❌ Failed: ${task.task} - ${errorMessage}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Generate summary report
|
|
117
|
+
let report = `\n📊 **Batch Execution Summary**\n`;
|
|
118
|
+
report += `\n- Total tasks: ${sortedTasks.length}`;
|
|
119
|
+
report += `\n- Successful: ${successCount} ✅`;
|
|
120
|
+
report += `\n- Failed: ${failedCount} ❌`;
|
|
121
|
+
report += `\n- Skipped: ${sortedTasks.length - successCount - failedCount} ⏭️`;
|
|
122
|
+
report += `\n\n**Task Results:**\n`;
|
|
123
|
+
for (const result of results) {
|
|
124
|
+
const icon = result.status === 'success' ? '✅' : result.status === 'failed' ? '❌' : '⏭️';
|
|
125
|
+
report += `\n${icon} **${result.task}**`;
|
|
126
|
+
if (result.status === 'success' && result.output) {
|
|
127
|
+
report += `\n Output: ${result.output.substring(0, 100)}...`;
|
|
128
|
+
}
|
|
129
|
+
else if (result.error) {
|
|
130
|
+
report += `\n Error: ${result.error}`;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// If all tasks failed, throw an error
|
|
134
|
+
if (failedCount === sortedTasks.length) {
|
|
135
|
+
throw new Error(`All ${failedCount} tasks failed. See report above for details.`);
|
|
136
|
+
}
|
|
137
|
+
return report;
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
//# sourceMappingURL=batch-codex.tool.js.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E,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,OAAO,WAAW,8CAA8C,CAAC,CAAC;QACpF,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,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;AA+J5C,eAAO,MAAM,cAAc,EAAE,WAuE5B,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Logger } from '../utils/logger.js';
|
|
3
|
+
import { executeCodexCLI } from '../utils/codexExecutor.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
|
+
## Challenge: ${prompt}
|
|
11
|
+
|
|
12
|
+
## Framework
|
|
13
|
+
${frameworkInstructions}
|
|
14
|
+
|
|
15
|
+
## Context
|
|
16
|
+
${domain ? `Domain: ${domain}` : ''}
|
|
17
|
+
${constraints ? `Constraints: ${constraints}` : ''}
|
|
18
|
+
${existingContext ? `Background: ${existingContext}` : ''}
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
Generate ${ideaCount} actionable ideas. Keep descriptions concise (2-3 sentences max).
|
|
22
|
+
|
|
23
|
+
${includeAnalysis
|
|
24
|
+
? `## Analysis
|
|
25
|
+
Rate each: Feasibility (1-5), Impact (1-5), Innovation (1-5)`
|
|
26
|
+
: ''}
|
|
27
|
+
|
|
28
|
+
## Format
|
|
29
|
+
### Idea [N]: [Name]
|
|
30
|
+
Description: [2-3 sentences]
|
|
31
|
+
${includeAnalysis ? 'Ratings: F:[1-5] I:[1-5] N:[1-5]' : ''}
|
|
32
|
+
|
|
33
|
+
Begin:`;
|
|
34
|
+
return enhancedPrompt;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Returns methodology-specific instructions for structured brainstorming
|
|
38
|
+
*/
|
|
39
|
+
function getMethodologyInstructions(methodology, domain) {
|
|
40
|
+
const methodologies = {
|
|
41
|
+
divergent: `**Divergent Thinking Approach:**
|
|
42
|
+
- Generate maximum quantity of ideas without self-censoring
|
|
43
|
+
- Build on wild or seemingly impractical ideas
|
|
44
|
+
- Combine unrelated concepts for unexpected solutions
|
|
45
|
+
- Use "Yes, and..." thinking to expand each concept
|
|
46
|
+
- Postpone evaluation until all ideas are generated`,
|
|
47
|
+
convergent: `**Convergent Thinking Approach:**
|
|
48
|
+
- Focus on refining and improving existing concepts
|
|
49
|
+
- Synthesize related ideas into stronger solutions
|
|
50
|
+
- Apply critical evaluation criteria
|
|
51
|
+
- Prioritize based on feasibility and impact
|
|
52
|
+
- Develop implementation pathways for top ideas`,
|
|
53
|
+
scamper: `**SCAMPER Creative Triggers:**
|
|
54
|
+
- **Substitute:** What can be substituted or replaced?
|
|
55
|
+
- **Combine:** What can be combined or merged?
|
|
56
|
+
- **Adapt:** What can be adapted from other domains?
|
|
57
|
+
- **Modify:** What can be magnified, minimized, or altered?
|
|
58
|
+
- **Put to other use:** How else can this be used?
|
|
59
|
+
- **Eliminate:** What can be removed or simplified?
|
|
60
|
+
- **Reverse:** What can be rearranged or reversed?`,
|
|
61
|
+
'design-thinking': `**Human-Centered Design Thinking:**
|
|
62
|
+
- **Empathize:** Consider user needs, pain points, and contexts
|
|
63
|
+
- **Define:** Frame problems from user perspective
|
|
64
|
+
- **Ideate:** Generate user-focused solutions
|
|
65
|
+
- **Consider Journey:** Think through complete user experience
|
|
66
|
+
- **Prototype Mindset:** Focus on testable, iterative concepts`,
|
|
67
|
+
lateral: `**Lateral Thinking Approach:**
|
|
68
|
+
- Make unexpected connections between unrelated fields
|
|
69
|
+
- Challenge fundamental assumptions
|
|
70
|
+
- Use random word association to trigger new directions
|
|
71
|
+
- Apply metaphors and analogies from other domains
|
|
72
|
+
- Reverse conventional thinking patterns`,
|
|
73
|
+
auto: `**AI-Optimized Approach:**
|
|
74
|
+
${domain ? `Given the ${domain} domain, I'll apply the most effective combination of:` : "I'll intelligently combine multiple methodologies:"}
|
|
75
|
+
- Divergent exploration with domain-specific knowledge
|
|
76
|
+
- SCAMPER triggers and lateral thinking
|
|
77
|
+
- Human-centered perspective for practical value`,
|
|
78
|
+
};
|
|
79
|
+
return methodologies[methodology] || methodologies['auto'];
|
|
80
|
+
}
|
|
81
|
+
const brainstormArgsSchema = z.object({
|
|
82
|
+
prompt: z.string().min(1).describe('Brainstorming challenge or question'),
|
|
83
|
+
model: z
|
|
84
|
+
.string()
|
|
85
|
+
.optional()
|
|
86
|
+
.describe('Model ID. Recommended: gpt-5.4 (default), o3 (deep reasoning), gpt-5.3-codex (coding). ' +
|
|
87
|
+
'All valid IDs: gpt-5.4, gpt-5.4-pro, gpt-5.3-codex, gpt-5.2-codex, gpt-5.2, gpt-5.1, ' +
|
|
88
|
+
'gpt-5, gpt-5-mini, gpt-5-nano, o3, o3-pro, o4-mini, gpt-4.1, gpt-4.1-mini, gpt-4.1-nano.'),
|
|
89
|
+
reasoningEffort: z
|
|
90
|
+
.enum(['none', 'minimal', 'low', 'medium', 'high', 'xhigh'])
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Reasoning effort: none, minimal, low, medium (default), high, xhigh. ' +
|
|
93
|
+
'Higher = deeper analysis, slower, more expensive.'),
|
|
94
|
+
approvalPolicy: z
|
|
95
|
+
.enum(['never', 'on-request', 'on-failure', 'untrusted'])
|
|
96
|
+
.optional()
|
|
97
|
+
.describe('Approval: never, on-request, on-failure, untrusted'),
|
|
98
|
+
sandboxMode: z
|
|
99
|
+
.enum(['read-only', 'workspace-write', 'danger-full-access'])
|
|
100
|
+
.optional()
|
|
101
|
+
.describe('Access: read-only, workspace-write, danger-full-access'),
|
|
102
|
+
fullAuto: z.boolean().optional().describe('Full automation mode'),
|
|
103
|
+
yolo: z.boolean().optional().describe('⚠️ Bypass all safety (dangerous)'),
|
|
104
|
+
cd: z.string().optional().describe('Working directory'),
|
|
105
|
+
methodology: z
|
|
106
|
+
.enum(['divergent', 'convergent', 'scamper', 'design-thinking', 'lateral', 'auto'])
|
|
107
|
+
.default('auto')
|
|
108
|
+
.describe('Framework: divergent, convergent, scamper, design-thinking, lateral, auto (default)'),
|
|
109
|
+
domain: z
|
|
110
|
+
.string()
|
|
111
|
+
.optional()
|
|
112
|
+
.describe('Domain: software, business, creative, research, product, marketing, etc.'),
|
|
113
|
+
constraints: z.string().optional().describe('Limitations: budget, time, technical, legal, etc.'),
|
|
114
|
+
existingContext: z.string().optional().describe('Background info or previous attempts'),
|
|
115
|
+
ideaCount: z
|
|
116
|
+
.number()
|
|
117
|
+
.int()
|
|
118
|
+
.positive()
|
|
119
|
+
.default(12)
|
|
120
|
+
.describe('Number of ideas (default: 12, range: 5-30)'),
|
|
121
|
+
includeAnalysis: z.boolean().default(true).describe('Include feasibility/impact analysis'),
|
|
122
|
+
search: z
|
|
123
|
+
.boolean()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe('Enable web search for research (activates web_search_request feature)'),
|
|
126
|
+
oss: z.boolean().optional().describe('Use local Ollama server'),
|
|
127
|
+
enableFeatures: z.array(z.string()).optional().describe('Enable feature flags'),
|
|
128
|
+
disableFeatures: z.array(z.string()).optional().describe('Disable feature flags'),
|
|
129
|
+
});
|
|
130
|
+
export const brainstormTool = {
|
|
131
|
+
name: 'brainstorm',
|
|
132
|
+
description: 'Generate creative ideas using structured frameworks with domain context and feasibility analysis.',
|
|
133
|
+
zodSchema: brainstormArgsSchema,
|
|
134
|
+
prompt: {
|
|
135
|
+
description: 'Create structured brainstorming with chosen methodology and analysis',
|
|
136
|
+
},
|
|
137
|
+
category: 'utility',
|
|
138
|
+
execute: async (args, onProgress) => {
|
|
139
|
+
const { prompt, model, reasoningEffort, approvalPolicy, sandboxMode, fullAuto, yolo, cd, methodology = 'auto', domain, constraints, existingContext, ideaCount = 12, includeAnalysis = true, search, oss, enableFeatures, disableFeatures, } = args;
|
|
140
|
+
if (!prompt?.trim()) {
|
|
141
|
+
throw new Error('You must provide a valid brainstorming challenge or question to explore');
|
|
142
|
+
}
|
|
143
|
+
let enhancedPrompt = buildBrainstormPrompt({
|
|
144
|
+
prompt: prompt.trim(),
|
|
145
|
+
methodology: methodology,
|
|
146
|
+
domain: domain,
|
|
147
|
+
constraints: constraints,
|
|
148
|
+
existingContext: existingContext,
|
|
149
|
+
ideaCount: ideaCount,
|
|
150
|
+
includeAnalysis: includeAnalysis,
|
|
151
|
+
});
|
|
152
|
+
Logger.debug(`Brainstorm: Using methodology '${methodology}' for domain '${domain || 'general'}'`);
|
|
153
|
+
// Report progress to user
|
|
154
|
+
onProgress?.(`Generating ${ideaCount} ideas via ${methodology} methodology...`);
|
|
155
|
+
// Execute with Codex (non-interactive)
|
|
156
|
+
return await executeCodexCLI(enhancedPrompt, {
|
|
157
|
+
model: model,
|
|
158
|
+
reasoningEffort: reasoningEffort,
|
|
159
|
+
fullAuto: Boolean(fullAuto),
|
|
160
|
+
approvalPolicy: approvalPolicy,
|
|
161
|
+
sandboxMode: sandboxMode,
|
|
162
|
+
yolo: Boolean(yolo),
|
|
163
|
+
cd: cd,
|
|
164
|
+
search: search,
|
|
165
|
+
oss: oss,
|
|
166
|
+
enableFeatures: enableFeatures,
|
|
167
|
+
disableFeatures: disableFeatures,
|
|
168
|
+
}, onProgress);
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
//# 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,EAA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C1C,eAAe,EAAE,eAA2B;SAC7C,EACD,UAAU,CACX,CAAC;IACJ,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;AAa5C,eAAO,MAAM,cAAc,EAAE,WAwE5B,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
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. Did you run ask-codex 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, {
|
|
53
|
+
current: chunkIndex,
|
|
54
|
+
total: chunks.length,
|
|
55
|
+
cacheKey,
|
|
56
|
+
});
|
|
57
|
+
// Add summary for first chunk
|
|
58
|
+
if (chunkIndex === 1 && chunks.length > 1) {
|
|
59
|
+
const allEdits = chunks.flatMap(c => c.edits);
|
|
60
|
+
result = summarizeChangeModeEdits(allEdits, true) + '\n\n' + result;
|
|
61
|
+
}
|
|
62
|
+
Logger.debug(`Returning chunk ${chunkIndex} of ${chunks.length} with ${chunk.edits.length} edits`);
|
|
63
|
+
return result;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
//# 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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GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;YACjD,OAAO,0BAA0B,UAAU;;yBAExB,MAAM,CAAC,MAAM;iBACrB,UAAU;;gCAEK,CAAC;QAC7B,CAAC;QAED,0BAA0B;QAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;QAErC,sBAAsB;QACtB,IAAI,MAAM,GAAG,wBAAwB,CAAC,KAAK,CAAC,KAAK,EAAE;YACjD,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,MAAM,CAAC,MAAM;YACpB,QAAQ;SACT,CAAC,CAAC;QAEH,8BAA8B;QAC9B,IAAI,UAAU,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,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,CACV,mBAAmB,UAAU,OAAO,MAAM,CAAC,MAAM,SAAS,KAAK,CAAC,KAAK,CAAC,MAAM,QAAQ,CACrF,CAAC;QAEF,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":"AAsBA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Tool Registry Index - Registers all tools
|
|
2
|
+
import { toolRegistry } from './registry.js';
|
|
3
|
+
import { askCodexTool } from './ask-codex.tool.js';
|
|
4
|
+
import { batchCodexTool } from './batch-codex.tool.js';
|
|
5
|
+
// import { reviewCodexTool } from './review-codex.tool.js';
|
|
6
|
+
import { pingTool, helpTool, versionTool } from './simple-tools.js';
|
|
7
|
+
import { brainstormTool } from './brainstorm.tool.js';
|
|
8
|
+
import { fetchChunkTool } from './fetch-chunk.tool.js';
|
|
9
|
+
import { timeoutTestTool } from './timeout-test.tool.js';
|
|
10
|
+
toolRegistry.push(askCodexTool, batchCodexTool,
|
|
11
|
+
// reviewCodexTool,
|
|
12
|
+
pingTool, helpTool, versionTool, brainstormTool, fetchChunkTool, timeoutTestTool);
|
|
13
|
+
export * from './registry.js';
|
|
14
|
+
//# 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,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,4DAA4D;AAC5D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACpE,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,YAAY,EACZ,cAAc;AACd,mBAAmB;AACnB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,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' | 'utility' | 'codex';
|
|
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,OAAO,EAAE,UAAU,EAAY,MAAM,KAAK,CAAC;AAG3C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;IAEtB,MAAM,CAAC,EAAE;QACP,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,KAAK,CAAC;YAChB,IAAI,EAAE,MAAM,CAAC;YACb,WAAW,EAAE,MAAM,CAAC;YACpB,QAAQ,EAAE,OAAO,CAAC;SACnB,CAAC,CAAC;KACJ,CAAC;IAEF,OAAO,EAAE,CAAC,IAAI,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5F,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;CAC3C;AAED,eAAO,MAAM,YAAY,EAAE,WAAW,EAAO,CAAC;AAE9C,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,wBAAgB,kBAAkB,IAAI,IAAI,EAAE,CAiB3C;AAkBD,wBAAgB,oBAAoB,IAAI,MAAM,EAAE,CAS/C;AAED,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,aAAa,EACnB,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,GACvC,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAsBpF"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ZodError } from 'zod';
|
|
2
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
+
export const toolRegistry = [];
|
|
4
|
+
export function toolExists(toolName) {
|
|
5
|
+
return toolRegistry.some(t => t.name === toolName);
|
|
6
|
+
}
|
|
7
|
+
export function getToolDefinitions() {
|
|
8
|
+
// get Tool definitions from registry
|
|
9
|
+
return toolRegistry.map(tool => {
|
|
10
|
+
const raw = zodToJsonSchema(tool.zodSchema, tool.name);
|
|
11
|
+
const def = raw.definitions?.[tool.name] ?? raw;
|
|
12
|
+
const inputSchema = {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: def.properties || {},
|
|
15
|
+
required: def.required || [],
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
name: tool.name,
|
|
19
|
+
description: tool.description,
|
|
20
|
+
inputSchema,
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function extractPromptArguments(zodSchema) {
|
|
25
|
+
const jsonSchema = zodToJsonSchema(zodSchema);
|
|
26
|
+
const properties = jsonSchema.properties || {};
|
|
27
|
+
const required = jsonSchema.required || [];
|
|
28
|
+
return Object.entries(properties).map(([name, prop]) => ({
|
|
29
|
+
name,
|
|
30
|
+
description: prop.description || `${name} parameter`,
|
|
31
|
+
required: required.includes(name),
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
export function getPromptDefinitions() {
|
|
35
|
+
// Helper to get MCP Prompt definitions from registry
|
|
36
|
+
return toolRegistry
|
|
37
|
+
.filter(tool => tool.prompt)
|
|
38
|
+
.map(tool => ({
|
|
39
|
+
name: tool.name,
|
|
40
|
+
description: tool.prompt.description,
|
|
41
|
+
arguments: tool.prompt.arguments || extractPromptArguments(tool.zodSchema),
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
export async function executeTool(toolName, args, onProgress) {
|
|
45
|
+
const tool = toolRegistry.find(t => t.name === toolName);
|
|
46
|
+
if (!tool) {
|
|
47
|
+
throw new Error(`Unknown tool: ${toolName}`);
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const validatedArgs = tool.zodSchema.parse(args);
|
|
51
|
+
return tool.execute(validatedArgs, onProgress);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (error instanceof ZodError) {
|
|
55
|
+
const issues = error.issues
|
|
56
|
+
.map(issue => `${issue.path.join('.')}: ${issue.message}`)
|
|
57
|
+
.join(', ');
|
|
58
|
+
throw new Error(`Invalid arguments for ${toolName}: ${issues}`);
|
|
59
|
+
}
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function getPromptMessage(toolName, args) {
|
|
64
|
+
const tool = toolRegistry.find(t => t.name === toolName);
|
|
65
|
+
if (!tool?.prompt) {
|
|
66
|
+
throw new Error(`No prompt defined for tool: ${toolName}`);
|
|
67
|
+
}
|
|
68
|
+
const paramStrings = [];
|
|
69
|
+
if (args.prompt) {
|
|
70
|
+
paramStrings.push(args.prompt);
|
|
71
|
+
}
|
|
72
|
+
Object.entries(args).forEach(([key, value]) => {
|
|
73
|
+
if (key !== 'prompt' && value !== undefined && value !== null && value !== false) {
|
|
74
|
+
if (typeof value === 'boolean' && value) {
|
|
75
|
+
paramStrings.push(`[${key}]`);
|
|
76
|
+
}
|
|
77
|
+
else if (typeof value !== 'boolean') {
|
|
78
|
+
paramStrings.push(`(${key}: ${value})`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
return `Use the ${toolName} tool${paramStrings.length > 0 ? ': ' + paramStrings.join(' ') : ''}`;
|
|
83
|
+
}
|
|
84
|
+
//# 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;AAE9C,MAAM,UAAU,UAAU,CAAC,QAAgB;IACzC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,qCAAqC;IACrC,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC7B,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAQ,CAAC;QAC9D,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC;QAChD,MAAM,WAAW,GAAwB;YACvC,IAAI,EAAE,QAAQ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