polydev-ai 1.8.24 → 1.8.26
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 +18 -5
- package/package.json +1 -1
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -186,6 +186,12 @@ function cleanCliResponse(content) {
|
|
|
186
186
|
foundCodexMarker = true;
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
|
+
// Skip MCP startup logs (mcp: xxx starting/ready/failed)
|
|
190
|
+
if (trimmed.startsWith('mcp:')) continue;
|
|
191
|
+
if (trimmed.startsWith('mcp startup:')) continue;
|
|
192
|
+
// Skip RMCP transport errors
|
|
193
|
+
if (trimmed.includes('rmcp::transport')) continue;
|
|
194
|
+
if (trimmed.includes('ERROR rmcp')) continue;
|
|
189
195
|
// Skip everything in user section (echoed prompt, errors)
|
|
190
196
|
continue;
|
|
191
197
|
}
|
|
@@ -234,6 +240,9 @@ class StdioMCPWrapper {
|
|
|
234
240
|
process.exit(1);
|
|
235
241
|
}
|
|
236
242
|
|
|
243
|
+
// Server URL for API calls
|
|
244
|
+
this.serverUrl = 'https://www.polydev.ai/api/mcp';
|
|
245
|
+
|
|
237
246
|
// Initialize CLI Manager for local CLI functionality
|
|
238
247
|
this.cliManager = new CLIManager();
|
|
239
248
|
|
|
@@ -296,7 +305,7 @@ class StdioMCPWrapper {
|
|
|
296
305
|
// Handle get_perspectives with local CLIs + remote perspectives
|
|
297
306
|
const toolName = params.name;
|
|
298
307
|
|
|
299
|
-
if (toolName === 'get_perspectives') {
|
|
308
|
+
if (toolName === 'get_perspectives' || toolName === 'polydev.get_perspectives') {
|
|
300
309
|
return await this.handleGetPerspectivesWithCLIs(params, id);
|
|
301
310
|
}
|
|
302
311
|
|
|
@@ -801,10 +810,11 @@ class StdioMCPWrapper {
|
|
|
801
810
|
|
|
802
811
|
/**
|
|
803
812
|
* Report CLI results to server for dashboard storage
|
|
804
|
-
* This stores CLI results in Supabase so they appear in the dashboard
|
|
813
|
+
* This stores ONLY SUCCESSFUL CLI results in Supabase so they appear in the dashboard
|
|
814
|
+
* Failed CLI results are not stored - they will get API fallback instead
|
|
805
815
|
*/
|
|
806
816
|
async reportCliResultsToServer(prompt, localResults, args = {}) {
|
|
807
|
-
// Only report
|
|
817
|
+
// Only report successful CLI results (failed ones will get API fallback)
|
|
808
818
|
const successfulResults = localResults.filter(r => r.success);
|
|
809
819
|
if (successfulResults.length === 0) {
|
|
810
820
|
console.error('[Stdio Wrapper] No successful CLI results to report');
|
|
@@ -817,11 +827,14 @@ class StdioMCPWrapper {
|
|
|
817
827
|
}
|
|
818
828
|
|
|
819
829
|
try {
|
|
820
|
-
|
|
830
|
+
// IMPORTANT: Only send successful results to dashboard
|
|
831
|
+
// Failed CLI results will have API fallback, so we don't want to show both
|
|
832
|
+
const cliResults = successfulResults.map(result => ({
|
|
821
833
|
provider_id: result.provider_id,
|
|
822
834
|
// IMPORTANT: cliManager returns model_used, not model
|
|
823
835
|
model: result.model_used || result.model || this.getModelPreferenceForCli(result.provider_id),
|
|
824
|
-
|
|
836
|
+
// Clean the content before sending to dashboard (remove metadata, MCP logs, etc.)
|
|
837
|
+
content: cleanCliResponse(result.content || ''),
|
|
825
838
|
tokens_used: result.tokens_used || 0,
|
|
826
839
|
latency_ms: result.latency_ms || 0,
|
|
827
840
|
success: result.success || false,
|
package/package.json
CHANGED