converse-mcp-server 2.9.0 → 2.9.2
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/.env.example +0 -3
- package/README.md +0 -1
- package/docs/API.md +18 -20
- package/docs/ARCHITECTURE.md +4 -4
- package/docs/PROVIDERS.md +13 -18
- package/package.json +2 -1
- package/src/config.js +4 -15
- package/src/prompts/helpPrompt.js +368 -102
- package/src/providers/anthropic.js +0 -63
- package/src/providers/google.js +0 -45
- package/src/providers/mistral.js +3 -0
- package/src/providers/openai-compatible.js +3 -0
- package/src/providers/openai.js +3 -45
- package/src/providers/xai.js +3 -0
- package/src/tools/chat.js +1 -1
- package/src/tools/consensus.js +1 -1
package/.env.example
CHANGED
|
@@ -77,9 +77,6 @@ OPENROUTER_REFERER=https://github.com/FallDownTheSystem/converse
|
|
|
77
77
|
# WARNING: Interactive policies may cause hangs in server/headless mode
|
|
78
78
|
# CODEX_APPROVAL_POLICY=never
|
|
79
79
|
|
|
80
|
-
# Default model when user specifies model: 'codex' (default: gpt-5-codex)
|
|
81
|
-
# CODEX_DEFAULT_MODEL=gpt-5-codex
|
|
82
|
-
|
|
83
80
|
# ============================================
|
|
84
81
|
# Server Configuration
|
|
85
82
|
# ============================================
|
package/README.md
CHANGED
|
@@ -353,7 +353,6 @@ CODEX_API_KEY=your_codex_api_key_here # Optional if ChatGPT login availabl
|
|
|
353
353
|
CODEX_SANDBOX_MODE=read-only # read-only (default), workspace-write, danger-full-access
|
|
354
354
|
CODEX_SKIP_GIT_CHECK=true # true (default), false
|
|
355
355
|
CODEX_APPROVAL_POLICY=never # never (default), untrusted, on-failure, on-request
|
|
356
|
-
CODEX_DEFAULT_MODEL=gpt-5-codex # Default: gpt-5-codex
|
|
357
356
|
```
|
|
358
357
|
|
|
359
358
|
### Configuration Options
|
package/docs/API.md
CHANGED
|
@@ -129,11 +129,11 @@ MCP_TRANSPORT=stdio npm start
|
|
|
129
129
|
"continuation": {
|
|
130
130
|
"id": "conv_d6a6a5ec-6900-4fd8-a4e0-1fa4f75dfc42",
|
|
131
131
|
"provider": "openai",
|
|
132
|
-
"model": "gpt-
|
|
132
|
+
"model": "gpt-5-mini",
|
|
133
133
|
"messageCount": 3
|
|
134
134
|
},
|
|
135
135
|
"metadata": {
|
|
136
|
-
"model": "gpt-
|
|
136
|
+
"model": "gpt-5-mini",
|
|
137
137
|
"usage": {
|
|
138
138
|
"input_tokens": 150,
|
|
139
139
|
"output_tokens": 85,
|
|
@@ -356,22 +356,25 @@ conv_architecture_design/
|
|
|
356
356
|
|
|
357
357
|
| Model | Context | Tokens | Features | Use Cases |
|
|
358
358
|
|-------|---------|--------|----------|-----------|
|
|
359
|
+
| `gpt-5.1` | 1M | 128K | Latest GPT | Multimodal, general purpose |
|
|
360
|
+
| `gpt-5` | 1M | 64K | Advanced | Complex reasoning, analysis |
|
|
361
|
+
| `gpt-5-mini` | 1M | 64K | Fast | Balanced performance/speed |
|
|
362
|
+
| `gpt-5-nano` | 1M | 64K | Ultra-fast | Quick responses, simple queries |
|
|
363
|
+
| `gpt-5-pro` | 1M | 128K | Pro tier | Extended capabilities |
|
|
359
364
|
| `o3` | 200K | 100K | Reasoning | Logic, analysis, complex problems |
|
|
360
|
-
| `o3-
|
|
361
|
-
| `o4-mini` | 200K | 100K |
|
|
362
|
-
| `gpt-
|
|
363
|
-
| `gpt-4o-mini` | 128K | 16K | Fast multimodal | Quick responses, images |
|
|
365
|
+
| `o3-pro` | 200K | 100K | Extended reasoning | Deep analysis |
|
|
366
|
+
| `o4-mini` | 200K | 100K | Fast reasoning | General purpose, rapid reasoning |
|
|
367
|
+
| `gpt-4.1` | 1M | 32K | Large context | Long documents, analysis |
|
|
364
368
|
|
|
365
369
|
### Google/Gemini Models (API-based)
|
|
366
370
|
|
|
367
371
|
| Model | Alias | Context | Tokens | Features | Use Cases |
|
|
368
372
|
|-------|-------|---------|--------|----------|-----------|
|
|
369
373
|
| `gemini-3-pro-preview` | `pro` | 1M | 64K | Thinking levels, enhanced reasoning | Complex problems, deep analysis |
|
|
370
|
-
| `gemini-2.5-flash` | `flash` | 1M | 65K | Ultra-fast | Quick analysis, simple queries |
|
|
371
374
|
| `gemini-2.5-pro` | `pro 2.5` | 1M | 65K | Thinking mode | Deep reasoning, architecture |
|
|
372
|
-
| `gemini-2.
|
|
375
|
+
| `gemini-2.5-flash` | `flash` | 1M | 65K | Ultra-fast | Quick analysis, simple queries |
|
|
373
376
|
|
|
374
|
-
**Note:** The short model name `gemini` now routes to **Gemini CLI** (OAuth-based). For Google API access, use specific model names like `gemini-2.5-pro` or `gemini-2.
|
|
377
|
+
**Note:** The short model name `gemini` now routes to **Gemini CLI** (OAuth-based). For Google API access, use specific model names like `gemini-2.5-pro` or `gemini-2.5-flash`.
|
|
375
378
|
|
|
376
379
|
### X.AI/Grok Models
|
|
377
380
|
|
|
@@ -384,11 +387,11 @@ conv_architecture_design/
|
|
|
384
387
|
|
|
385
388
|
| Model | Alias | Context | Tokens | Features | Use Cases |
|
|
386
389
|
|-------|-------|---------|--------|----------|-----------|
|
|
387
|
-
| `claude-opus-4-
|
|
388
|
-
| `claude-
|
|
389
|
-
| `claude-
|
|
390
|
-
| `claude-
|
|
391
|
-
| `claude-
|
|
390
|
+
| `claude-opus-4-5-20250220` | `opus-4.5`, `opus` | 200K | 32K | Extended thinking, images, caching | Most capable reasoning |
|
|
391
|
+
| `claude-opus-4-1-20250805` | `opus-4.1`, `opus-4` | 200K | 32K | Extended thinking, images, caching | Complex reasoning tasks |
|
|
392
|
+
| `claude-sonnet-4-5-20250929` | `sonnet-4.5`, `sonnet` | 200K | 64K | Extended thinking, images, caching | Enhanced reasoning |
|
|
393
|
+
| `claude-sonnet-4-20250514` | `sonnet-4` | 200K | 64K | Extended thinking, images, caching | High performance, balanced |
|
|
394
|
+
| `claude-haiku-4-5-20251001` | `haiku-4.5`, `haiku` | 200K | 64K | Extended thinking, caching | Fast and intelligent |
|
|
392
395
|
|
|
393
396
|
**Prompt Caching (Always Enabled):**
|
|
394
397
|
- System prompts are automatically cached for 1 hour using Anthropic's prompt caching
|
|
@@ -475,7 +478,6 @@ gemini
|
|
|
475
478
|
- `CODEX_SANDBOX_MODE` - Filesystem access control
|
|
476
479
|
- `CODEX_SKIP_GIT_CHECK` - Git repository requirement
|
|
477
480
|
- `CODEX_APPROVAL_POLICY` - Command approval behavior
|
|
478
|
-
- `CODEX_DEFAULT_MODEL` - Default model when using `model: 'codex'`
|
|
479
481
|
|
|
480
482
|
### Model Selection
|
|
481
483
|
|
|
@@ -541,9 +543,6 @@ Control Codex behavior through environment variables:
|
|
|
541
543
|
- `on-failure`: Prompt when commands fail
|
|
542
544
|
- `on-request`: Let model decide (may hang in headless mode)
|
|
543
545
|
|
|
544
|
-
**CODEX_DEFAULT_MODEL** - Default model when `model: 'codex'`:
|
|
545
|
-
- Default: `gpt-5-codex`
|
|
546
|
-
|
|
547
546
|
**Authentication:**
|
|
548
547
|
- Requires ChatGPT login (system-wide, persists across restarts)
|
|
549
548
|
- Alternative: Set `CODEX_API_KEY` environment variable for headless deployments
|
|
@@ -557,7 +556,6 @@ CODEX_API_KEY=your_codex_api_key_here
|
|
|
557
556
|
CODEX_SANDBOX_MODE=read-only # Default: read-only
|
|
558
557
|
CODEX_SKIP_GIT_CHECK=true # Default: true
|
|
559
558
|
CODEX_APPROVAL_POLICY=never # Default: never
|
|
560
|
-
CODEX_DEFAULT_MODEL=gpt-5-codex # Default: gpt-5-codex
|
|
561
559
|
```
|
|
562
560
|
|
|
563
561
|
## Context Processing
|
|
@@ -630,7 +628,7 @@ Response includes continuation ID:
|
|
|
630
628
|
"continuation": {
|
|
631
629
|
"id": "conv_abc123",
|
|
632
630
|
"provider": "openai",
|
|
633
|
-
"model": "gpt-
|
|
631
|
+
"model": "gpt-5-mini",
|
|
634
632
|
"messageCount": 2
|
|
635
633
|
}
|
|
636
634
|
}
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -471,10 +471,10 @@ function generateRequestId() {
|
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
// All operations tagged with request ID
|
|
474
|
-
logger.info('Processing chat request', {
|
|
475
|
-
requestId,
|
|
476
|
-
provider: 'openai',
|
|
477
|
-
model: 'gpt-
|
|
474
|
+
logger.info('Processing chat request', {
|
|
475
|
+
requestId,
|
|
476
|
+
provider: 'openai',
|
|
477
|
+
model: 'gpt-5'
|
|
478
478
|
});
|
|
479
479
|
```
|
|
480
480
|
|
package/docs/PROVIDERS.md
CHANGED
|
@@ -9,11 +9,10 @@ This guide documents all supported AI providers in the Converse MCP Server and t
|
|
|
9
9
|
- **Get Key**: [platform.openai.com/api-keys](https://platform.openai.com/api-keys)
|
|
10
10
|
- **Environment Variable**: `OPENAI_API_KEY`
|
|
11
11
|
- **Supported Models**:
|
|
12
|
-
- `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-pro` - GPT-5 family with advanced reasoning
|
|
13
|
-
- `o3`, `o3-
|
|
14
|
-
- `o4-mini` - Latest fast reasoning model
|
|
12
|
+
- `gpt-5.1`, `gpt-5`, `gpt-5-mini`, `gpt-5-nano`, `gpt-5-pro` - GPT-5 family with advanced reasoning
|
|
13
|
+
- `o3`, `o3-pro`, `o4-mini` - Advanced reasoning models
|
|
15
14
|
- `gpt-4.1` - Large context (1M tokens)
|
|
16
|
-
- `
|
|
15
|
+
- `o3-deep-research`, `o4-mini-deep-research` - Deep research models
|
|
17
16
|
|
|
18
17
|
### Google (Gemini)
|
|
19
18
|
- **API Key Format**: `AIzaSy...` (varies)
|
|
@@ -23,8 +22,7 @@ This guide documents all supported AI providers in the Converse MCP Server and t
|
|
|
23
22
|
- `gemini-3-pro-preview` (alias: `pro`) - Enhanced reasoning with thinking levels (1M context, 64K output)
|
|
24
23
|
- `gemini-2.5-pro` (alias: `pro 2.5`) - Deep reasoning with thinking budget (1M context, 65K output)
|
|
25
24
|
- `gemini-2.5-flash` (alias: `flash`) - Ultra-fast model with thinking budget (1M context, 65K output)
|
|
26
|
-
|
|
27
|
-
- **Note**: The short model name `gemini` now routes to **Gemini CLI** (OAuth-based access). For Google API access, use specific model names like `gemini-2.5-pro` or `gemini-2.0-flash`.
|
|
25
|
+
- **Note**: The short model name `gemini` now routes to **Gemini CLI** (OAuth-based access). For Google API access, use specific model names like `gemini-2.5-pro` or `gemini-2.5-flash`.
|
|
28
26
|
|
|
29
27
|
### X.AI (Grok)
|
|
30
28
|
- **API Key Format**: `xai-...` (starts with `xai-`)
|
|
@@ -39,12 +37,11 @@ This guide documents all supported AI providers in the Converse MCP Server and t
|
|
|
39
37
|
- **Get Key**: [console.anthropic.com](https://console.anthropic.com/)
|
|
40
38
|
- **Environment Variable**: `ANTHROPIC_API_KEY`
|
|
41
39
|
- **Supported Models**:
|
|
40
|
+
- `claude-opus-4-5-20250220` - Most capable with extended thinking (32K output)
|
|
42
41
|
- `claude-opus-4-1-20250805` - Highest intelligence with extended thinking (32K output)
|
|
42
|
+
- `claude-sonnet-4-5-20250929` - Enhanced reasoning with extended thinking (64K output)
|
|
43
43
|
- `claude-sonnet-4-20250514` - Balanced performance with extended thinking (64K output)
|
|
44
|
-
- `claude-3-7-sonnet-20250219` - Enhanced 3.x generation with thinking (64K output)
|
|
45
44
|
- `claude-haiku-4-5-20251001` - Fast and intelligent with extended thinking (64K output)
|
|
46
|
-
- `claude-3-5-sonnet-20241022` - Fast and intelligent model (8K output)
|
|
47
|
-
- `claude-3-5-haiku-20241022` - Fastest Claude model (8K output)
|
|
48
45
|
- `claude-3-opus-20240229`, `claude-3-sonnet-20240229`, `claude-3-haiku-20240307` - Previous generation
|
|
49
46
|
|
|
50
47
|
### Mistral
|
|
@@ -94,7 +91,6 @@ This guide documents all supported AI providers in the Converse MCP Server and t
|
|
|
94
91
|
- `CODEX_SANDBOX_MODE` - Filesystem access control (default: read-only)
|
|
95
92
|
- `CODEX_SKIP_GIT_CHECK` - Skip Git repository validation (default: true)
|
|
96
93
|
- `CODEX_APPROVAL_POLICY` - Command approval behavior (default: never)
|
|
97
|
-
- `CODEX_DEFAULT_MODEL` - Default model (default: gpt-5-codex)
|
|
98
94
|
- **Supported Models**:
|
|
99
95
|
- `codex` - OpenAI Codex agentic coding assistant
|
|
100
96
|
- Thread-based sessions with persistent context
|
|
@@ -204,7 +200,6 @@ CODEX_API_KEY=your_codex_api_key_here # Optional if ChatGPT login availabl
|
|
|
204
200
|
CODEX_SANDBOX_MODE=read-only # read-only (default), workspace-write, danger-full-access
|
|
205
201
|
CODEX_SKIP_GIT_CHECK=true # true (default), false
|
|
206
202
|
CODEX_APPROVAL_POLICY=never # never (default), untrusted, on-failure, on-request
|
|
207
|
-
CODEX_DEFAULT_MODEL=gpt-5-codex # Default: gpt-5-codex
|
|
208
203
|
```
|
|
209
204
|
|
|
210
205
|
### Claude Configuration (claude_desktop_config.json)
|
|
@@ -235,9 +230,9 @@ CODEX_DEFAULT_MODEL=gpt-5-codex # Default: gpt-5-codex
|
|
|
235
230
|
All providers support streaming responses for real-time output.
|
|
236
231
|
|
|
237
232
|
### Image Support
|
|
238
|
-
- **Full Support**: OpenAI, Google, X.AI (Grok-4), Anthropic (Claude-4 series, Claude-3
|
|
233
|
+
- **Full Support**: OpenAI, Google, X.AI (Grok-4), Anthropic (Claude-4 series, Claude-3-Opus)
|
|
239
234
|
- **Via OpenRouter**: Depends on the underlying model
|
|
240
|
-
- **No Support**: DeepSeek, Mistral (except Large),
|
|
235
|
+
- **No Support**: DeepSeek, Mistral (except Large), Codex
|
|
241
236
|
|
|
242
237
|
### Web Search
|
|
243
238
|
- **Native Support**: OpenAI, Google, X.AI (Grok-4)
|
|
@@ -248,7 +243,7 @@ All providers support streaming responses for real-time output.
|
|
|
248
243
|
- **Google**:
|
|
249
244
|
- Gemini 3.0 Pro: Thinking levels (low/high) via `reasoning_effort` - always enabled
|
|
250
245
|
- Gemini 2.5 Pro/Flash: Thinking budget (token-based) via `reasoning_effort`
|
|
251
|
-
- **Anthropic**: Claude 4
|
|
246
|
+
- **Anthropic**: All Claude 4 series models support extended thinking with `reasoning_effort`
|
|
252
247
|
- **Codex**: Thread-based agentic reasoning with persistent context
|
|
253
248
|
- **Others**: Standard inference only
|
|
254
249
|
|
|
@@ -282,14 +277,14 @@ When using the chat or consensus tools, specify models using their identifiers:
|
|
|
282
277
|
```javascript
|
|
283
278
|
// Chat tool examples
|
|
284
279
|
{
|
|
285
|
-
"model": "gpt-
|
|
280
|
+
"model": "gpt-5", // OpenAI (keyword match)
|
|
286
281
|
"model": "claude-opus-4", // Anthropic (keyword match, auto-resolves)
|
|
287
282
|
"model": "sonnet", // Anthropic (keyword match)
|
|
288
283
|
"model": "gemini-2.5-pro", // Google (keyword match)
|
|
289
284
|
"model": "grok-4", // X.AI (keyword match)
|
|
290
285
|
"model": "mistral-large", // Mistral (keyword match)
|
|
291
286
|
"model": "deepseek-chat", // DeepSeek (keyword match)
|
|
292
|
-
"model": "anthropic/claude-
|
|
287
|
+
"model": "anthropic/claude-sonnet-4", // OpenRouter (slash format, not in Anthropic)
|
|
293
288
|
"model": "qwen/qwen3-coder", // OpenRouter (static model)
|
|
294
289
|
"model": "openrouter/auto" // OpenRouter auto-selection
|
|
295
290
|
}
|
|
@@ -298,7 +293,7 @@ When using the chat or consensus tools, specify models using their identifiers:
|
|
|
298
293
|
{
|
|
299
294
|
"models": [
|
|
300
295
|
{"model": "o3"},
|
|
301
|
-
{"model": "claude-
|
|
296
|
+
{"model": "claude-sonnet-4"},
|
|
302
297
|
{"model": "gemini-2.5-pro"}
|
|
303
298
|
]
|
|
304
299
|
}
|
|
@@ -313,7 +308,7 @@ When using the chat or consensus tools, specify models using their identifiers:
|
|
|
313
308
|
|
|
314
309
|
### Model Not Found
|
|
315
310
|
- Use exact model identifiers as listed above
|
|
316
|
-
- Some providers support aliases (e.g., "claude" → "claude-
|
|
311
|
+
- Some providers support aliases (e.g., "claude" → "claude-sonnet-4-5")
|
|
317
312
|
- Check provider documentation for model availability in your region
|
|
318
313
|
|
|
319
314
|
### Rate Limits
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "converse-mcp-server",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.2",
|
|
4
4
|
"description": "Converse MCP Server - Converse with other LLMs with chat and consensus tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"dotenv": "^17.2.3",
|
|
107
107
|
"express": "^5.1.0",
|
|
108
108
|
"lru-cache": "^11.2.2",
|
|
109
|
+
"nanoid": "^5.1.6",
|
|
109
110
|
"openai": "^6.9.1",
|
|
110
111
|
"p-limit": "^7.2.0",
|
|
111
112
|
"vite": "^7.2.2"
|
package/src/config.js
CHANGED
|
@@ -39,8 +39,6 @@ const logger = createLogger('config');
|
|
|
39
39
|
const CONFIG_SCHEMA = {
|
|
40
40
|
// Server configuration
|
|
41
41
|
server: {
|
|
42
|
-
PORT: { type: 'number', default: 3157, description: 'Server port' },
|
|
43
|
-
HOST: { type: 'string', default: 'localhost', description: 'Server host' },
|
|
44
42
|
NODE_ENV: {
|
|
45
43
|
type: 'string',
|
|
46
44
|
default: 'development',
|
|
@@ -278,11 +276,6 @@ const CONFIG_SCHEMA = {
|
|
|
278
276
|
description:
|
|
279
277
|
'Approval policy (never | untrusted | on-failure | on-request)',
|
|
280
278
|
},
|
|
281
|
-
CODEX_DEFAULT_MODEL: {
|
|
282
|
-
type: 'string',
|
|
283
|
-
default: 'gpt-5-codex',
|
|
284
|
-
description: 'Default Codex model',
|
|
285
|
-
},
|
|
286
279
|
},
|
|
287
280
|
|
|
288
281
|
// MCP configuration
|
|
@@ -819,13 +812,6 @@ export async function validateRuntimeConfig(config) {
|
|
|
819
812
|
// Validate Codex configuration
|
|
820
813
|
validateCodexConfig(config);
|
|
821
814
|
|
|
822
|
-
// Validate server configuration
|
|
823
|
-
if (config.server.port < 1 || config.server.port > 65535) {
|
|
824
|
-
throw new ConfigurationError(
|
|
825
|
-
`Invalid port number: ${config.server.port}`,
|
|
826
|
-
);
|
|
827
|
-
}
|
|
828
|
-
|
|
829
815
|
// Validate environment
|
|
830
816
|
const validEnvs = ['development', 'production', 'test'];
|
|
831
817
|
if (!validEnvs.includes(config.environment.nodeEnv)) {
|
|
@@ -933,7 +919,7 @@ function logConfigurationSummary(config) {
|
|
|
933
919
|
logger.info('Configuration loaded successfully', {
|
|
934
920
|
data: {
|
|
935
921
|
environment: config.environment.nodeEnv,
|
|
936
|
-
|
|
922
|
+
transport: config.transport.mcptransport || 'stdio',
|
|
937
923
|
logLevel: config.server.log_level,
|
|
938
924
|
availableProviders: availableProviders.join(', ') || 'none',
|
|
939
925
|
mcpServer: `${config.mcp.name} v${config.mcp.version}`,
|
|
@@ -965,3 +951,6 @@ export function getMcpClientConfig(config) {
|
|
|
965
951
|
providers: getAvailableProviders(config),
|
|
966
952
|
};
|
|
967
953
|
}
|
|
954
|
+
|
|
955
|
+
// Export CONFIG_SCHEMA for use by help documentation generator
|
|
956
|
+
export { CONFIG_SCHEMA };
|
|
@@ -1,11 +1,347 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Help Prompt Implementation
|
|
3
3
|
*
|
|
4
|
-
* Provides comprehensive help documentation for the Converse MCP Server
|
|
4
|
+
* Provides comprehensive help documentation for the Converse MCP Server.
|
|
5
|
+
* Auto-generates documentation from code structures (CONFIG_SCHEMA, tool schemas, provider models).
|
|
5
6
|
*/
|
|
6
7
|
|
|
7
8
|
import { getProviders } from '../providers/index.js';
|
|
8
9
|
import { getTools } from '../tools/index.js';
|
|
10
|
+
import { CONFIG_SCHEMA } from '../config.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Sample values for generating realistic tool examples.
|
|
14
|
+
* Structure comes from schema, content from curated values here.
|
|
15
|
+
*/
|
|
16
|
+
const SAMPLE_VALUES = {
|
|
17
|
+
prompt: 'Explain the authentication flow in this codebase',
|
|
18
|
+
files: ['src/auth.js'],
|
|
19
|
+
images: ['./diagram.png'],
|
|
20
|
+
model: 'auto',
|
|
21
|
+
models: ['codex', 'gemini', 'claude'],
|
|
22
|
+
continuation_id: 'conv_abc123',
|
|
23
|
+
temperature: 0.5,
|
|
24
|
+
reasoning_effort: 'medium',
|
|
25
|
+
verbosity: 'medium',
|
|
26
|
+
use_websearch: false,
|
|
27
|
+
async: false,
|
|
28
|
+
export: false,
|
|
29
|
+
enable_cross_feedback: true,
|
|
30
|
+
cross_feedback_prompt: null,
|
|
31
|
+
full_history: false,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Safely get models from a provider (handles CLI providers that may throw)
|
|
36
|
+
* @param {object} provider - Provider object
|
|
37
|
+
* @param {string} name - Provider name for logging
|
|
38
|
+
* @returns {object} Models map or empty object on error
|
|
39
|
+
*/
|
|
40
|
+
function safeGetModels(provider, name) {
|
|
41
|
+
try {
|
|
42
|
+
return provider?.getSupportedModels() || {};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
// CLI providers may throw if not installed - silently skip
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Generate environment variables documentation from CONFIG_SCHEMA.
|
|
51
|
+
* Sorted alphabetically within categories, compact one-liner format.
|
|
52
|
+
* @returns {string} Formatted markdown section
|
|
53
|
+
*/
|
|
54
|
+
function generateEnvironmentVariablesSection() {
|
|
55
|
+
const categoryTitles = {
|
|
56
|
+
server: 'Server Configuration',
|
|
57
|
+
transport: 'Transport Configuration',
|
|
58
|
+
apiKeys: 'API Keys (at least one required)',
|
|
59
|
+
providers: 'Provider Configuration',
|
|
60
|
+
mcp: 'MCP Configuration',
|
|
61
|
+
summarization: 'Summarization Configuration',
|
|
62
|
+
async: 'Async Configuration',
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
let output = '';
|
|
66
|
+
|
|
67
|
+
for (const [category, vars] of Object.entries(CONFIG_SCHEMA)) {
|
|
68
|
+
const title = categoryTitles[category] || category;
|
|
69
|
+
output += `### ${title}\n`;
|
|
70
|
+
|
|
71
|
+
// Sort variables alphabetically within category
|
|
72
|
+
const sortedVars = Object.entries(vars).sort((a, b) =>
|
|
73
|
+
a[0].localeCompare(b[0]),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
for (const [varName, schema] of sortedVars) {
|
|
77
|
+
const tags = [];
|
|
78
|
+
|
|
79
|
+
// Add required tag
|
|
80
|
+
if (schema.required) {
|
|
81
|
+
tags.push('Required');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Add secret tag for API keys
|
|
85
|
+
if (schema.secret) {
|
|
86
|
+
tags.push('Secret');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Add default value
|
|
90
|
+
if (schema.default !== undefined && schema.default !== null) {
|
|
91
|
+
tags.push(`Default: ${JSON.stringify(schema.default)}`);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const tagStr = tags.length > 0 ? ` (${tags.join(', ')})` : '';
|
|
95
|
+
output += `- \`${varName}\`${tagStr}: ${schema.description}\n`;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
output += '\n';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return output;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Generate tool example JSON from input schema using SAMPLE_VALUES.
|
|
106
|
+
* @param {string} toolName - Name of the tool
|
|
107
|
+
* @param {object} inputSchema - Tool's input schema
|
|
108
|
+
* @returns {string} Formatted JSON example in markdown code block
|
|
109
|
+
*/
|
|
110
|
+
function generateToolExamplesFromSchema(toolName, inputSchema) {
|
|
111
|
+
if (!inputSchema || !inputSchema.properties) {
|
|
112
|
+
return '';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const { properties, required = [] } = inputSchema;
|
|
116
|
+
const example = {};
|
|
117
|
+
|
|
118
|
+
// Include required parameters first
|
|
119
|
+
for (const name of required) {
|
|
120
|
+
if (properties[name]) {
|
|
121
|
+
example[name] = SAMPLE_VALUES[name] ?? getDefaultForType(properties[name]);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// For chat and consensus, add some optional parameters for richer examples
|
|
126
|
+
if (toolName === 'chat') {
|
|
127
|
+
// Add commonly used optional parameters
|
|
128
|
+
if (properties.model) example.model = SAMPLE_VALUES.model;
|
|
129
|
+
if (properties.files) example.files = SAMPLE_VALUES.files;
|
|
130
|
+
if (properties.temperature) example.temperature = SAMPLE_VALUES.temperature;
|
|
131
|
+
} else if (toolName === 'consensus') {
|
|
132
|
+
// Add commonly used optional parameters
|
|
133
|
+
if (properties.files) example.files = SAMPLE_VALUES.files;
|
|
134
|
+
if (properties.enable_cross_feedback)
|
|
135
|
+
example.enable_cross_feedback = SAMPLE_VALUES.enable_cross_feedback;
|
|
136
|
+
if (properties.temperature) example.temperature = 0.2; // Lower for consensus
|
|
137
|
+
} else if (toolName === 'check_status') {
|
|
138
|
+
// For check_status, just show the continuation_id
|
|
139
|
+
if (properties.continuation_id)
|
|
140
|
+
example.continuation_id = SAMPLE_VALUES.continuation_id;
|
|
141
|
+
} else if (toolName === 'cancel_job') {
|
|
142
|
+
// For cancel_job, just show the continuation_id
|
|
143
|
+
if (properties.continuation_id)
|
|
144
|
+
example.continuation_id = SAMPLE_VALUES.continuation_id;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return `\`\`\`json\n${JSON.stringify(example, null, 2)}\n\`\`\``;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Get a default value based on JSON schema type.
|
|
152
|
+
* @param {object} prop - Property schema
|
|
153
|
+
* @returns {any} Default value
|
|
154
|
+
*/
|
|
155
|
+
function getDefaultForType(prop) {
|
|
156
|
+
if (prop.default !== undefined) return prop.default;
|
|
157
|
+
if (prop.enum && prop.enum.length > 0) return prop.enum[0];
|
|
158
|
+
|
|
159
|
+
switch (prop.type) {
|
|
160
|
+
case 'string':
|
|
161
|
+
return 'example';
|
|
162
|
+
case 'number':
|
|
163
|
+
return 0;
|
|
164
|
+
case 'boolean':
|
|
165
|
+
return false;
|
|
166
|
+
case 'array':
|
|
167
|
+
return [];
|
|
168
|
+
case 'object':
|
|
169
|
+
return {};
|
|
170
|
+
default:
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Generate factual model categorization lists (no subjective tips).
|
|
177
|
+
* Categories: context window, web search, thinking mode, image support.
|
|
178
|
+
* @param {object} allModels - Map of provider name to models
|
|
179
|
+
* @returns {string} Formatted markdown section with sorted model lists
|
|
180
|
+
*/
|
|
181
|
+
function generateModelCategories(allModels) {
|
|
182
|
+
// Flatten all models with provider info
|
|
183
|
+
const models = [];
|
|
184
|
+
for (const [providerName, providerModels] of Object.entries(allModels)) {
|
|
185
|
+
for (const [modelId, config] of Object.entries(providerModels)) {
|
|
186
|
+
models.push({
|
|
187
|
+
id: modelId,
|
|
188
|
+
provider: providerName,
|
|
189
|
+
...config,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Sort helper - alphabetically by model ID
|
|
195
|
+
const sortByModelId = (a, b) => a.id.localeCompare(b.id);
|
|
196
|
+
|
|
197
|
+
let output = '## Model Categories\n\n';
|
|
198
|
+
|
|
199
|
+
// Group by context window
|
|
200
|
+
output += '### Models by Context Window\n\n';
|
|
201
|
+
|
|
202
|
+
const windowGroups = {
|
|
203
|
+
'1M+ tokens': models.filter((m) => m.contextWindow >= 1000000),
|
|
204
|
+
'400K+ tokens': models.filter(
|
|
205
|
+
(m) => m.contextWindow >= 400000 && m.contextWindow < 1000000,
|
|
206
|
+
),
|
|
207
|
+
'200K+ tokens': models.filter(
|
|
208
|
+
(m) => m.contextWindow >= 200000 && m.contextWindow < 400000,
|
|
209
|
+
),
|
|
210
|
+
'Under 200K tokens': models.filter((m) => m.contextWindow < 200000),
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
for (const [groupName, groupModels] of Object.entries(windowGroups)) {
|
|
214
|
+
if (groupModels.length > 0) {
|
|
215
|
+
output += `**${groupName}:**\n`;
|
|
216
|
+
for (const m of groupModels.sort(sortByModelId)) {
|
|
217
|
+
output += `- ${m.id} (${m.provider}) - ${m.contextWindow.toLocaleString()} tokens\n`;
|
|
218
|
+
}
|
|
219
|
+
output += '\n';
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Models with Web Search
|
|
224
|
+
const webSearchModels = models
|
|
225
|
+
.filter((m) => m.supportsWebSearch)
|
|
226
|
+
.sort(sortByModelId);
|
|
227
|
+
if (webSearchModels.length > 0) {
|
|
228
|
+
output += '### Models with Web Search\n';
|
|
229
|
+
for (const m of webSearchModels) {
|
|
230
|
+
output += `- ${m.id} (${m.provider})\n`;
|
|
231
|
+
}
|
|
232
|
+
output += '\n';
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Models with Thinking Mode
|
|
236
|
+
const thinkingModels = models
|
|
237
|
+
.filter((m) => m.supportsThinking)
|
|
238
|
+
.sort(sortByModelId);
|
|
239
|
+
if (thinkingModels.length > 0) {
|
|
240
|
+
output += '### Models with Thinking Mode\n';
|
|
241
|
+
for (const m of thinkingModels) {
|
|
242
|
+
output += `- ${m.id} (${m.provider})\n`;
|
|
243
|
+
}
|
|
244
|
+
output += '\n';
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Models with Image Support
|
|
248
|
+
const imageModels = models
|
|
249
|
+
.filter((m) => m.supportsImages)
|
|
250
|
+
.sort(sortByModelId);
|
|
251
|
+
if (imageModels.length > 0) {
|
|
252
|
+
output += '### Models with Image Support\n';
|
|
253
|
+
for (const m of imageModels) {
|
|
254
|
+
output += `- ${m.id} (${m.provider})\n`;
|
|
255
|
+
}
|
|
256
|
+
output += '\n';
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return output;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Generate configuration tips from tool parameter schemas.
|
|
264
|
+
* Extracts enum values and ranges directly from schema.
|
|
265
|
+
* @param {object} tools - Map of tool name to tool implementation
|
|
266
|
+
* @returns {string} Formatted markdown section
|
|
267
|
+
*/
|
|
268
|
+
function generateConfigurationTips(tools) {
|
|
269
|
+
let output = '## Configuration Tips\n\n';
|
|
270
|
+
|
|
271
|
+
// Get chat tool schema for parameter info
|
|
272
|
+
const chatSchema = tools.chat?.inputSchema?.properties || {};
|
|
273
|
+
|
|
274
|
+
// Temperature Settings
|
|
275
|
+
if (chatSchema.temperature) {
|
|
276
|
+
const tempSchema = chatSchema.temperature;
|
|
277
|
+
output += '### Temperature Settings\n';
|
|
278
|
+
if (tempSchema.minimum !== undefined && tempSchema.maximum !== undefined) {
|
|
279
|
+
output += `Range: ${tempSchema.minimum} to ${tempSchema.maximum}\n`;
|
|
280
|
+
}
|
|
281
|
+
output += `- **0.0-0.3**: Factual, deterministic responses\n`;
|
|
282
|
+
output += `- **0.4-0.7**: Balanced creativity and accuracy (recommended)\n`;
|
|
283
|
+
output += `- **0.8-1.2**: Creative writing, brainstorming\n`;
|
|
284
|
+
if (tempSchema.maximum && tempSchema.maximum > 1.2) {
|
|
285
|
+
output += `- **1.3-${tempSchema.maximum}**: Highly experimental, unpredictable\n`;
|
|
286
|
+
}
|
|
287
|
+
output += '\n';
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Reasoning Effort
|
|
291
|
+
if (chatSchema.reasoning_effort) {
|
|
292
|
+
const effortSchema = chatSchema.reasoning_effort;
|
|
293
|
+
output += '### Reasoning Effort (for supported models)\n';
|
|
294
|
+
if (effortSchema.enum) {
|
|
295
|
+
for (const value of effortSchema.enum) {
|
|
296
|
+
const descriptions = {
|
|
297
|
+
none: 'No reasoning, fastest response (GPT-5.1+ only)',
|
|
298
|
+
minimal: 'Quick responses with minimal reasoning',
|
|
299
|
+
low: 'Light analysis, simple problems',
|
|
300
|
+
medium: 'Balanced reasoning (default)',
|
|
301
|
+
high: 'Deep analysis, complex problems',
|
|
302
|
+
max: 'Maximum reasoning capability',
|
|
303
|
+
};
|
|
304
|
+
output += `- **${value}**: ${descriptions[value] || value}\n`;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
output += '\n';
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Verbosity
|
|
311
|
+
if (chatSchema.verbosity) {
|
|
312
|
+
const verbSchema = chatSchema.verbosity;
|
|
313
|
+
output += '### Verbosity (for GPT-5 models)\n';
|
|
314
|
+
if (verbSchema.enum) {
|
|
315
|
+
const descriptions = {
|
|
316
|
+
low: 'Concise answers',
|
|
317
|
+
medium: 'Balanced detail (default)',
|
|
318
|
+
high: 'Thorough explanations',
|
|
319
|
+
};
|
|
320
|
+
for (const value of verbSchema.enum) {
|
|
321
|
+
output += `- **${value}**: ${descriptions[value] || value}\n`;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
output += '\n';
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// File Context
|
|
328
|
+
output += '### File Context\n';
|
|
329
|
+
output +=
|
|
330
|
+
'- Supports multiple file formats: code files, text, markdown, JSON, etc.\n';
|
|
331
|
+
output +=
|
|
332
|
+
'- Line ranges supported: `file.txt{10:50}` for lines 10-50, `file.txt{100:}` for line 100 onwards\n';
|
|
333
|
+
output += '- Files are automatically chunked if too large\n';
|
|
334
|
+
output +=
|
|
335
|
+
'- Images are base64 encoded and sent to models that support vision\n\n';
|
|
336
|
+
|
|
337
|
+
// Continuation IDs
|
|
338
|
+
output += '### Continuation IDs\n';
|
|
339
|
+
output += '- Automatically generated for new conversations\n';
|
|
340
|
+
output += '- Returned in the response for continuing conversations\n';
|
|
341
|
+
output += '- Conversations expire after 24 hours of inactivity\n\n';
|
|
342
|
+
|
|
343
|
+
return output;
|
|
344
|
+
}
|
|
9
345
|
|
|
10
346
|
/**
|
|
11
347
|
* Generate comprehensive help content dynamically based on current providers
|
|
@@ -14,7 +350,7 @@ import { getTools } from '../tools/index.js';
|
|
|
14
350
|
export function generateHelpContent(config = null) {
|
|
15
351
|
const providers = getProviders();
|
|
16
352
|
|
|
17
|
-
// Collect all models from all providers
|
|
353
|
+
// Collect all models from all providers (including CLI providers with safe access)
|
|
18
354
|
const allModels = {
|
|
19
355
|
openai: providers.openai?.getSupportedModels() || {},
|
|
20
356
|
google: providers.google?.getSupportedModels() || {},
|
|
@@ -23,8 +359,18 @@ export function generateHelpContent(config = null) {
|
|
|
23
359
|
mistral: providers.mistral?.getSupportedModels() || {},
|
|
24
360
|
deepseek: providers.deepseek?.getSupportedModels() || {},
|
|
25
361
|
openrouter: providers.openrouter?.getSupportedModels() || {},
|
|
362
|
+
// CLI providers - use safeGetModels (may throw if CLI not installed)
|
|
363
|
+
codex: safeGetModels(providers.codex, 'codex'),
|
|
364
|
+
claude: safeGetModels(providers.claude, 'claude'),
|
|
365
|
+
'gemini-cli': safeGetModels(providers['gemini-cli'], 'gemini-cli'),
|
|
26
366
|
};
|
|
27
367
|
|
|
368
|
+
// Limit OpenRouter models if dynamic models enabled (could have hundreds)
|
|
369
|
+
if (allModels.openrouter && Object.keys(allModels.openrouter).length > 20) {
|
|
370
|
+
const entries = Object.entries(allModels.openrouter).slice(0, 20);
|
|
371
|
+
allModels.openrouter = Object.fromEntries(entries);
|
|
372
|
+
}
|
|
373
|
+
|
|
28
374
|
// Format provider models for display
|
|
29
375
|
const formatProviderModels = (providerName, models) => {
|
|
30
376
|
if (!models || Object.keys(models).length === 0) return '';
|
|
@@ -80,33 +426,9 @@ export function generateHelpContent(config = null) {
|
|
|
80
426
|
return params.join('\n');
|
|
81
427
|
};
|
|
82
428
|
|
|
83
|
-
const formatToolExample = (toolName) => {
|
|
84
|
-
if (toolName === 'chat') {
|
|
85
|
-
return `\`\`\`json
|
|
86
|
-
{
|
|
87
|
-
"prompt": "Explain the code in main.js",
|
|
88
|
-
"model": "gpt-5",
|
|
89
|
-
"files": ["C:\\\\Users\\\\username\\\\project\\\\main.js"],
|
|
90
|
-
"temperature": 0.7,
|
|
91
|
-
"use_websearch": false
|
|
92
|
-
}
|
|
93
|
-
\`\`\``;
|
|
94
|
-
} else if (toolName === 'consensus') {
|
|
95
|
-
return `\`\`\`json
|
|
96
|
-
{
|
|
97
|
-
"prompt": "Should we use microservices architecture for our new project?",
|
|
98
|
-
"models": ["codex", "gemini", "claude"],
|
|
99
|
-
"files": ["./requirements.md", "C:\\\\Users\\\\username\\\\architecture.md"],
|
|
100
|
-
"enable_cross_feedback": true,
|
|
101
|
-
"temperature": 0.3
|
|
102
|
-
}
|
|
103
|
-
\`\`\``;
|
|
104
|
-
}
|
|
105
|
-
return '';
|
|
106
|
-
};
|
|
107
|
-
|
|
108
429
|
const toolsSection = Object.entries(tools)
|
|
109
430
|
.map(([name, tool], index) => {
|
|
431
|
+
const example = generateToolExamplesFromSchema(name, tool.inputSchema);
|
|
110
432
|
return `### ${index + 1}. ${name.charAt(0).toUpperCase() + name.slice(1)} Tool
|
|
111
433
|
${tool.description}
|
|
112
434
|
|
|
@@ -114,7 +436,7 @@ ${tool.description}
|
|
|
114
436
|
${formatToolParameters(tool.inputSchema)}
|
|
115
437
|
|
|
116
438
|
**Example Usage:**
|
|
117
|
-
${
|
|
439
|
+
${example}`;
|
|
118
440
|
})
|
|
119
441
|
.join('\n\n');
|
|
120
442
|
|
|
@@ -134,54 +456,13 @@ ${formatProviderModels('Anthropic', allModels.anthropic)}
|
|
|
134
456
|
${formatProviderModels('Mistral', allModels.mistral)}
|
|
135
457
|
${formatProviderModels('DeepSeek', allModels.deepseek)}
|
|
136
458
|
${formatProviderModels('OpenRouter', allModels.openrouter)}
|
|
459
|
+
${formatProviderModels('Codex', allModels.codex)}
|
|
460
|
+
${formatProviderModels('Claude CLI', allModels.claude)}
|
|
461
|
+
${formatProviderModels('Gemini CLI', allModels['gemini-cli'])}
|
|
462
|
+
|
|
463
|
+
${generateModelCategories(allModels)}
|
|
137
464
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### For Complex Reasoning Tasks
|
|
141
|
-
- **Most Intelligent**: gpt-5, gpt-5-pro, gemini-pro, grok-4
|
|
142
|
-
- **Fast & Smart**: gpt-5-mini, gpt-5-mini, o4-mini, flash
|
|
143
|
-
- **Budget-Friendly**: gpt-5-nano, gpt-4o-mini, gemini-2.0-flash-lite
|
|
144
|
-
|
|
145
|
-
### For Quick Responses
|
|
146
|
-
- **Ultra-Fast**: gpt-5-nano, flash, gemini-2.0-flash, gpt-4o-mini
|
|
147
|
-
- **Good Balance**: gpt-5-mini, o4-mini, grok-code-fast-1
|
|
148
|
-
|
|
149
|
-
### For Large Context Windows
|
|
150
|
-
- **1M+ Tokens**: gpt-4.1 (1M), all Gemini models (1M)
|
|
151
|
-
- **400K Tokens**: gpt-5 family (gpt-5, gpt-5-mini, gpt-5-nano, gpt-5-pro)
|
|
152
|
-
- **256K Tokens**: grok-4 series
|
|
153
|
-
- **200K Tokens**: o3 series, o4-mini
|
|
154
|
-
|
|
155
|
-
### Special Features
|
|
156
|
-
- **Web Search**: gpt-5, gpt-5-mini, gpt-5-pro, o3 series, o4-mini, gpt-4 series, gemini models with grounding, grok-4
|
|
157
|
-
- **Thinking Mode**: gpt-5 series (reasoning_effort), gemini models (thinking budget)
|
|
158
|
-
- **Image Support**: All models except gemini-2.0-flash-lite and grok-code-fast-1
|
|
159
|
-
|
|
160
|
-
## Configuration Tips
|
|
161
|
-
|
|
162
|
-
### Temperature Settings
|
|
163
|
-
- **0.0-0.3**: Factual, deterministic responses
|
|
164
|
-
- **0.4-0.7**: Balanced creativity and accuracy (recommended)
|
|
165
|
-
- **0.8-1.2**: Creative writing, brainstorming
|
|
166
|
-
- **1.3-2.0**: Highly experimental, unpredictable
|
|
167
|
-
|
|
168
|
-
### Reasoning Effort (for supported models)
|
|
169
|
-
- **minimal**: Quick responses with minimal reasoning
|
|
170
|
-
- **low**: Light analysis, simple problems
|
|
171
|
-
- **medium**: Balanced reasoning (default)
|
|
172
|
-
- **high**: Deep analysis, complex problems
|
|
173
|
-
- **max**: Maximum reasoning capability
|
|
174
|
-
|
|
175
|
-
### File Context
|
|
176
|
-
- Supports multiple file formats: code files, text, markdown, JSON, etc.
|
|
177
|
-
- Use git-bash style paths on Windows: \`/c/Users/username/file.txt\`
|
|
178
|
-
- Files are automatically chunked if too large
|
|
179
|
-
- Images are base64 encoded and sent to models that support vision
|
|
180
|
-
|
|
181
|
-
### Continuation IDs
|
|
182
|
-
- Automatically generated for new conversations
|
|
183
|
-
- Returned in the response for continuing conversations
|
|
184
|
-
- Conversations expire after 24 hours of inactivity
|
|
465
|
+
${generateConfigurationTips(tools)}
|
|
185
466
|
|
|
186
467
|
## Best Practices
|
|
187
468
|
|
|
@@ -207,30 +488,15 @@ ${formatProviderModels('OpenRouter', allModels.openrouter)}
|
|
|
207
488
|
|
|
208
489
|
## Environment Variables
|
|
209
490
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
-
|
|
217
|
-
- \`
|
|
218
|
-
|
|
219
|
-
### OpenRouter Configuration:
|
|
220
|
-
- \`OPENROUTER_REFERER\`: OpenRouter referer header for compliance (required for OpenRouter)
|
|
221
|
-
- \`OPENROUTER_TITLE\`: OpenRouter X-Title header for request tracking (optional)
|
|
222
|
-
- \`OPENROUTER_DYNAMIC_MODELS\`: Enable dynamic model discovery via OpenRouter endpoints API (default: false). Must be set to true to use models in \`provider/model\` format (e.g., \`anthropic/claude-3.5-sonnet\`). When enabled, fetches actual model capabilities from API.
|
|
223
|
-
|
|
224
|
-
### Server Configuration:
|
|
225
|
-
- \`MAX_MCP_OUTPUT_TOKENS\`: Maximum response size (default: 25000)
|
|
226
|
-
- \`LOG_LEVEL\`: Logging verbosity (debug, info, warn, error)
|
|
227
|
-
- \`PORT\`: HTTP server port (default: 3157)
|
|
228
|
-
- \`HTTP_ENABLED\`: Enable HTTP transport (default: true)
|
|
229
|
-
- \`HTTP_RATE_LIMIT_ENABLED\`: Enable rate limiting (default: false)
|
|
230
|
-
- \`HTTP_RATE_LIMIT_WINDOW\`: Rate limit window in milliseconds (default: 900000 - 15 minutes)
|
|
231
|
-
- \`HTTP_RATE_LIMIT_MAX_REQUESTS\`: Maximum requests per window (default: 1000)
|
|
232
|
-
|
|
233
|
-
Note: Server name and version are automatically read from package.json.
|
|
491
|
+
${generateEnvironmentVariablesSection()}
|
|
492
|
+
|
|
493
|
+
## CLI-Based Providers (Special Authentication)
|
|
494
|
+
|
|
495
|
+
These providers use local CLI tools and don't require API keys:
|
|
496
|
+
|
|
497
|
+
- **codex**: Requires ChatGPT login or CODEX_API_KEY environment variable
|
|
498
|
+
- **claude**: Requires \`claude login\` command (Claude Code CLI authentication)
|
|
499
|
+
- **gemini-cli**: Requires Gemini OAuth authentication via \`gemini\` CLI
|
|
234
500
|
|
|
235
501
|
## Need More Help?
|
|
236
502
|
|
|
@@ -271,11 +537,11 @@ export async function helpPromptHandler(args = {}, config = null) {
|
|
|
271
537
|
let sectionContent = '';
|
|
272
538
|
|
|
273
539
|
if (topicLower === 'tools') {
|
|
274
|
-
const toolsMatch = fullHelp.match(/## Available Tools[\s\S]*?(
|
|
540
|
+
const toolsMatch = fullHelp.match(/## Available Tools[\s\S]*?(?=## Provider Models|$)/);
|
|
275
541
|
sectionContent = toolsMatch ? toolsMatch[0] : 'Tools section not found';
|
|
276
542
|
} else if (topicLower === 'models' || topicLower === 'providers') {
|
|
277
543
|
const modelsMatch = fullHelp.match(
|
|
278
|
-
/## Provider Models[\s\S]*?(?=## Model
|
|
544
|
+
/## Provider Models[\s\S]*?(?=## Model Categories|$)/,
|
|
279
545
|
);
|
|
280
546
|
sectionContent = modelsMatch ? modelsMatch[0] : 'Models section not found';
|
|
281
547
|
} else if (topicLower === 'parameters') {
|
|
@@ -286,7 +552,7 @@ export async function helpPromptHandler(args = {}, config = null) {
|
|
|
286
552
|
? paramsMatch[0]
|
|
287
553
|
: 'Parameters section not found';
|
|
288
554
|
} else if (topicLower === 'examples') {
|
|
289
|
-
// Extract example usage from
|
|
555
|
+
// Extract example usage from all tools
|
|
290
556
|
const examples = fullHelp.match(
|
|
291
557
|
/\*\*Example Usage:\*\*[\s\S]*?```[\s\S]*?```/g,
|
|
292
558
|
);
|
|
@@ -115,28 +115,6 @@ const SUPPORTED_MODELS = {
|
|
|
115
115
|
'Claude Sonnet 4 - High intelligence and balanced performance with extended thinking',
|
|
116
116
|
aliases: ['claude-4-sonnet', 'sonnet-4', 'claude-sonnet-4', 'sonnet4'],
|
|
117
117
|
},
|
|
118
|
-
'claude-3-7-sonnet-20250219': {
|
|
119
|
-
modelName: 'claude-3-7-sonnet-20250219',
|
|
120
|
-
friendlyName: 'Claude 3.7 Sonnet',
|
|
121
|
-
contextWindow: 200000,
|
|
122
|
-
maxOutputTokens: 64000,
|
|
123
|
-
supportsStreaming: true,
|
|
124
|
-
supportsImages: true,
|
|
125
|
-
supportsTemperature: true,
|
|
126
|
-
supportsWebSearch: false,
|
|
127
|
-
supportsThinking: true,
|
|
128
|
-
minThinkingTokens: 1024,
|
|
129
|
-
maxThinkingTokens: 64000,
|
|
130
|
-
timeout: 300000,
|
|
131
|
-
description: 'Claude 3.7 Sonnet - Enhanced 3.x generation with thinking',
|
|
132
|
-
aliases: [
|
|
133
|
-
'claude-3.7-sonnet',
|
|
134
|
-
'sonnet-3.7',
|
|
135
|
-
'claude-3-7-sonnet',
|
|
136
|
-
'claude 3.7 sonnet',
|
|
137
|
-
'sonnet 3.7',
|
|
138
|
-
],
|
|
139
|
-
},
|
|
140
118
|
'claude-haiku-4-5-20251001': {
|
|
141
119
|
modelName: 'claude-haiku-4-5-20251001',
|
|
142
120
|
friendlyName: 'Claude Haiku 4.5',
|
|
@@ -165,47 +143,6 @@ const SUPPORTED_MODELS = {
|
|
|
165
143
|
'claude-haiku',
|
|
166
144
|
],
|
|
167
145
|
},
|
|
168
|
-
'claude-3-5-sonnet-20241022': {
|
|
169
|
-
modelName: 'claude-3-5-sonnet-20241022',
|
|
170
|
-
friendlyName: 'Claude 3.5 Sonnet',
|
|
171
|
-
contextWindow: 200000,
|
|
172
|
-
maxOutputTokens: 8192,
|
|
173
|
-
supportsStreaming: true,
|
|
174
|
-
supportsImages: true,
|
|
175
|
-
supportsTemperature: true,
|
|
176
|
-
supportsWebSearch: false,
|
|
177
|
-
supportsThinking: false,
|
|
178
|
-
timeout: 300000,
|
|
179
|
-
description: 'Claude 3.5 Sonnet - Fast and intelligent model',
|
|
180
|
-
aliases: [
|
|
181
|
-
'claude-3.5-sonnet',
|
|
182
|
-
'claude-3-5-sonnet-latest',
|
|
183
|
-
'claude-sonnet-3.5',
|
|
184
|
-
'sonnet-3.5',
|
|
185
|
-
'claude 3.5 sonnet',
|
|
186
|
-
'sonnet 3.5',
|
|
187
|
-
],
|
|
188
|
-
},
|
|
189
|
-
'claude-3-5-haiku-20241022': {
|
|
190
|
-
modelName: 'claude-3-5-haiku-20241022',
|
|
191
|
-
friendlyName: 'Claude 3.5 Haiku',
|
|
192
|
-
contextWindow: 200000,
|
|
193
|
-
maxOutputTokens: 8192,
|
|
194
|
-
supportsStreaming: true,
|
|
195
|
-
supportsImages: false,
|
|
196
|
-
supportsTemperature: true,
|
|
197
|
-
supportsWebSearch: false,
|
|
198
|
-
supportsThinking: false,
|
|
199
|
-
timeout: 180000,
|
|
200
|
-
description: 'Claude 3.5 Haiku - Fastest model, best for simple queries',
|
|
201
|
-
aliases: [
|
|
202
|
-
'claude-3.5-haiku',
|
|
203
|
-
'claude-3-5-haiku-latest',
|
|
204
|
-
'haiku-3.5',
|
|
205
|
-
'claude 3.5 haiku',
|
|
206
|
-
'haiku 3.5',
|
|
207
|
-
],
|
|
208
|
-
},
|
|
209
146
|
};
|
|
210
147
|
|
|
211
148
|
/**
|
package/src/providers/google.js
CHANGED
|
@@ -10,51 +10,6 @@ import { debugLog, debugError } from '../utils/console.js';
|
|
|
10
10
|
|
|
11
11
|
// Define supported Gemini models with their capabilities
|
|
12
12
|
const SUPPORTED_MODELS = {
|
|
13
|
-
'gemini-2.0-flash': {
|
|
14
|
-
modelName: 'gemini-2.0-flash',
|
|
15
|
-
friendlyName: 'Gemini (Flash 2.0)',
|
|
16
|
-
contextWindow: 1048576, // 1M tokens
|
|
17
|
-
maxOutputTokens: 65536,
|
|
18
|
-
supportsStreaming: true,
|
|
19
|
-
supportsImages: true,
|
|
20
|
-
supportsTemperature: true,
|
|
21
|
-
supportsThinking: false,
|
|
22
|
-
supportsWebSearch: true,
|
|
23
|
-
maxThinkingTokens: 0,
|
|
24
|
-
timeout: 300000,
|
|
25
|
-
description:
|
|
26
|
-
'Gemini 2.0 Flash (1M context) - Latest fast model, supports audio/video input and grounding',
|
|
27
|
-
aliases: [
|
|
28
|
-
'flash-2.0',
|
|
29
|
-
'flash2',
|
|
30
|
-
'flash 2.0',
|
|
31
|
-
'gemini flash 2.0',
|
|
32
|
-
'gemini-2.0-flash-latest',
|
|
33
|
-
],
|
|
34
|
-
},
|
|
35
|
-
'gemini-2.0-flash-lite': {
|
|
36
|
-
modelName: 'gemini-2.0-flash-lite',
|
|
37
|
-
friendlyName: 'Gemini (Flash Lite 2.0)',
|
|
38
|
-
contextWindow: 1048576, // 1M tokens
|
|
39
|
-
maxOutputTokens: 65536,
|
|
40
|
-
supportsStreaming: true,
|
|
41
|
-
supportsImages: false,
|
|
42
|
-
supportsTemperature: true,
|
|
43
|
-
supportsThinking: false,
|
|
44
|
-
supportsWebSearch: true,
|
|
45
|
-
maxThinkingTokens: 0,
|
|
46
|
-
timeout: 300000,
|
|
47
|
-
description:
|
|
48
|
-
'Gemini 2.0 Flash Lite (1M context) - Lightweight fast model, text-only with grounding',
|
|
49
|
-
aliases: [
|
|
50
|
-
'flashlite',
|
|
51
|
-
'flash-lite',
|
|
52
|
-
'flash lite',
|
|
53
|
-
'flash-lite-2.0',
|
|
54
|
-
'gemini flash lite',
|
|
55
|
-
'gemini-2.0-flash-lite-latest',
|
|
56
|
-
],
|
|
57
|
-
},
|
|
58
13
|
'gemini-2.5-flash': {
|
|
59
14
|
modelName: 'gemini-flash-latest',
|
|
60
15
|
friendlyName: 'Gemini (Flash 2.5)',
|
package/src/providers/mistral.js
CHANGED
|
@@ -265,6 +265,9 @@ export const mistralProvider = {
|
|
|
265
265
|
// eslint-disable-next-line no-unused-vars
|
|
266
266
|
use_websearch = false, // Not supported by Mistral, ignored
|
|
267
267
|
config,
|
|
268
|
+
// Filter out options not meant for the API
|
|
269
|
+
continuation_id, // eslint-disable-line no-unused-vars
|
|
270
|
+
continuationStore, // eslint-disable-line no-unused-vars
|
|
268
271
|
...otherOptions
|
|
269
272
|
} = options;
|
|
270
273
|
|
|
@@ -297,6 +297,9 @@ export function createOpenAICompatibleProvider(providerConfig) {
|
|
|
297
297
|
use_websearch = false,
|
|
298
298
|
signal,
|
|
299
299
|
config,
|
|
300
|
+
// Filter out options not meant for the API
|
|
301
|
+
continuation_id, // eslint-disable-line no-unused-vars
|
|
302
|
+
continuationStore, // eslint-disable-line no-unused-vars
|
|
300
303
|
...otherOptions
|
|
301
304
|
} = options;
|
|
302
305
|
|
package/src/providers/openai.js
CHANGED
|
@@ -116,21 +116,6 @@ const SUPPORTED_MODELS = {
|
|
|
116
116
|
'Strong reasoning (200K context) - Logical problems, code generation, systematic analysis',
|
|
117
117
|
aliases: ['o3-2025-01-31'],
|
|
118
118
|
},
|
|
119
|
-
'o3-mini': {
|
|
120
|
-
modelName: 'o3-mini',
|
|
121
|
-
friendlyName: 'OpenAI (O3-mini)',
|
|
122
|
-
contextWindow: 200000,
|
|
123
|
-
maxOutputTokens: 100000,
|
|
124
|
-
supportsStreaming: true,
|
|
125
|
-
supportsImages: true,
|
|
126
|
-
supportsTemperature: false,
|
|
127
|
-
supportsWebSearch: false, // o3-mini does not support web search
|
|
128
|
-
supportsResponsesAPI: true,
|
|
129
|
-
timeout: 300000,
|
|
130
|
-
description:
|
|
131
|
-
'Fast O3 variant (200K context) - Balanced performance/speed, moderate complexity',
|
|
132
|
-
aliases: ['o3mini', 'o3 mini', 'o3-mini-2025-01-31'],
|
|
133
|
-
},
|
|
134
119
|
'o3-pro-2025-06-10': {
|
|
135
120
|
modelName: 'o3-pro-2025-06-10',
|
|
136
121
|
friendlyName: 'OpenAI (O3-Pro)',
|
|
@@ -176,36 +161,6 @@ const SUPPORTED_MODELS = {
|
|
|
176
161
|
'GPT-4.1 (1M context) - Advanced reasoning model with large context window',
|
|
177
162
|
aliases: ['gpt4.1', 'gpt-4.1', 'gpt 4.1', 'gpt-4.1-latest'],
|
|
178
163
|
},
|
|
179
|
-
'gpt-4o': {
|
|
180
|
-
modelName: 'gpt-4o',
|
|
181
|
-
friendlyName: 'OpenAI (GPT-4o)',
|
|
182
|
-
contextWindow: 128000,
|
|
183
|
-
maxOutputTokens: 16384,
|
|
184
|
-
supportsStreaming: true,
|
|
185
|
-
supportsImages: true,
|
|
186
|
-
supportsTemperature: true,
|
|
187
|
-
supportsWebSearch: true,
|
|
188
|
-
supportsResponsesAPI: true,
|
|
189
|
-
timeout: 180000,
|
|
190
|
-
description:
|
|
191
|
-
'GPT-4o (128K context) - Multimodal flagship model with vision capabilities',
|
|
192
|
-
aliases: ['gpt4o', 'gpt 4o', '4o'],
|
|
193
|
-
},
|
|
194
|
-
'gpt-4o-mini': {
|
|
195
|
-
modelName: 'gpt-4o-mini',
|
|
196
|
-
friendlyName: 'OpenAI (GPT-4o-mini)',
|
|
197
|
-
contextWindow: 128000,
|
|
198
|
-
maxOutputTokens: 16384,
|
|
199
|
-
supportsStreaming: true,
|
|
200
|
-
supportsImages: true,
|
|
201
|
-
supportsTemperature: true,
|
|
202
|
-
supportsWebSearch: true,
|
|
203
|
-
supportsResponsesAPI: true,
|
|
204
|
-
timeout: 120000,
|
|
205
|
-
description:
|
|
206
|
-
'GPT-4o-mini (128K context) - Fast and efficient multimodal model',
|
|
207
|
-
aliases: ['gpt4o-mini', 'gpt 4o mini', '4o mini', '4o-mini'],
|
|
208
|
-
},
|
|
209
164
|
'o3-deep-research-2025-06-26': {
|
|
210
165
|
modelName: 'o3-deep-research-2025-06-26',
|
|
211
166
|
friendlyName: 'OpenAI (O3 Deep Research)',
|
|
@@ -424,6 +379,9 @@ export const openaiProvider = {
|
|
|
424
379
|
use_websearch = false,
|
|
425
380
|
signal,
|
|
426
381
|
config,
|
|
382
|
+
// Filter out options not meant for the API
|
|
383
|
+
continuation_id, // eslint-disable-line no-unused-vars
|
|
384
|
+
continuationStore, // eslint-disable-line no-unused-vars
|
|
427
385
|
...otherOptions
|
|
428
386
|
} = options;
|
|
429
387
|
|
package/src/providers/xai.js
CHANGED
|
@@ -228,6 +228,9 @@ export const xaiProvider = {
|
|
|
228
228
|
use_websearch = false,
|
|
229
229
|
signal,
|
|
230
230
|
config,
|
|
231
|
+
// Filter out options not meant for the API
|
|
232
|
+
continuation_id, // eslint-disable-line no-unused-vars
|
|
233
|
+
continuationStore, // eslint-disable-line no-unused-vars
|
|
231
234
|
...otherOptions
|
|
232
235
|
} = options;
|
|
233
236
|
|
package/src/tools/chat.js
CHANGED
|
@@ -1029,7 +1029,7 @@ chatTool.inputSchema = {
|
|
|
1029
1029
|
type: 'array',
|
|
1030
1030
|
items: { type: 'string' },
|
|
1031
1031
|
description:
|
|
1032
|
-
'File paths to include as context (absolute or relative paths). Supports line ranges:
|
|
1032
|
+
'File paths to include as context (absolute or relative paths). Supports line ranges: file.txt{10:50}, file.txt{100:}. Example: ["./src/utils/auth.js{50:100}", "./config.json"]',
|
|
1033
1033
|
},
|
|
1034
1034
|
images: {
|
|
1035
1035
|
type: 'array',
|
package/src/tools/consensus.js
CHANGED
|
@@ -1631,7 +1631,7 @@ consensusTool.inputSchema = {
|
|
|
1631
1631
|
type: 'array',
|
|
1632
1632
|
items: { type: 'string' },
|
|
1633
1633
|
description:
|
|
1634
|
-
'File paths for additional context (absolute or relative paths). Supports line ranges:
|
|
1634
|
+
'File paths for additional context (absolute or relative paths). Supports line ranges: file.txt{10:50}, file.txt{100:}. Example: ["./docs/architecture.md{1:100}", "./requirements.txt"]',
|
|
1635
1635
|
},
|
|
1636
1636
|
images: {
|
|
1637
1637
|
type: 'array',
|