polydev-ai 1.2.1 → 1.2.2
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 +16 -5
- package/package.json +1 -1
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -393,10 +393,14 @@ class StdioMCPWrapper {
|
|
|
393
393
|
const remoteResponse = await this.forwardToRemoteServer(perspectivesRequest);
|
|
394
394
|
|
|
395
395
|
if (remoteResponse.result && remoteResponse.result.content && remoteResponse.result.content[0]) {
|
|
396
|
+
// The remote response already contains formatted "Multiple AI Perspectives" content
|
|
397
|
+
// Return it as-is without additional formatting to avoid duplication
|
|
398
|
+
const rawContent = remoteResponse.result.content[0].text;
|
|
396
399
|
return {
|
|
397
400
|
success: true,
|
|
398
|
-
content:
|
|
399
|
-
timestamp: new Date().toISOString()
|
|
401
|
+
content: rawContent,
|
|
402
|
+
timestamp: new Date().toISOString(),
|
|
403
|
+
raw: true // Flag to indicate this is pre-formatted content
|
|
400
404
|
};
|
|
401
405
|
} else if (remoteResponse.error) {
|
|
402
406
|
return {
|
|
@@ -480,9 +484,16 @@ class StdioMCPWrapper {
|
|
|
480
484
|
}
|
|
481
485
|
|
|
482
486
|
if (perspectivesResult.success) {
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
487
|
+
if (perspectivesResult.raw) {
|
|
488
|
+
// Raw content is already formatted - use as-is without any additional title
|
|
489
|
+
// The remote server already includes proper headers like "Multiple AI Perspectives"
|
|
490
|
+
formatted += `${perspectivesResult.content}\n\n`;
|
|
491
|
+
} else {
|
|
492
|
+
// Legacy formatting for non-raw content (shouldn't be used with current server)
|
|
493
|
+
const title = isFallback ? '🧠 **Perspectives Fallback**' : '🧠 **Supplemental Multi-Model Perspectives**';
|
|
494
|
+
formatted += `${title}\n\n`;
|
|
495
|
+
formatted += `${perspectivesResult.content}\n\n`;
|
|
496
|
+
}
|
|
486
497
|
} else if (!isFallback) {
|
|
487
498
|
// Show remote error only if not in fallback mode
|
|
488
499
|
formatted += `❌ **Perspectives request failed**: ${perspectivesResult.error}\n\n`;
|
package/package.json
CHANGED