@trishchuk/codex-mcp-tool 1.0.6 → 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/README.md +92 -16
- package/dist/constants.d.ts +64 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +85 -31
- package/dist/constants.js.map +1 -1
- package/dist/index.js +28 -26
- package/dist/index.js.map +1 -1
- package/dist/tools/apply-diff.tool.d.ts +3 -0
- package/dist/tools/apply-diff.tool.d.ts.map +1 -0
- package/dist/tools/apply-diff.tool.js +52 -0
- package/dist/tools/apply-diff.tool.js.map +1 -0
- package/dist/tools/ask-codex.tool.d.ts.map +1 -1
- package/dist/tools/ask-codex.tool.js +171 -33
- package/dist/tools/ask-codex.tool.js.map +1 -1
- 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 +134 -0
- package/dist/tools/batch-codex.tool.js.map +1 -0
- package/dist/tools/brainstorm.tool.d.ts.map +1 -1
- package/dist/tools/brainstorm.tool.js +62 -29
- package/dist/tools/brainstorm.tool.js.map +1 -1
- package/dist/tools/exec-codex.tool.d.ts +3 -0
- package/dist/tools/exec-codex.tool.d.ts.map +1 -0
- package/dist/tools/exec-codex.tool.js +46 -0
- package/dist/tools/exec-codex.tool.js.map +1 -0
- package/dist/tools/fetch-chunk.tool.d.ts.map +1 -1
- package/dist/tools/fetch-chunk.tool.js +12 -8
- package/dist/tools/fetch-chunk.tool.js.map +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +4 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/registry.d.ts +3 -3
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +9 -5
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/review-codex.tool.d.ts +3 -0
- package/dist/tools/review-codex.tool.d.ts.map +1 -0
- package/dist/tools/review-codex.tool.js +91 -0
- package/dist/tools/review-codex.tool.js.map +1 -0
- package/dist/tools/simple-tools.d.ts +1 -0
- package/dist/tools/simple-tools.d.ts.map +1 -1
- package/dist/tools/simple-tools.js +42 -11
- package/dist/tools/simple-tools.js.map +1 -1
- package/dist/tools/test-tool.example.d.ts.map +1 -1
- package/dist/tools/test-tool.example.js +12 -10
- package/dist/tools/test-tool.example.js.map +1 -1
- package/dist/tools/timeout-test.tool.js +5 -5
- package/dist/tools/timeout-test.tool.js.map +1 -1
- package/dist/utils/changeModeChunker.d.ts.map +1 -1
- package/dist/utils/changeModeChunker.js +10 -6
- package/dist/utils/changeModeChunker.js.map +1 -1
- package/dist/utils/changeModeParser.d.ts.map +1 -1
- package/dist/utils/changeModeParser.js.map +1 -1
- package/dist/utils/changeModeRunner.d.ts.map +1 -1
- package/dist/utils/changeModeRunner.js +17 -11
- package/dist/utils/changeModeRunner.js.map +1 -1
- package/dist/utils/changeModeTranslator.d.ts.map +1 -1
- package/dist/utils/changeModeTranslator.js +5 -2
- package/dist/utils/changeModeTranslator.js.map +1 -1
- package/dist/utils/chunkCache.d.ts.map +1 -1
- package/dist/utils/chunkCache.js +6 -4
- package/dist/utils/chunkCache.js.map +1 -1
- package/dist/utils/codexCommandBuilder.d.ts +80 -0
- package/dist/utils/codexCommandBuilder.d.ts.map +1 -0
- package/dist/utils/codexCommandBuilder.js +259 -0
- package/dist/utils/codexCommandBuilder.js.map +1 -0
- package/dist/utils/codexExecutor.d.ts +19 -0
- package/dist/utils/codexExecutor.d.ts.map +1 -1
- package/dist/utils/codexExecutor.js +49 -57
- package/dist/utils/codexExecutor.js.map +1 -1
- package/dist/utils/commandExecutor.d.ts.map +1 -1
- package/dist/utils/commandExecutor.js +25 -17
- package/dist/utils/commandExecutor.js.map +1 -1
- package/dist/utils/fibonacci.d.ts +2 -0
- package/dist/utils/fibonacci.d.ts.map +1 -0
- package/dist/utils/fibonacci.js +17 -0
- package/dist/utils/fibonacci.js.map +1 -0
- package/dist/utils/gitHelper.d.ts +20 -0
- package/dist/utils/gitHelper.d.ts.map +1 -0
- package/dist/utils/gitHelper.js +66 -0
- package/dist/utils/gitHelper.js.map +1 -0
- package/dist/utils/logger.d.ts +2 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +21 -15
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/modelDetection.d.ts +45 -0
- package/dist/utils/modelDetection.d.ts.map +1 -0
- package/dist/utils/modelDetection.js +148 -0
- package/dist/utils/modelDetection.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/versionDetection.d.ts +108 -0
- package/dist/utils/versionDetection.d.ts.map +1 -0
- package/dist/utils/versionDetection.js +160 -0
- package/dist/utils/versionDetection.js.map +1 -0
- package/dist/utils/workingDirResolver.d.ts +52 -0
- package/dist/utils/workingDirResolver.d.ts.map +1 -0
- package/dist/utils/workingDirResolver.js +217 -0
- package/dist/utils/workingDirResolver.js.map +1 -0
- package/package.json +8 -3
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { existsSync, statSync } from 'fs';
|
|
2
|
+
import { dirname, resolve, isAbsolute } from 'path';
|
|
3
|
+
import { Logger } from './logger.js';
|
|
4
|
+
/**
|
|
5
|
+
* Project marker files that indicate the root of a project directory
|
|
6
|
+
*/
|
|
7
|
+
const PROJECT_MARKERS = [
|
|
8
|
+
'package.json', // Node.js/JavaScript
|
|
9
|
+
'.git', // Git repository
|
|
10
|
+
'pyproject.toml', // Python
|
|
11
|
+
'Cargo.toml', // Rust
|
|
12
|
+
'go.mod', // Go
|
|
13
|
+
'pom.xml', // Java (Maven)
|
|
14
|
+
'build.gradle', // Java (Gradle)
|
|
15
|
+
'composer.json', // PHP
|
|
16
|
+
];
|
|
17
|
+
/**
|
|
18
|
+
* Maximum levels to walk up the directory tree when searching for project root
|
|
19
|
+
*/
|
|
20
|
+
const MAX_WALK_UP_LEVELS = 10;
|
|
21
|
+
/**
|
|
22
|
+
* Find the project root directory by walking up the directory tree
|
|
23
|
+
* looking for common project marker files.
|
|
24
|
+
*
|
|
25
|
+
* @param startPath - The directory or file path to start searching from
|
|
26
|
+
* @returns The project root directory, or the starting directory if no markers found
|
|
27
|
+
*/
|
|
28
|
+
export function findProjectRoot(startPath) {
|
|
29
|
+
try {
|
|
30
|
+
// Ensure we start from a directory, not a file
|
|
31
|
+
let currentDir = ensureDirectory(startPath);
|
|
32
|
+
if (!currentDir) {
|
|
33
|
+
Logger.debug(`findProjectRoot: Invalid start path: ${startPath}`);
|
|
34
|
+
return startPath;
|
|
35
|
+
}
|
|
36
|
+
// Walk up the directory tree looking for project markers
|
|
37
|
+
let levelsWalked = 0;
|
|
38
|
+
while (levelsWalked < MAX_WALK_UP_LEVELS) {
|
|
39
|
+
Logger.debug(`Checking for project markers in: ${currentDir}`);
|
|
40
|
+
// Check if any project marker exists in current directory
|
|
41
|
+
for (const marker of PROJECT_MARKERS) {
|
|
42
|
+
const markerPath = resolve(currentDir, marker);
|
|
43
|
+
if (existsSync(markerPath)) {
|
|
44
|
+
Logger.debug(`Found project root at: ${currentDir} (marker: ${marker})`);
|
|
45
|
+
return currentDir;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
// Move up one directory
|
|
49
|
+
const parentDir = dirname(currentDir);
|
|
50
|
+
// Stop if we've reached the root directory
|
|
51
|
+
if (parentDir === currentDir) {
|
|
52
|
+
Logger.debug(`Reached filesystem root, using: ${currentDir}`);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
currentDir = parentDir;
|
|
56
|
+
levelsWalked++;
|
|
57
|
+
}
|
|
58
|
+
// If no markers found, return the starting directory
|
|
59
|
+
Logger.debug(`No project markers found, using start directory: ${currentDir}`);
|
|
60
|
+
return ensureDirectory(startPath) || startPath;
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
Logger.debug(`Error in findProjectRoot: ${error}`);
|
|
64
|
+
return startPath;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Ensures that the provided path points to a directory.
|
|
69
|
+
* If the path is a file, returns its parent directory.
|
|
70
|
+
* If the path doesn't exist or is invalid, returns undefined.
|
|
71
|
+
* Supports both absolute and relative paths.
|
|
72
|
+
*
|
|
73
|
+
* @param path - The file or directory path (absolute or relative)
|
|
74
|
+
* @param baseDir - Base directory for resolving relative paths (default: process.cwd())
|
|
75
|
+
* @returns The directory path, or undefined if invalid
|
|
76
|
+
*/
|
|
77
|
+
export function ensureDirectory(path, baseDir = process.cwd()) {
|
|
78
|
+
if (!path) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
// Resolve to absolute path if relative
|
|
83
|
+
const absolutePath = isAbsolute(path) ? path : resolve(baseDir, path);
|
|
84
|
+
Logger.debug(`Resolving path: ${path} -> ${absolutePath} (base: ${baseDir})`);
|
|
85
|
+
// Check if path exists
|
|
86
|
+
if (!existsSync(absolutePath)) {
|
|
87
|
+
Logger.debug(`Path does not exist: ${absolutePath}`);
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
// Get file stats
|
|
91
|
+
const stats = statSync(absolutePath);
|
|
92
|
+
// If it's a directory, return as-is
|
|
93
|
+
if (stats.isDirectory()) {
|
|
94
|
+
return absolutePath;
|
|
95
|
+
}
|
|
96
|
+
// If it's a file, return its parent directory
|
|
97
|
+
if (stats.isFile()) {
|
|
98
|
+
const parentDir = dirname(absolutePath);
|
|
99
|
+
Logger.debug(`Path is a file, using parent directory: ${parentDir}`);
|
|
100
|
+
return parentDir;
|
|
101
|
+
}
|
|
102
|
+
// If it's neither file nor directory (symlink, etc.), try to resolve
|
|
103
|
+
Logger.debug(`Path is neither file nor directory: ${absolutePath}`);
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
Logger.debug(`Error in ensureDirectory: ${error}`);
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Extract file paths from @path syntax in the prompt.
|
|
113
|
+
* Supports both quoted and unquoted paths, absolute and relative.
|
|
114
|
+
*
|
|
115
|
+
* Examples:
|
|
116
|
+
* - @/absolute/path/to/file.ts (absolute)
|
|
117
|
+
* - @./relative/path/to/file.ts (relative)
|
|
118
|
+
* - @src/file.ts (relative)
|
|
119
|
+
* - @"path with spaces/file.ts" (quoted, can be absolute or relative)
|
|
120
|
+
* - @'path with spaces/file.ts' (quoted, can be absolute or relative)
|
|
121
|
+
*
|
|
122
|
+
* @param prompt - The user prompt that may contain @path references
|
|
123
|
+
* @param baseDir - Base directory for resolving relative paths (default: process.cwd())
|
|
124
|
+
* @returns Array of absolute paths found in the prompt
|
|
125
|
+
*/
|
|
126
|
+
export function extractPathFromAtSyntax(prompt, baseDir = process.cwd()) {
|
|
127
|
+
const paths = [];
|
|
128
|
+
// Pattern 1: Quoted paths with @ prefix: @"path" or @'path'
|
|
129
|
+
const quotedPathRegex = /@["']([^"']+)["']/g;
|
|
130
|
+
let match;
|
|
131
|
+
while ((match = quotedPathRegex.exec(prompt)) !== null) {
|
|
132
|
+
const path = match[1];
|
|
133
|
+
// Convert to absolute if relative
|
|
134
|
+
const absolutePath = isAbsolute(path) ? path : resolve(baseDir, path);
|
|
135
|
+
paths.push(absolutePath);
|
|
136
|
+
Logger.debug(`Extracted quoted @path: ${path} -> ${absolutePath}`);
|
|
137
|
+
}
|
|
138
|
+
// Pattern 2: Unquoted absolute paths: @/path
|
|
139
|
+
const absolutePathRegex = /@(\/[^\s"']+)/g;
|
|
140
|
+
while ((match = absolutePathRegex.exec(prompt)) !== null) {
|
|
141
|
+
const path = match[1];
|
|
142
|
+
paths.push(path);
|
|
143
|
+
Logger.debug(`Extracted absolute @path: ${path}`);
|
|
144
|
+
}
|
|
145
|
+
// Pattern 3: Unquoted relative paths: @./path or @../path or @word/path
|
|
146
|
+
const relativePathRegex = /@(\.{1,2}\/[^\s"']+|[a-zA-Z0-9_-]+\/[^\s"']+)/g;
|
|
147
|
+
while ((match = relativePathRegex.exec(prompt)) !== null) {
|
|
148
|
+
const path = match[1];
|
|
149
|
+
const absolutePath = resolve(baseDir, path);
|
|
150
|
+
paths.push(absolutePath);
|
|
151
|
+
Logger.debug(`Extracted relative @path: ${path} -> ${absolutePath}`);
|
|
152
|
+
}
|
|
153
|
+
Logger.debug(`Extracted ${paths.length} paths from @syntax: ${paths.join(', ')}`);
|
|
154
|
+
return paths;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Resolve the working directory using a fallback chain with multiple strategies.
|
|
158
|
+
*
|
|
159
|
+
* Priority order (highest to lowest):
|
|
160
|
+
* 1. Explicit workingDir parameter
|
|
161
|
+
* 2. Environment variables: CODEX_MCP_CWD > PWD > INIT_CWD
|
|
162
|
+
* 3. Automatic inference from @path syntax in prompt
|
|
163
|
+
* 4. process.cwd() as last resort
|
|
164
|
+
*
|
|
165
|
+
* @param options - Resolution options
|
|
166
|
+
* @returns The resolved working directory path
|
|
167
|
+
*/
|
|
168
|
+
export function resolveWorkingDirectory(options) {
|
|
169
|
+
const { workingDir, prompt } = options || {};
|
|
170
|
+
// Get a base directory for resolving relative paths
|
|
171
|
+
const baseDir = process.env['CODEX_MCP_CWD'] || process.env['PWD'] || process.env['INIT_CWD'] || process.cwd();
|
|
172
|
+
// Priority 1: Explicit workingDir parameter
|
|
173
|
+
if (workingDir) {
|
|
174
|
+
const validDir = ensureDirectory(workingDir, baseDir);
|
|
175
|
+
if (validDir) {
|
|
176
|
+
Logger.debug(`Using explicit working directory: ${validDir}`);
|
|
177
|
+
return validDir;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
Logger.warn(`Explicit workingDir is invalid: ${workingDir}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// Priority 2: Environment variables
|
|
184
|
+
const envVars = ['CODEX_MCP_CWD', 'PWD', 'INIT_CWD'];
|
|
185
|
+
for (const envVar of envVars) {
|
|
186
|
+
const envValue = process.env[envVar];
|
|
187
|
+
if (envValue) {
|
|
188
|
+
const validDir = ensureDirectory(envValue, process.cwd());
|
|
189
|
+
if (validDir) {
|
|
190
|
+
Logger.debug(`Using environment variable ${envVar}: ${validDir}`);
|
|
191
|
+
return validDir;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
Logger.debug(`Environment variable ${envVar} is invalid: ${envValue}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Priority 3: Automatic inference from @path syntax
|
|
199
|
+
if (prompt) {
|
|
200
|
+
const paths = extractPathFromAtSyntax(prompt, baseDir);
|
|
201
|
+
for (const path of paths) {
|
|
202
|
+
if (existsSync(path)) {
|
|
203
|
+
// Find the project root for this path
|
|
204
|
+
const projectRoot = findProjectRoot(path);
|
|
205
|
+
if (projectRoot) {
|
|
206
|
+
Logger.debug(`Inferred working directory from @path syntax: ${projectRoot}`);
|
|
207
|
+
return projectRoot;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
// Priority 4: process.cwd() as fallback
|
|
213
|
+
const cwd = process.cwd();
|
|
214
|
+
Logger.debug(`Using process.cwd() as working directory: ${cwd}`);
|
|
215
|
+
return cwd;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=workingDirResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workingDirResolver.js","sourceRoot":"","sources":["../../src/utils/workingDirResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC1C,OAAO,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AC;QACH,CAAC;IACH,CAAC;IAED,wCAAwC;IACxC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,CAAC,KAAK,CAAC,6CAA6C,GAAG,EAAE,CAAC,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trishchuk/codex-mcp-tool",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "MCP server for Codex CLI integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
"dev": "tsc && node dist/index.js",
|
|
14
14
|
"test": "echo \"No tests yet\" && exit 0",
|
|
15
15
|
"lint": "tsc --noEmit",
|
|
16
|
+
"format": "prettier --write \"src/**/*.{ts,js,json,md}\" \"docs/**/*.{md,json}\" \"*.{md,json}\"",
|
|
17
|
+
"format:check": "prettier --check \"src/**/*.{ts,js,json,md}\" \"docs/**/*.{md,json}\" \"*.{md,json}\"",
|
|
16
18
|
"prepublishOnly": "echo '⚠️ Remember to test locally first!' && npm run build",
|
|
17
19
|
"docs:dev": "vitepress dev docs",
|
|
18
20
|
"docs:build": "vitepress build docs",
|
|
@@ -52,19 +54,22 @@
|
|
|
52
54
|
],
|
|
53
55
|
"dependencies": {
|
|
54
56
|
"@modelcontextprotocol/sdk": "^0.6.1",
|
|
57
|
+
"cross-spawn": "^7.0.6",
|
|
55
58
|
"zod": "^3.25.76",
|
|
56
59
|
"zod-to-json-schema": "^3.24.6"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
62
|
+
"@types/cross-spawn": "^6.0.6",
|
|
59
63
|
"@types/inquirer": "^9.0.0",
|
|
60
64
|
"@types/node": "^18.19.124",
|
|
61
65
|
"archiver": "^7.0.1",
|
|
62
66
|
"mermaid": "^11.9.0",
|
|
67
|
+
"prettier": "^3.6.2",
|
|
68
|
+
"prismjs": "^1.30.0",
|
|
63
69
|
"tsx": "^4.20.5",
|
|
64
70
|
"typescript": "^5.0.0",
|
|
65
71
|
"vitepress": "^1.6.4",
|
|
66
|
-
"vitepress-plugin-mermaid": "^2.0.17"
|
|
67
|
-
"prismjs": "^1.30.0"
|
|
72
|
+
"vitepress-plugin-mermaid": "^2.0.17"
|
|
68
73
|
},
|
|
69
74
|
"publishConfig": {
|
|
70
75
|
"access": "public"
|