polydev-ai 1.8.36 → 1.8.37
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/lib/cliManager.js +6 -5
- package/mcp/README.md +76 -6
- package/mcp/stdio-wrapper.js +30 -5
- package/package.json +2 -2
package/lib/cliManager.js
CHANGED
|
@@ -584,9 +584,10 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
584
584
|
// Claude Code uses --model flag
|
|
585
585
|
args = ['--model', model, ...args, prompt];
|
|
586
586
|
} else if (providerId === 'gemini_cli') {
|
|
587
|
-
// Gemini CLI: -m for model, -p for prompt (headless mode)
|
|
588
|
-
// Format: gemini -m gemini-2.0-flash -p "prompt"
|
|
589
|
-
|
|
587
|
+
// Gemini CLI: -s for sandbox (no tools), -m for model, -p for prompt (headless mode)
|
|
588
|
+
// Format: gemini -s -m gemini-2.0-flash -p "prompt"
|
|
589
|
+
// -s flag disables agentic tool use which causes truncated "I will search..." outputs
|
|
590
|
+
args = ['-s', '-m', model, '-p', prompt];
|
|
590
591
|
} else {
|
|
591
592
|
// Default: just append prompt
|
|
592
593
|
args = [...args, prompt];
|
|
@@ -594,8 +595,8 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
594
595
|
} else {
|
|
595
596
|
// No model specified
|
|
596
597
|
if (providerId === 'gemini_cli') {
|
|
597
|
-
// Gemini CLI
|
|
598
|
-
args = ['-p', prompt];
|
|
598
|
+
// Gemini CLI: -s for sandbox (no tools), -p for headless mode
|
|
599
|
+
args = ['-s', '-p', prompt];
|
|
599
600
|
} else {
|
|
600
601
|
args = [...args, prompt];
|
|
601
602
|
}
|
package/mcp/README.md
CHANGED
|
@@ -57,12 +57,44 @@ export POLYDEV_USER_TOKEN="pd_your_token_here"
|
|
|
57
57
|
Add to your Claude Code MCP configuration:
|
|
58
58
|
|
|
59
59
|
```json
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
"polydev": {
|
|
61
|
+
"disabled": false,
|
|
62
|
+
"timeout": 120,
|
|
63
|
+
"type": "http",
|
|
64
|
+
"url": "https://www.polydev.ai/api/mcp"
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Codex CLI Integration (OpenAI)
|
|
69
|
+
|
|
70
|
+
Add to `~/.codex/config.toml`:
|
|
71
|
+
|
|
72
|
+
```toml
|
|
73
|
+
[mcp_servers.polydev]
|
|
74
|
+
command = "/path/to/node"
|
|
75
|
+
args = ["/path/to/node_modules/polydev-ai/mcp/stdio-wrapper.js"]
|
|
76
|
+
env = { POLYDEV_USER_TOKEN = "pd_your_token_here" }
|
|
77
|
+
|
|
78
|
+
[mcp_servers.polydev.timeouts]
|
|
79
|
+
tool_timeout = 180
|
|
80
|
+
session_timeout = 600
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Important for Codex CLI:**
|
|
84
|
+
- Use direct `node` path instead of `npx` for faster startup
|
|
85
|
+
- Find your node path with: `which node`
|
|
86
|
+
- Find polydev path with: `npm root -g`
|
|
87
|
+
|
|
88
|
+
Example with typical paths:
|
|
89
|
+
```toml
|
|
90
|
+
[mcp_servers.polydev]
|
|
91
|
+
command = "/Users/yourname/.nvm/versions/node/v22.20.0/bin/node"
|
|
92
|
+
args = ["/Users/yourname/.nvm/versions/node/v22.20.0/lib/node_modules/polydev-ai/mcp/stdio-wrapper.js"]
|
|
93
|
+
env = { POLYDEV_USER_TOKEN = "pd_your_token_here" }
|
|
94
|
+
|
|
95
|
+
[mcp_servers.polydev.timeouts]
|
|
96
|
+
tool_timeout = 180
|
|
97
|
+
session_timeout = 600
|
|
66
98
|
```
|
|
67
99
|
|
|
68
100
|
## Available Tools
|
|
@@ -129,6 +161,34 @@ The MCP server automatically detects CLI status changes:
|
|
|
129
161
|
|
|
130
162
|
## Troubleshooting
|
|
131
163
|
|
|
164
|
+
### Codex CLI: "Transport closed" Error
|
|
165
|
+
|
|
166
|
+
This error occurs when the MCP handshake fails. Common causes and fixes:
|
|
167
|
+
|
|
168
|
+
1. **Use direct node path instead of npx**
|
|
169
|
+
```toml
|
|
170
|
+
# Wrong - npx has startup overhead
|
|
171
|
+
command = "npx"
|
|
172
|
+
args = ["-y", "polydev-ai"]
|
|
173
|
+
|
|
174
|
+
# Correct - direct node path
|
|
175
|
+
command = "/path/to/node"
|
|
176
|
+
args = ["/path/to/polydev-ai/mcp/stdio-wrapper.js"]
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
2. **Use inline env format**
|
|
180
|
+
```toml
|
|
181
|
+
# Correct format
|
|
182
|
+
env = { POLYDEV_USER_TOKEN = "pd_xxx" }
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
3. **Protocol version mismatch**: Ensure polydev-ai version >= 1.8.36 which supports MCP protocol 2025-06-18
|
|
186
|
+
|
|
187
|
+
4. **Check Codex logs** for details:
|
|
188
|
+
```bash
|
|
189
|
+
cat ~/.codex/log/codex-tui.log | tail -50
|
|
190
|
+
```
|
|
191
|
+
|
|
132
192
|
### CLI Not Detected
|
|
133
193
|
|
|
134
194
|
1. Ensure the CLI is installed and in your PATH
|
|
@@ -149,6 +209,16 @@ npm config set prefix '~/.npm-global'
|
|
|
149
209
|
export PATH=~/.npm-global/bin:$PATH
|
|
150
210
|
```
|
|
151
211
|
|
|
212
|
+
### Debugging MCP Connection
|
|
213
|
+
|
|
214
|
+
Test the wrapper manually:
|
|
215
|
+
```bash
|
|
216
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | \
|
|
217
|
+
POLYDEV_USER_TOKEN="pd_xxx" node /path/to/stdio-wrapper.js
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
You should see a JSON response with `protocolVersion: "2025-06-18"`
|
|
221
|
+
|
|
152
222
|
## Support
|
|
153
223
|
|
|
154
224
|
- 📧 Email: [support@polydev.ai](mailto:support@polydev.ai)
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -292,7 +292,7 @@ class StdioMCPWrapper {
|
|
|
292
292
|
jsonrpc: '2.0',
|
|
293
293
|
id,
|
|
294
294
|
result: {
|
|
295
|
-
protocolVersion: '
|
|
295
|
+
protocolVersion: '2025-06-18',
|
|
296
296
|
capabilities: { tools: {} },
|
|
297
297
|
serverInfo: {
|
|
298
298
|
name: this.manifest.name,
|
|
@@ -959,6 +959,22 @@ class StdioMCPWrapper {
|
|
|
959
959
|
.map(cli => cliToApiProvider[cli])
|
|
960
960
|
.filter(Boolean);
|
|
961
961
|
|
|
962
|
+
// Get failed CLI providers and map them to their API equivalents
|
|
963
|
+
const failedCliProviders = localResults
|
|
964
|
+
.filter(r => !r.success && r.provider_id)
|
|
965
|
+
.map(r => r.provider_id);
|
|
966
|
+
|
|
967
|
+
const failedCliApiProviders = failedCliProviders
|
|
968
|
+
.map(cli => {
|
|
969
|
+
const apiProvider = cliToApiProvider[cli];
|
|
970
|
+
if (apiProvider) {
|
|
971
|
+
console.error(`[Stdio Wrapper] CLI ${cli} failed, will request API fallback: ${apiProvider}`);
|
|
972
|
+
return { provider: apiProvider, model: null }; // Let server choose model
|
|
973
|
+
}
|
|
974
|
+
return null;
|
|
975
|
+
})
|
|
976
|
+
.filter(Boolean);
|
|
977
|
+
|
|
962
978
|
// If we don't need any perspectives, skip remote call
|
|
963
979
|
if (maxPerspectives <= 0) {
|
|
964
980
|
console.error(`[Stdio Wrapper] Max perspectives is 0, skipping remote perspectives`);
|
|
@@ -971,12 +987,16 @@ class StdioMCPWrapper {
|
|
|
971
987
|
};
|
|
972
988
|
}
|
|
973
989
|
|
|
974
|
-
// Build list of specific providers to request (from API-only providers)
|
|
975
|
-
const
|
|
990
|
+
// Build list of specific providers to request (from API-only providers + failed CLI fallbacks)
|
|
991
|
+
const apiOnlyProvidersList = apiProvidersInfo.map(p => ({
|
|
976
992
|
provider: p.provider,
|
|
977
993
|
model: p.model
|
|
978
994
|
}));
|
|
979
995
|
|
|
996
|
+
// Combine API-only providers with failed CLI fallback providers
|
|
997
|
+
// Failed CLI providers get priority (they're the ones user expected to work)
|
|
998
|
+
const requestProviders = [...failedCliApiProviders, ...apiOnlyProvidersList];
|
|
999
|
+
|
|
980
1000
|
console.error(`[Stdio Wrapper] Calling remote perspectives (excluding: ${excludeProviders.join(', ') || 'none'}, requesting: ${requestProviders.map(p => p.provider).join(', ') || 'any'}, max: ${maxPerspectives})`);
|
|
981
1001
|
|
|
982
1002
|
// Format ONLY SUCCESSFUL CLI responses for logging on the server
|
|
@@ -1581,14 +1601,19 @@ class StdioMCPWrapper {
|
|
|
1581
1601
|
|
|
1582
1602
|
process.stdin.on('data', async (chunk) => {
|
|
1583
1603
|
buffer += chunk;
|
|
1584
|
-
|
|
1604
|
+
|
|
1585
1605
|
const lines = buffer.split('\n');
|
|
1586
1606
|
buffer = lines.pop() || '';
|
|
1587
|
-
|
|
1607
|
+
|
|
1588
1608
|
for (const line of lines) {
|
|
1589
1609
|
if (line.trim()) {
|
|
1590
1610
|
try {
|
|
1591
1611
|
const request = JSON.parse(line);
|
|
1612
|
+
// Notifications have no id - don't respond to them (JSON-RPC spec)
|
|
1613
|
+
if (request.id === undefined) {
|
|
1614
|
+
console.error(`[Stdio Wrapper] Received notification: ${request.method}`);
|
|
1615
|
+
continue;
|
|
1616
|
+
}
|
|
1592
1617
|
const response = await this.handleRequest(request);
|
|
1593
1618
|
process.stdout.write(JSON.stringify(response) + '\n');
|
|
1594
1619
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydev-ai",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.37",
|
|
4
4
|
"description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"lucide-react": "^0.542.0",
|
|
68
68
|
"marked": "^16.2.1",
|
|
69
69
|
"next": "^15.5.7",
|
|
70
|
-
"polydev-ai": "^1.8.
|
|
70
|
+
"polydev-ai": "^1.8.36",
|
|
71
71
|
"posthog-js": "^1.157.2",
|
|
72
72
|
"prismjs": "^1.30.0",
|
|
73
73
|
"react": "^18.3.1",
|