polydev-ai 1.9.48 → 1.9.50
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/stdio-wrapper.js +10 -7
- package/package.json +1 -1
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');
|
|
@@ -1629,13 +1632,13 @@ To re-login: /polydev:login`
|
|
|
1629
1632
|
* Forward a request to the remote Polydev API server
|
|
1630
1633
|
*/
|
|
1631
1634
|
async forwardToRemoteServer(request) {
|
|
1632
|
-
console.error(`[Stdio Wrapper] Forwarding request to remote server`);
|
|
1635
|
+
console.error(`[Stdio Wrapper] Forwarding request to remote server: ${this.serverUrl}`);
|
|
1633
1636
|
|
|
1634
1637
|
try {
|
|
1635
1638
|
const controller = typeof AbortController !== 'undefined' ? new AbortController() : null;
|
|
1636
|
-
const timeoutId = controller ? setTimeout(() => controller.abort(),
|
|
1639
|
+
const timeoutId = controller ? setTimeout(() => controller.abort(), 300000) : null; // 300s timeout
|
|
1637
1640
|
|
|
1638
|
-
const response = await fetch(
|
|
1641
|
+
const response = await fetch(this.serverUrl, {
|
|
1639
1642
|
method: 'POST',
|
|
1640
1643
|
headers: {
|
|
1641
1644
|
'Content-Type': 'application/json',
|
|
@@ -2770,7 +2773,7 @@ To re-login: /polydev:login`
|
|
|
2770
2773
|
const statusFile = path.join(polydevevDir, 'cli-status.json');
|
|
2771
2774
|
|
|
2772
2775
|
// Ensure directory exists
|
|
2773
|
-
if (!fs.existsSync(
|
|
2776
|
+
if (!fs.existsSync(polydeveevDir)) {
|
|
2774
2777
|
fs.mkdirSync(polydeveevDir, { recursive: true });
|
|
2775
2778
|
}
|
|
2776
2779
|
|