@trishchuk/codex-mcp-tool 1.2.0 → 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 +83 -6
- package/dist/constants.d.ts +9 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +12 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tools/ask-codex.tool.d.ts.map +1 -1
- package/dist/tools/ask-codex.tool.js +16 -3
- package/dist/tools/ask-codex.tool.js.map +1 -1
- package/dist/tools/index.js +2 -4
- package/dist/tools/index.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 +2 -0
- package/dist/utils/codexExecutor.d.ts.map +1 -1
- package/dist/utils/codexExecutor.js +12 -179
- package/dist/utils/codexExecutor.js.map +1 -1
- package/dist/utils/commandExecutor.js +3 -3
- package/dist/utils/commandExecutor.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/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 +13 -8
- package/dist/utils/workingDirResolver.d.ts.map +1 -1
- package/dist/utils/workingDirResolver.js +44 -26
- package/dist/utils/workingDirResolver.js.map +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -29,6 +29,12 @@ Before using this tool, ensure you have:
|
|
|
29
29
|
1. **[Node.js](https://nodejs.org/)** (v18.0.0 or higher)
|
|
30
30
|
2. **[Codex CLI](https://github.com/openai/codex)** installed and authenticated
|
|
31
31
|
|
|
32
|
+
### Platform Support
|
|
33
|
+
|
|
34
|
+
✅ **Windows, macOS, and Linux fully supported**
|
|
35
|
+
|
|
36
|
+
**v1.2.4** introduced cross-platform compatibility improvements using `cross-spawn`, ensuring reliable command execution across all operating systems. Windows users no longer experience "spawn codex ENOENT" errors.
|
|
37
|
+
|
|
32
38
|
### One-Line Setup
|
|
33
39
|
|
|
34
40
|
```bash
|
|
@@ -111,8 +117,16 @@ After updating the configuration, restart your terminal session.
|
|
|
111
117
|
|
|
112
118
|
### Model Selection
|
|
113
119
|
|
|
120
|
+
Default: `gpt-5.1-codex-max` (v1.3.0+) with automatic fallback → `gpt-5-codex` → `gpt-5` when newer models are unavailable.
|
|
121
|
+
|
|
122
|
+
**GPT-5.1 family with examples**
|
|
123
|
+
|
|
124
|
+
- `gpt-5.1-codex-max` — default for complex, multi-file edits (`'use codex to refactor @src with model gpt-5.1-codex-max'`)
|
|
125
|
+
- `gpt-5.1-codex-mini` — cost-efficient quick passes (`'use codex with model gpt-5.1-codex-mini to scan @utils'`)
|
|
126
|
+
- `gpt-5.1`, `gpt-5.1-mini`, `gpt-5.1-nano` — general-purpose GPT-5.1 variants (`'ask codex using gpt-5.1-nano for a fast read on @README.md'`)
|
|
127
|
+
|
|
114
128
|
```javascript
|
|
115
|
-
// Use the default gpt-5-codex model
|
|
129
|
+
// Use the default gpt-5.1-codex-max model (falls back to gpt-5-codex → gpt-5)
|
|
116
130
|
'explain the architecture of @src/';
|
|
117
131
|
|
|
118
132
|
// Use gpt-5 for fast general purpose reasoning
|
|
@@ -152,6 +166,12 @@ Codex supports approval/sandbox modes. This server uses `codex exec` and can opt
|
|
|
152
166
|
- `use codex to create and run a Python script that processes data`
|
|
153
167
|
- `ask codex to safely test @script.py and explain what it does`
|
|
154
168
|
|
|
169
|
+
### Native Search
|
|
170
|
+
|
|
171
|
+
- Enable search with `search:true` or the `--search` flag; defaults to `workspace-write` sandbox for network access
|
|
172
|
+
- Dual-flag compatibility: sends native `--search` on Codex CLI v0.52.0+ and always enables the `web_search_request` feature flag for older versions
|
|
173
|
+
- Works alongside `oss`/feature toggles without manual client changes
|
|
174
|
+
|
|
155
175
|
### Advanced Examples
|
|
156
176
|
|
|
157
177
|
```javascript
|
|
@@ -173,22 +193,28 @@ These tools are designed to be used by the AI assistant.
|
|
|
173
193
|
|
|
174
194
|
- **`ask-codex`**: Sends a prompt to Codex via `codex exec`.
|
|
175
195
|
- Supports `@` file references for including file content
|
|
176
|
-
- Optional `model` parameter -
|
|
177
|
-
|
|
196
|
+
- Optional `model` parameter; default: `gpt-5.1-codex-max` with fallback chain `gpt-5.1-codex-max → gpt-5-codex → gpt-5` when a model is unavailable
|
|
197
|
+
- GPT-5.1 family stays enabled automatically on Codex CLI v0.56.0+; older CLI versions trigger the fallback chain
|
|
198
|
+
- Available models:
|
|
199
|
+
- `gpt-5.1-codex-max` (NEW DEFAULT v1.3.0, highest reliability)
|
|
200
|
+
- `gpt-5.1-codex-mini` (cost-efficient, quick tasks)
|
|
201
|
+
- `gpt-5.1`, `gpt-5.1-mini`, `gpt-5.1-nano` (GPT-5.1 family)
|
|
202
|
+
- `gpt-5-codex` (previous default, still supported)
|
|
178
203
|
- `gpt-5` (general purpose, fast reasoning)
|
|
179
204
|
- `o3` (smartest, deep reasoning)
|
|
180
205
|
- `o4-mini` (fast & efficient)
|
|
181
206
|
- `codex-1` (o3-based for software engineering)
|
|
182
207
|
- `codex-mini-latest` (low-latency code Q&A)
|
|
183
|
-
- `gpt-4.1` (
|
|
208
|
+
- `gpt-4.1` (legacy support)
|
|
209
|
+
- Native Search: uses dual flags (adds `--search` on v0.52.0+ and always enables `web_search_request`) for compatibility
|
|
184
210
|
- `sandbox=true` enables `--full-auto` mode
|
|
185
211
|
- `changeMode=true` returns structured OLD/NEW edits
|
|
186
|
-
- Supports approval policies and
|
|
212
|
+
- Supports approval policies, sandbox modes, and verbose control via `toolOutputTokenLimit`
|
|
187
213
|
|
|
188
214
|
- **`brainstorm`**: Generate novel ideas with structured methodologies.
|
|
189
215
|
- Multiple frameworks: divergent, convergent, SCAMPER, design-thinking, lateral
|
|
190
216
|
- Domain-specific context (software, business, creative, research, product, marketing)
|
|
191
|
-
- Supports same models as `ask-codex` (default: `gpt-5-codex`)
|
|
217
|
+
- Supports same models as `ask-codex` (default: `gpt-5.1-codex-max` with the same fallback chain)
|
|
192
218
|
- Configurable idea count and analysis depth
|
|
193
219
|
- Includes feasibility, impact, and innovation scoring
|
|
194
220
|
- Example: `brainstorm prompt:"ways to improve code review process" domain:"software" methodology:"scamper"`
|
|
@@ -209,6 +235,26 @@ These tools are designed to be used by the AI assistant.
|
|
|
209
235
|
- Runs for a specified duration in milliseconds
|
|
210
236
|
- Useful for testing long-running operations
|
|
211
237
|
|
|
238
|
+
## Advanced Features (v1.3.0+)
|
|
239
|
+
|
|
240
|
+
### Version Detection & Compatibility
|
|
241
|
+
|
|
242
|
+
- Automatically parses `codex --version` to toggle feature flags and pick the safest model available
|
|
243
|
+
- GPT-5.1 family is auto-enabled on Codex CLI v0.56.0+; older versions gracefully fall back to `gpt-5-codex` → `gpt-5`
|
|
244
|
+
- Native search, `--add-dir`, and token-limit flags are only sent when your installed CLI supports them
|
|
245
|
+
|
|
246
|
+
### Multi-Directory Projects
|
|
247
|
+
|
|
248
|
+
- Use `addDirs` to allow writes across multiple repositories or temp folders (requires Codex CLI v0.59.0+)
|
|
249
|
+
- Example: `ask codex prompt:"upgrade shared configs" addDirs:["../shared-config","/tmp/sandbox"]`
|
|
250
|
+
- The tool auto-skips unsupported flags on older CLI builds while logging a warning
|
|
251
|
+
|
|
252
|
+
### Response Verbosity Control
|
|
253
|
+
|
|
254
|
+
- Cap tool outputs with `toolOutputTokenLimit` (range: 100–10,000) to tame noisy commands
|
|
255
|
+
- Example: `ask codex prompt:"summarize @logs" toolOutputTokenLimit:500`
|
|
256
|
+
- Great for CI logs or quick scans where concise responses are needed
|
|
257
|
+
|
|
212
258
|
### Slash Commands (for the User)
|
|
213
259
|
|
|
214
260
|
You can use these commands directly in Claude Code's interface (compatibility with other clients has not been tested).
|
|
@@ -221,6 +267,37 @@ You can use these commands directly in Claude Code's interface (compatibility wi
|
|
|
221
267
|
- **/ping**: Tests the connection to the server.
|
|
222
268
|
- **`message`** (optional): A message to echo back.
|
|
223
269
|
|
|
270
|
+
## Codex CLI Compatibility
|
|
271
|
+
|
|
272
|
+
| Codex CLI version | What you get | Model behavior |
|
|
273
|
+
| ----------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
|
274
|
+
| v0.59.0+ | `--add-dir`, `tool_output_token_limit`, Windows agent mode | Full GPT-5.1 support with fallback chain `gpt-5.1-codex-max → gpt-5-codex → gpt-5` |
|
|
275
|
+
| v0.56.0+ | GPT-5.1 family unlocked | Uses GPT-5.1 models directly; still falls back if a model is missing |
|
|
276
|
+
| v0.52.0+ | Native `--search` flag | Dual-flag search (`--search` + `web_search_request`) for reliability |
|
|
277
|
+
| earlier | Legacy-only flags | Forces fallback to `gpt-5-codex`/`gpt-5`, skips unsupported flags with warnings |
|
|
278
|
+
|
|
279
|
+
## Troubleshooting (legacy versions)
|
|
280
|
+
|
|
281
|
+
- Run `codex --version` to confirm your CLI build; upgrade to v0.59.0+ for full v1.3.0 features
|
|
282
|
+
- If GPT-5.1 models error on older CLIs, explicitly set `model:"gpt-5-codex"` (the fallback will apply automatically otherwise)
|
|
283
|
+
- Remove `addDirs` or `toolOutputTokenLimit` if you see unsupported flag warnings; they require v0.59.0+
|
|
284
|
+
- Web search issues on pre-v0.52.0 builds: rely on the `web_search_request` feature flag only, or upgrade for the `--search` flag
|
|
285
|
+
|
|
286
|
+
## FAQ
|
|
287
|
+
|
|
288
|
+
- **What model is used by default?** `gpt-5.1-codex-max` with fallback to `gpt-5-codex` then `gpt-5`.
|
|
289
|
+
- **How do I switch to a cheaper model?** Set `model:"gpt-5.1-codex-mini"` (or `gpt-5.1-nano` for fastest scans) in your tool call.
|
|
290
|
+
- **Can I limit output verbosity?** Yes—use `toolOutputTokenLimit` between 100 and 10,000 to cap tool responses.
|
|
291
|
+
- **How do I let Codex touch multiple repos?** Pass `addDirs:["../shared","/tmp/work"]` (CLI v0.59.0+); older versions will warn and skip the flag.
|
|
292
|
+
- **How is native search handled?** The tool sends both `--search` (when available) and the `web_search_request` feature flag to stay compatible.
|
|
293
|
+
|
|
294
|
+
## Migration: v1.2.x → v1.3.0
|
|
295
|
+
|
|
296
|
+
- Default model switches to `gpt-5.1-codex-max`; fallback chain now formalized (`gpt-5.1-codex-max → gpt-5-codex → gpt-5`)
|
|
297
|
+
- New features: `addDirs` for multi-directory writes and `toolOutputTokenLimit` for output control (both require Codex CLI v0.59.0+)
|
|
298
|
+
- Native search now uses the dual-flag approach automatically; no config changes needed
|
|
299
|
+
- Recommendation: update Codex CLI to v0.59.0+ and refresh your MCP config (no schema changes—existing `/mcp` entries still work)
|
|
300
|
+
|
|
224
301
|
## Acknowledgments
|
|
225
302
|
|
|
226
303
|
This project was inspired by the excellent work from [jamubc/gemini-mcp-tool](https://github.com/jamubc/gemini-mcp-tool). Special thanks to [@jamubc](https://github.com/jamubc) for the original MCP server architecture and implementation patterns.
|
package/dist/constants.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export declare const STATUS_MESSAGES: {
|
|
|
17
17
|
readonly PROCESSING_COMPLETE: "✅ Analysis completed successfully";
|
|
18
18
|
};
|
|
19
19
|
export declare const MODELS: {
|
|
20
|
+
readonly GPT5_1_CODEX_MAX: "gpt-5.1-codex-max";
|
|
21
|
+
readonly GPT5_1_CODEX_MINI: "gpt-5.1-codex-mini";
|
|
22
|
+
readonly GPT5_1: "gpt-5.1";
|
|
23
|
+
readonly GPT5_1_MINI: "gpt-5.1-mini";
|
|
24
|
+
readonly GPT5_1_NANO: "gpt-5.1-nano";
|
|
20
25
|
readonly GPT5_CODEX: "gpt-5-codex";
|
|
21
26
|
readonly GPT5: "gpt-5";
|
|
22
27
|
readonly O3: "o3";
|
|
@@ -80,6 +85,8 @@ export declare const CLI: {
|
|
|
80
85
|
readonly OSS: "--oss";
|
|
81
86
|
readonly ENABLE: "--enable";
|
|
82
87
|
readonly DISABLE: "--disable";
|
|
88
|
+
readonly SEARCH: "--search";
|
|
89
|
+
readonly ADD_DIR: "--add-dir";
|
|
83
90
|
};
|
|
84
91
|
readonly DEFAULTS: {
|
|
85
92
|
readonly MODEL: "default";
|
|
@@ -118,6 +125,8 @@ export interface ToolArguments {
|
|
|
118
125
|
oss?: boolean;
|
|
119
126
|
enableFeatures?: string[];
|
|
120
127
|
disableFeatures?: string[];
|
|
128
|
+
addDirs?: string[];
|
|
129
|
+
toolOutputTokenLimit?: number;
|
|
121
130
|
methodology?: string;
|
|
122
131
|
domain?: string;
|
|
123
132
|
constraints?: string;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAGxC,eAAO,MAAM,cAAc;;;;;;;;CASjB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;CAQlB,CAAC;AAGX,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,gBAAgB,CAAC;AAGxC,eAAO,MAAM,cAAc;;;;;;;;CASjB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;CAQlB,CAAC;AAGX,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAgBT,CAAC;AAGX,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAGX,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAGX,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;CAuBX,CAAC;AAGX,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CN,CAAC;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AAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CACvF"}
|
package/dist/constants.js
CHANGED
|
@@ -22,8 +22,16 @@ export const STATUS_MESSAGES = {
|
|
|
22
22
|
};
|
|
23
23
|
// Models
|
|
24
24
|
export const MODELS = {
|
|
25
|
-
|
|
25
|
+
// GPT-5.1 Series (Latest - 2025)
|
|
26
|
+
GPT5_1_CODEX_MAX: 'gpt-5.1-codex-max', // Default (v1.3.0+): Frontier agentic coding with highest reliability
|
|
27
|
+
GPT5_1_CODEX_MINI: 'gpt-5.1-codex-mini', // Cost-efficient compact model
|
|
28
|
+
GPT5_1: 'gpt-5.1', // General purpose GPT-5.1
|
|
29
|
+
GPT5_1_MINI: 'gpt-5.1-mini', // Balanced performance
|
|
30
|
+
GPT5_1_NANO: 'gpt-5.1-nano', // Fastest for simple queries
|
|
31
|
+
// GPT-5 Series (Legacy)
|
|
32
|
+
GPT5_CODEX: 'gpt-5-codex', // Previous default
|
|
26
33
|
GPT5: 'gpt-5',
|
|
34
|
+
// Other Models
|
|
27
35
|
O3: 'o3',
|
|
28
36
|
O4_MINI: 'o4-mini',
|
|
29
37
|
CODEX_1: 'codex-1',
|
|
@@ -96,6 +104,9 @@ export const CLI = {
|
|
|
96
104
|
OSS: '--oss',
|
|
97
105
|
ENABLE: '--enable',
|
|
98
106
|
DISABLE: '--disable',
|
|
107
|
+
// New flags (v1.3.0+)
|
|
108
|
+
SEARCH: '--search', // Native web search flag (Codex CLI v0.52.0+)
|
|
109
|
+
ADD_DIR: '--add-dir', // Additional writable directories (Codex CLI v0.59.0+)
|
|
99
110
|
},
|
|
100
111
|
// Default values
|
|
101
112
|
DEFAULTS: {
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AAExC,iBAAiB;AACjB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,cAAc,EAAE,uBAAuB;IACvC,kBAAkB,EAChB,6IAA6I;IAC/I,cAAc,EAAE,qBAAqB;IACrC,qBAAqB,EAAE,0EAA0E;IACjG,eAAe,EAAE,0EAA0E;IAC3F,iBAAiB,EAAE,qCAAqC;IACxD,cAAc,EAAE,mDAAmD;CAC3D,CAAC;AAEX,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,iBAAiB,EAAE,kDAAkD;IACrE,cAAc,EAAE,iBAAiB;IACjC,sBAAsB,EAAE,6BAA6B;IACrD,8BAA8B;IAC9B,gBAAgB,EAAE,kEAAkE;IACpF,mBAAmB,EAAE,uBAAuB;IAC5C,mBAAmB,EAAE,mCAAmC;CAChD,CAAC;AAEX,SAAS;AACT,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,UAAU,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;AAExC,iBAAiB;AACjB,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,cAAc,EAAE,uBAAuB;IACvC,kBAAkB,EAChB,6IAA6I;IAC/I,cAAc,EAAE,qBAAqB;IACrC,qBAAqB,EAAE,0EAA0E;IACjG,eAAe,EAAE,0EAA0E;IAC3F,iBAAiB,EAAE,qCAAqC;IACxD,cAAc,E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,GAAG,EAAE,KAAK,EAAE,oCAAoC;QAChD,QAAQ,EAAE,UAAU,EAAE,sCAAsC;KAC7D;CACO,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { PROTOCOL } from './constants.js';
|
|
|
7
7
|
import { getToolDefinitions, getPromptDefinitions, executeTool, toolExists, getPromptMessage, } from './tools/index.js';
|
|
8
8
|
const server = new Server({
|
|
9
9
|
name: 'codex-cli-mcp',
|
|
10
|
-
version: '1.
|
|
10
|
+
version: '1.3.0',
|
|
11
11
|
}, {
|
|
12
12
|
capabilities: {
|
|
13
13
|
tools: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-codex.tool.d.ts","sourceRoot":"","sources":["../../src/tools/ask-codex.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ask-codex.tool.d.ts","sourceRoot":"","sources":["../../src/tools/ask-codex.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAsG5C,eAAO,MAAM,YAAY,EAAE,WAoJ1B,CAAC"}
|
|
@@ -11,7 +11,7 @@ const askCodexArgsSchema = z.object({
|
|
|
11
11
|
model: z
|
|
12
12
|
.string()
|
|
13
13
|
.optional()
|
|
14
|
-
.describe(`Model: ${Object.values(MODELS).join(', ')}. Default: gpt-5-codex`),
|
|
14
|
+
.describe(`Model: ${Object.values(MODELS).join(', ')}. Default: gpt-5.1-codex-max`),
|
|
15
15
|
sandbox: z
|
|
16
16
|
.boolean()
|
|
17
17
|
.default(false)
|
|
@@ -66,7 +66,7 @@ const askCodexArgsSchema = z.object({
|
|
|
66
66
|
search: z
|
|
67
67
|
.boolean()
|
|
68
68
|
.optional()
|
|
69
|
-
.describe('Enable web search
|
|
69
|
+
.describe('Enable web search using native --search flag (v0.52.0+). Requires network access - automatically sets sandbox to workspace-write if not specified.'),
|
|
70
70
|
oss: z
|
|
71
71
|
.boolean()
|
|
72
72
|
.optional()
|
|
@@ -79,6 +79,17 @@ const askCodexArgsSchema = z.object({
|
|
|
79
79
|
.array(z.string())
|
|
80
80
|
.optional()
|
|
81
81
|
.describe('Disable feature flags (repeatable). Equivalent to -c features.<name>=false'),
|
|
82
|
+
// New parameters (v1.3.0+)
|
|
83
|
+
addDirs: z
|
|
84
|
+
.array(z.string())
|
|
85
|
+
.optional()
|
|
86
|
+
.describe('Additional writable directories beyond workspace (e.g., ["/tmp", "/var/log"]). Useful for monorepos and multi-directory projects.'),
|
|
87
|
+
toolOutputTokenLimit: z
|
|
88
|
+
.number()
|
|
89
|
+
.min(100)
|
|
90
|
+
.max(10000)
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('Maximum tokens for tool outputs (100-10,000). Controls response verbosity.'),
|
|
82
93
|
});
|
|
83
94
|
export const askCodexTool = {
|
|
84
95
|
name: 'ask-codex',
|
|
@@ -89,7 +100,7 @@ export const askCodexTool = {
|
|
|
89
100
|
},
|
|
90
101
|
category: 'utility',
|
|
91
102
|
execute: async (args, onProgress) => {
|
|
92
|
-
const { prompt, model, sandbox, fullAuto, approvalPolicy, approval, sandboxMode, yolo, cd, workingDir, changeMode, chunkIndex, chunkCacheKey, image, config, profile, timeout, includeThinking, includeMetadata, search, oss, enableFeatures, disableFeatures, } = args;
|
|
103
|
+
const { prompt, model, sandbox, fullAuto, approvalPolicy, approval, sandboxMode, yolo, cd, workingDir, changeMode, chunkIndex, chunkCacheKey, image, config, profile, timeout, includeThinking, includeMetadata, search, oss, enableFeatures, disableFeatures, addDirs, toolOutputTokenLimit, } = args;
|
|
93
104
|
if (!prompt?.trim()) {
|
|
94
105
|
throw new Error(ERROR_MESSAGES.NO_PROMPT_PROVIDED);
|
|
95
106
|
}
|
|
@@ -119,6 +130,8 @@ export const askCodexTool = {
|
|
|
119
130
|
oss: oss,
|
|
120
131
|
enableFeatures: enableFeatures,
|
|
121
132
|
disableFeatures: disableFeatures,
|
|
133
|
+
addDirs: addDirs,
|
|
134
|
+
toolOutputTokenLimit: toolOutputTokenLimit,
|
|
122
135
|
}, onProgress);
|
|
123
136
|
if (changeMode) {
|
|
124
137
|
return processChangeModeOutput(result, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ask-codex.tool.js","sourceRoot":"","sources":["../../src/tools/ask-codex.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,MAAM,EAAE,CAAC;SACN,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CAAC,2EAA2E,CAAC;IACxF,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"ask-codex.tool.js","sourceRoot":"","sources":["../../src/tools/ask-codex.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAmB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM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E,CAAC;gBAC5E,OAAO,2BAA2B,cAAc,CAAC,iBAAiB;;;;mDAIvB,CAAC;YAC9C,CAAC;YAED,6BAA6B;YAC7B,OAAO,gCAAgC,YAAY;;;;;2BAK9B,CAAC;QACxB,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/tools/index.js
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
import { toolRegistry } from './registry.js';
|
|
3
3
|
import { askCodexTool } from './ask-codex.tool.js';
|
|
4
4
|
import { batchCodexTool } from './batch-codex.tool.js';
|
|
5
|
-
|
|
5
|
+
import { reviewCodexTool } from './review-codex.tool.js';
|
|
6
6
|
import { pingTool, helpTool, versionTool } from './simple-tools.js';
|
|
7
7
|
import { brainstormTool } from './brainstorm.tool.js';
|
|
8
8
|
import { fetchChunkTool } from './fetch-chunk.tool.js';
|
|
9
9
|
import { timeoutTestTool } from './timeout-test.tool.js';
|
|
10
|
-
toolRegistry.push(askCodexTool, batchCodexTool,
|
|
11
|
-
// reviewCodexTool,
|
|
12
|
-
pingTool, helpTool, versionTool, brainstormTool, fetchChunkTool, timeoutTestTool);
|
|
10
|
+
toolRegistry.push(askCodexTool, batchCodexTool, reviewCodexTool, pingTool, helpTool, versionTool, brainstormTool, fetchChunkTool, timeoutTestTool);
|
|
13
11
|
export * from './registry.js';
|
|
14
12
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +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,
|
|
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,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,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,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,cAAc,EACd,eAAe,CAChB,CAAC;AAEF,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for CodexCommandBuilder
|
|
3
|
+
*/
|
|
4
|
+
export interface CodexCommandBuilderOptions {
|
|
5
|
+
readonly model?: string;
|
|
6
|
+
readonly fullAuto?: boolean;
|
|
7
|
+
readonly approvalPolicy?: string;
|
|
8
|
+
readonly sandboxMode?: string;
|
|
9
|
+
readonly approval?: string;
|
|
10
|
+
readonly yolo?: boolean;
|
|
11
|
+
readonly cd?: string;
|
|
12
|
+
readonly workingDir?: string;
|
|
13
|
+
readonly config?: string | Record<string, any>;
|
|
14
|
+
readonly profile?: string;
|
|
15
|
+
readonly image?: string | string[];
|
|
16
|
+
readonly search?: boolean;
|
|
17
|
+
readonly oss?: boolean;
|
|
18
|
+
readonly enableFeatures?: string[];
|
|
19
|
+
readonly disableFeatures?: string[];
|
|
20
|
+
readonly addDirs?: string[];
|
|
21
|
+
readonly toolOutputTokenLimit?: number;
|
|
22
|
+
readonly useExec?: boolean;
|
|
23
|
+
readonly concisePrompt?: boolean;
|
|
24
|
+
readonly useStdinForLongPrompts?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Result of building a Codex command
|
|
28
|
+
*/
|
|
29
|
+
export interface BuildResult {
|
|
30
|
+
args: string[];
|
|
31
|
+
tempFile?: string;
|
|
32
|
+
finalPrompt: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Builder class for constructing Codex CLI commands
|
|
36
|
+
* Eliminates code duplication between executeCodexCLI and executeCodex
|
|
37
|
+
*/
|
|
38
|
+
export declare class CodexCommandBuilder {
|
|
39
|
+
private args;
|
|
40
|
+
/**
|
|
41
|
+
* Build a complete Codex CLI command with all options
|
|
42
|
+
* @param prompt User prompt
|
|
43
|
+
* @param options Command options
|
|
44
|
+
* @returns Build result with args, temp file, and final prompt
|
|
45
|
+
*/
|
|
46
|
+
build(prompt: string, options?: CodexCommandBuilderOptions): Promise<BuildResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Validate options for conflicts
|
|
49
|
+
*/
|
|
50
|
+
private validateOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Add model argument with fallback chain
|
|
53
|
+
*/
|
|
54
|
+
private addModelArg;
|
|
55
|
+
/**
|
|
56
|
+
* Add safety control arguments (yolo, fullAuto, approval, sandbox)
|
|
57
|
+
*/
|
|
58
|
+
private addSafetyArgs;
|
|
59
|
+
/**
|
|
60
|
+
* Add working directory argument
|
|
61
|
+
*/
|
|
62
|
+
private addWorkingDir;
|
|
63
|
+
/**
|
|
64
|
+
* Add search and feature flags (shared 69-line logic from both functions)
|
|
65
|
+
*/
|
|
66
|
+
private addSearchAndFeatures;
|
|
67
|
+
/**
|
|
68
|
+
* Add advanced features (addDirs, toolOutputTokenLimit)
|
|
69
|
+
*/
|
|
70
|
+
private addAdvancedFeatures;
|
|
71
|
+
/**
|
|
72
|
+
* Handle prompt with concise mode and stdin for large prompts
|
|
73
|
+
*/
|
|
74
|
+
private handlePrompt;
|
|
75
|
+
/**
|
|
76
|
+
* Cleanup temporary file if created
|
|
77
|
+
*/
|
|
78
|
+
static cleanupTempFile(tempFile: string): void;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=codexCommandBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codexCommandBuilder.d.ts","sourceRoot":"","sources":["../../src/utils/codexCommandBuilder.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,C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