polydev-ai 1.9.49 → 1.9.51
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/mcp/manifest.json +4 -0
- package/mcp/stdio-wrapper.js +27 -8
- package/package.json +2 -2
package/mcp/manifest.json
CHANGED
|
@@ -259,6 +259,10 @@
|
|
|
259
259
|
"feedback_text": {
|
|
260
260
|
"type": "string",
|
|
261
261
|
"description": "Optional: why you ranked them this way"
|
|
262
|
+
},
|
|
263
|
+
"base_model": {
|
|
264
|
+
"type": "string",
|
|
265
|
+
"description": "Optional: the model making this ranking (auto-detected from IDE if not provided, e.g. 'claude-opus-4-6', 'gpt-5.3-codex')"
|
|
262
266
|
}
|
|
263
267
|
},
|
|
264
268
|
"required": ["ranked_models"]
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -35,7 +35,7 @@ if (typeof globalThis.fetch === 'undefined') {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
req.on('error', reject);
|
|
38
|
-
req.setTimeout(
|
|
38
|
+
req.setTimeout(300000, () => { req.destroy(); reject(new Error('Request timed out')); });
|
|
39
39
|
if (options.body) req.write(options.body);
|
|
40
40
|
req.end();
|
|
41
41
|
});
|
|
@@ -291,8 +291,11 @@ class StdioMCPWrapper {
|
|
|
291
291
|
this.userToken = process.env.POLYDEV_USER_TOKEN;
|
|
292
292
|
this.isAuthenticated = !!this.userToken;
|
|
293
293
|
|
|
294
|
-
// Server URL for API calls
|
|
295
|
-
|
|
294
|
+
// Server URL for API calls — mcp.polydev.ai bypasses Cloudflare proxy (100s timeout)
|
|
295
|
+
// Direct to Vercel = 300s function timeout. Override with POLYDEV_REMOTE_URL if needed.
|
|
296
|
+
this.serverUrl = process.env.POLYDEV_REMOTE_URL
|
|
297
|
+
? `${process.env.POLYDEV_REMOTE_URL.replace(/\/$/, '')}/api/mcp`
|
|
298
|
+
: 'https://mcp.polydev.ai/api/mcp';
|
|
296
299
|
|
|
297
300
|
// Pending session file for surviving restarts
|
|
298
301
|
this.PENDING_SESSION_FILE = path.join(os.homedir(), '.polydev-pending-session');
|
|
@@ -456,7 +459,23 @@ Token will be saved automatically after login.`
|
|
|
456
459
|
if (toolName === 'get_perspectives' || toolName === 'polydev.get_perspectives') {
|
|
457
460
|
return await this.handleGetPerspectivesWithCLIs(params, id);
|
|
458
461
|
}
|
|
459
|
-
|
|
462
|
+
|
|
463
|
+
// Enrich rank_perspectives with base model + client info before forwarding
|
|
464
|
+
if (toolName === 'rank_perspectives' || toolName === 'polydev.rank_perspectives') {
|
|
465
|
+
if (params.arguments && !params.arguments.base_model) {
|
|
466
|
+
// Inject base model from IDE client info (set during MCP initialize handshake)
|
|
467
|
+
if (this.clientInfo?.name) {
|
|
468
|
+
params.arguments.base_model = this.clientInfo.name;
|
|
469
|
+
if (this.clientInfo.version) {
|
|
470
|
+
params.arguments.base_model += `/${this.clientInfo.version}`;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
if (params.arguments && !params.arguments.client_id) {
|
|
475
|
+
params.arguments.client_id = 'stdio-wrapper';
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
460
479
|
// Handle CLI tools locally (support both prefixed and unprefixed names)
|
|
461
480
|
if (this.isCliTool(toolName)) {
|
|
462
481
|
return await this.handleLocalCliTool(request);
|
|
@@ -1629,13 +1648,13 @@ To re-login: /polydev:login`
|
|
|
1629
1648
|
* Forward a request to the remote Polydev API server
|
|
1630
1649
|
*/
|
|
1631
1650
|
async forwardToRemoteServer(request) {
|
|
1632
|
-
console.error(`[Stdio Wrapper] Forwarding request to remote server`);
|
|
1651
|
+
console.error(`[Stdio Wrapper] Forwarding request to remote server: ${this.serverUrl}`);
|
|
1633
1652
|
|
|
1634
1653
|
try {
|
|
1635
1654
|
const controller = typeof AbortController !== 'undefined' ? new AbortController() : null;
|
|
1636
|
-
const timeoutId = controller ? setTimeout(() => controller.abort(),
|
|
1655
|
+
const timeoutId = controller ? setTimeout(() => controller.abort(), 300000) : null; // 300s timeout
|
|
1637
1656
|
|
|
1638
|
-
const response = await fetch(
|
|
1657
|
+
const response = await fetch(this.serverUrl, {
|
|
1639
1658
|
method: 'POST',
|
|
1640
1659
|
headers: {
|
|
1641
1660
|
'Content-Type': 'application/json',
|
|
@@ -2770,7 +2789,7 @@ To re-login: /polydev:login`
|
|
|
2770
2789
|
const statusFile = path.join(polydevevDir, 'cli-status.json');
|
|
2771
2790
|
|
|
2772
2791
|
// Ensure directory exists
|
|
2773
|
-
if (!fs.existsSync(
|
|
2792
|
+
if (!fs.existsSync(polydeveevDir)) {
|
|
2774
2793
|
fs.mkdirSync(polydeveevDir, { recursive: true });
|
|
2775
2794
|
}
|
|
2776
2795
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydev-ai",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.51",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.x <=22.x"
|
|
6
6
|
},
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"marked": "^16.2.1",
|
|
79
79
|
"next": "^15.5.7",
|
|
80
80
|
"open": "^11.0.0",
|
|
81
|
-
"polydev-ai": "^1.
|
|
81
|
+
"polydev-ai": "^1.9.50",
|
|
82
82
|
"posthog-js": "^1.157.2",
|
|
83
83
|
"prismjs": "^1.30.0",
|
|
84
84
|
"react": "^18.3.1",
|