polydev-ai 1.2.2 → 1.2.3

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 CHANGED
@@ -350,6 +350,12 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
350
350
  if (timeoutMs === null) {
351
351
  timeoutMs = providerId === 'claude_code' ? 60000 : 30000; // 60s for Claude Code, 30s for others
352
352
  }
353
+
354
+ // Ensure timeoutMs is valid (not undefined, null, Infinity, or negative)
355
+ if (!timeoutMs || timeoutMs === Infinity || timeoutMs < 1 || timeoutMs > 300000) {
356
+ timeoutMs = 30000 // Default to 30 seconds
357
+ }
358
+
353
359
  const startTime = Date.now();
354
360
 
355
361
  try {
@@ -434,6 +440,11 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
434
440
  }
435
441
 
436
442
  async executeCliCommand(command, args, mode = 'args', timeoutMs = 30000, stdinInput) {
443
+ // Ensure timeoutMs is valid (not undefined, null, Infinity, or negative)
444
+ if (!timeoutMs || timeoutMs === Infinity || timeoutMs < 1 || timeoutMs > 300000) {
445
+ timeoutMs = 30000 // Default to 30 seconds
446
+ }
447
+
437
448
  return new Promise((resolve, reject) => {
438
449
  if (process.env.POLYDEV_CLI_DEBUG) {
439
450
  console.log(`[CLI Debug] Executing: ${command} ${args.join(' ')} (mode: ${mode})`);
package/mcp/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-perspectives",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "Agentic workflow assistant - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
5
5
  "author": "Polydev AI",
6
6
  "license": "MIT",
package/mcp/server.js CHANGED
@@ -557,6 +557,12 @@ class MCPServer {
557
557
  try {
558
558
  const { provider_id, prompt, mode = 'args', timeout_ms = 30000, user_id } = args;
559
559
 
560
+ // Ensure timeout_ms is valid (not undefined, null, Infinity, or negative)
561
+ let validTimeout = timeout_ms;
562
+ if (!validTimeout || validTimeout === Infinity || validTimeout < 1 || validTimeout > 300000) {
563
+ validTimeout = 30000 // Default to 30 seconds
564
+ }
565
+
560
566
  if (!provider_id || !prompt) {
561
567
  throw new Error('provider_id and prompt are required');
562
568
  }
@@ -566,7 +572,7 @@ class MCPServer {
566
572
  provider_id,
567
573
  prompt,
568
574
  mode,
569
- timeout_ms
575
+ validTimeout
570
576
  );
571
577
 
572
578
  // CLI usage is tracked locally - no database integration needed
@@ -279,6 +279,11 @@ class StdioMCPWrapper {
279
279
  try {
280
280
  let { provider_id, prompt, mode = 'args', timeout_ms = 30000 } = args;
281
281
 
282
+ // Ensure timeout_ms is valid (not undefined, null, Infinity, or negative)
283
+ if (!timeout_ms || timeout_ms === Infinity || timeout_ms < 1 || timeout_ms > 300000) {
284
+ timeout_ms = 30000 // Default to 30 seconds
285
+ }
286
+
282
287
  if (!prompt) {
283
288
  throw new Error('prompt is required');
284
289
  }
@@ -289,8 +294,8 @@ class StdioMCPWrapper {
289
294
  console.error(`[Stdio Wrapper] Auto-selected provider: ${provider_id}`);
290
295
  }
291
296
 
292
- // Use shorter timeout for faster fallback (5 seconds instead of 30)
293
- const gracefulTimeout = Math.min(timeout_ms, 5000);
297
+ // Use reasonable timeout for CLI responses (15 seconds instead of 5)
298
+ const gracefulTimeout = Math.min(timeout_ms, 15000);
294
299
 
295
300
  // Start both operations concurrently for better performance
296
301
  const [localResult, perspectivesResult] = await Promise.allSettled([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
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",
@@ -61,6 +61,7 @@
61
61
  "next": "15.0.0",
62
62
  "polydev-ai": "^1.2.0",
63
63
  "posthog-js": "^1.157.2",
64
+ "prismjs": "^1.30.0",
64
65
  "react": "^18.3.1",
65
66
  "react-dom": "^18.3.1",
66
67
  "resend": "^6.0.2",