polydev-ai 1.8.45 → 1.8.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/server.js +3 -3
- package/mcp/stdio-wrapper.js +12 -7
- package/package.json +1 -1
package/mcp/server.js
CHANGED
|
@@ -595,13 +595,13 @@ class MCPServer {
|
|
|
595
595
|
console.log('[MCP Server] Send CLI prompt requested');
|
|
596
596
|
|
|
597
597
|
try {
|
|
598
|
-
const { provider_id, prompt, mode = 'args', timeout_ms =
|
|
598
|
+
const { provider_id, prompt, mode = 'args', timeout_ms = 240000, user_id } = args;
|
|
599
599
|
|
|
600
600
|
// Ensure timeout_ms is valid (not undefined, null, Infinity, or negative)
|
|
601
|
-
//
|
|
601
|
+
// 240 seconds (4 minutes) default for CLI-within-CLI scenarios (Claude Code calling Claude Code)
|
|
602
602
|
let validTimeout = timeout_ms;
|
|
603
603
|
if (!validTimeout || validTimeout === Infinity || validTimeout < 1 || validTimeout > 600000) {
|
|
604
|
-
validTimeout =
|
|
604
|
+
validTimeout = 240000 // Default to 240 seconds (4 minutes) for CLI responses
|
|
605
605
|
}
|
|
606
606
|
|
|
607
607
|
if (!provider_id || !prompt) {
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -602,12 +602,12 @@ class StdioMCPWrapper {
|
|
|
602
602
|
console.error(`[Stdio Wrapper] Local CLI prompt sending with perspectives`);
|
|
603
603
|
|
|
604
604
|
try {
|
|
605
|
-
let { provider_id, prompt, mode = 'args', timeout_ms =
|
|
605
|
+
let { provider_id, prompt, mode = 'args', timeout_ms = 240000 } = args;
|
|
606
606
|
|
|
607
607
|
// Ensure timeout_ms is valid (not undefined, null, Infinity, or negative)
|
|
608
|
-
// Default to
|
|
608
|
+
// Default to 4 minutes (240 seconds) for complex CLI responses
|
|
609
609
|
if (!timeout_ms || timeout_ms === Infinity || timeout_ms < 1 || timeout_ms > 600000) {
|
|
610
|
-
timeout_ms =
|
|
610
|
+
timeout_ms = 240000; // Default to 4 minutes for CLI responses
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
if (!prompt) {
|
|
@@ -733,14 +733,19 @@ class StdioMCPWrapper {
|
|
|
733
733
|
const successfulLocalCount = localResults.filter(r => r.success).length;
|
|
734
734
|
const failedCliCount = localResults.filter(r => !r.success).length;
|
|
735
735
|
|
|
736
|
-
// Need API for:
|
|
736
|
+
// Need API for: remaining perspectives to reach maxPerspectives
|
|
737
|
+
// OLD (WRONG): const remainingPerspectives = apiOnlyCount + failedCliCount;
|
|
738
|
+
// This was wrong because if allProviders was empty, apiOnlyCount=0 and we'd get too few perspectives
|
|
739
|
+
// NEW (CORRECT): Always try to fill up to maxPerspectives from remote API
|
|
737
740
|
const apiOnlyCount = (this._apiOnlyProviders || []).length;
|
|
738
|
-
const remainingPerspectives =
|
|
741
|
+
const remainingPerspectives = Math.max(0, maxPerspectives - successfulLocalCount);
|
|
742
|
+
|
|
743
|
+
console.error(`[Stdio Wrapper] Perspectives breakdown: ${successfulLocalCount} successful CLI, ${failedCliCount} failed CLI, ${apiOnlyCount} API-only, need ${remainingPerspectives} more from remote (target: ${maxPerspectives})`);
|
|
739
744
|
|
|
740
745
|
// Get remote perspectives for API-only providers and failed CLIs
|
|
741
746
|
let perspectivesResult;
|
|
742
747
|
if (remainingPerspectives > 0) {
|
|
743
|
-
console.error(`[Stdio Wrapper]
|
|
748
|
+
console.error(`[Stdio Wrapper] Calling remote API for ${remainingPerspectives} more perspectives (have ${successfulLocalCount}/${maxPerspectives})`);
|
|
744
749
|
|
|
745
750
|
// Pass API-only provider info to help remote API choose correct models
|
|
746
751
|
const apiProvidersInfo = (this._apiOnlyProviders || []).map(p => ({
|
|
@@ -752,7 +757,7 @@ class StdioMCPWrapper {
|
|
|
752
757
|
// We do NOT call reportCliResultsToServer() here to avoid duplicate logs
|
|
753
758
|
perspectivesResult = await this.callPerspectivesForCli(args, localResults, remainingPerspectives, apiProvidersInfo);
|
|
754
759
|
} else {
|
|
755
|
-
console.error(`[Stdio Wrapper] Already have ${successfulLocalCount} perspectives
|
|
760
|
+
console.error(`[Stdio Wrapper] Already have ${successfulLocalCount} perspectives (max: ${maxPerspectives})`);
|
|
756
761
|
|
|
757
762
|
// ONLY report CLI results when NOT calling remote API
|
|
758
763
|
// (When we call remote API, it handles logging CLI + API results together)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydev-ai",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.50",
|
|
4
4
|
"mcpName": "io.github.backspacevenkat/perspectives",
|
|
5
5
|
"description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
|
|
6
6
|
"keywords": [
|