polydev-ai 1.9.22 → 1.9.24
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/manifest.json +0 -245
- package/mcp/stdio-wrapper.js +18 -70
- package/package.json +1 -1
package/mcp/manifest.json
CHANGED
|
@@ -292,251 +292,6 @@
|
|
|
292
292
|
}
|
|
293
293
|
]
|
|
294
294
|
},
|
|
295
|
-
{
|
|
296
|
-
"name": "force_cli_detection",
|
|
297
|
-
"description": "Force detection and status update for CLI tools (Claude Code, Codex CLI, Gemini CLI). Updates local cache and reports status to MCP server via Supabase.",
|
|
298
|
-
"inputSchema": {
|
|
299
|
-
"type": "object",
|
|
300
|
-
"properties": {
|
|
301
|
-
"user_id": {
|
|
302
|
-
"type": "string",
|
|
303
|
-
"description": "User ID for database status updates (optional for stdio-wrapper)",
|
|
304
|
-
"minLength": 1
|
|
305
|
-
},
|
|
306
|
-
"provider_id": {
|
|
307
|
-
"type": "string",
|
|
308
|
-
"description": "Specific CLI provider to detect (optional, detects all if not provided)",
|
|
309
|
-
"enum": ["claude_code", "codex_cli", "gemini_cli"]
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
"outputSchema": {
|
|
314
|
-
"type": "object",
|
|
315
|
-
"properties": {
|
|
316
|
-
"success": {
|
|
317
|
-
"type": "boolean",
|
|
318
|
-
"description": "Whether detection was successful"
|
|
319
|
-
},
|
|
320
|
-
"results": {
|
|
321
|
-
"type": "object",
|
|
322
|
-
"description": "Detection results for each provider",
|
|
323
|
-
"additionalProperties": {
|
|
324
|
-
"type": "object",
|
|
325
|
-
"properties": {
|
|
326
|
-
"available": {
|
|
327
|
-
"type": "boolean",
|
|
328
|
-
"description": "Whether CLI is available"
|
|
329
|
-
},
|
|
330
|
-
"authenticated": {
|
|
331
|
-
"type": "boolean",
|
|
332
|
-
"description": "Whether CLI is authenticated"
|
|
333
|
-
},
|
|
334
|
-
"version": {
|
|
335
|
-
"type": "string",
|
|
336
|
-
"description": "CLI version if available"
|
|
337
|
-
},
|
|
338
|
-
"path": {
|
|
339
|
-
"type": "string",
|
|
340
|
-
"description": "Path to CLI executable"
|
|
341
|
-
},
|
|
342
|
-
"error": {
|
|
343
|
-
"type": "string",
|
|
344
|
-
"description": "Error message if detection failed"
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
"message": {
|
|
350
|
-
"type": "string",
|
|
351
|
-
"description": "Human-readable result message"
|
|
352
|
-
},
|
|
353
|
-
"timestamp": {
|
|
354
|
-
"type": "string",
|
|
355
|
-
"description": "Detection timestamp"
|
|
356
|
-
}
|
|
357
|
-
},
|
|
358
|
-
"required": ["success", "results", "message", "timestamp"]
|
|
359
|
-
},
|
|
360
|
-
"examples": [
|
|
361
|
-
{
|
|
362
|
-
"description": "Detect all CLI providers",
|
|
363
|
-
"input": {
|
|
364
|
-
"user_id": "user_123"
|
|
365
|
-
},
|
|
366
|
-
"output": {
|
|
367
|
-
"success": true,
|
|
368
|
-
"results": {
|
|
369
|
-
"claude_code": {
|
|
370
|
-
"available": true,
|
|
371
|
-
"authenticated": true,
|
|
372
|
-
"version": "claude-code v1.2.3",
|
|
373
|
-
"path": "/usr/local/bin/claude"
|
|
374
|
-
},
|
|
375
|
-
"codex_cli": {
|
|
376
|
-
"available": false,
|
|
377
|
-
"authenticated": false,
|
|
378
|
-
"error": "Codex CLI not found in PATH. Install Codex CLI from OpenAI"
|
|
379
|
-
}
|
|
380
|
-
},
|
|
381
|
-
"message": "CLI detection completed for all providers",
|
|
382
|
-
"timestamp": "2024-01-15T10:30:00Z"
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
]
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
"name": "get_cli_status",
|
|
389
|
-
"description": "Get current CLI status with caching support. Returns cached results if available and fresh, otherwise performs new detection.",
|
|
390
|
-
"inputSchema": {
|
|
391
|
-
"type": "object",
|
|
392
|
-
"properties": {
|
|
393
|
-
"user_id": {
|
|
394
|
-
"type": "string",
|
|
395
|
-
"description": "User ID for database status retrieval (optional for stdio-wrapper)",
|
|
396
|
-
"minLength": 1
|
|
397
|
-
},
|
|
398
|
-
"provider_id": {
|
|
399
|
-
"type": "string",
|
|
400
|
-
"description": "Specific CLI provider status to get (optional, gets all if not provided)",
|
|
401
|
-
"enum": ["claude_code", "codex_cli", "gemini_cli"]
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
},
|
|
405
|
-
"outputSchema": {
|
|
406
|
-
"type": "object",
|
|
407
|
-
"properties": {
|
|
408
|
-
"success": {
|
|
409
|
-
"type": "boolean",
|
|
410
|
-
"description": "Whether status retrieval was successful"
|
|
411
|
-
},
|
|
412
|
-
"results": {
|
|
413
|
-
"type": "object",
|
|
414
|
-
"description": "Status results for each provider",
|
|
415
|
-
"additionalProperties": {
|
|
416
|
-
"type": "object",
|
|
417
|
-
"properties": {
|
|
418
|
-
"available": {
|
|
419
|
-
"type": "boolean"
|
|
420
|
-
},
|
|
421
|
-
"authenticated": {
|
|
422
|
-
"type": "boolean"
|
|
423
|
-
},
|
|
424
|
-
"version": {
|
|
425
|
-
"type": "string"
|
|
426
|
-
},
|
|
427
|
-
"lastChecked": {
|
|
428
|
-
"type": "string",
|
|
429
|
-
"description": "Last status check timestamp"
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
},
|
|
434
|
-
"message": {
|
|
435
|
-
"type": "string"
|
|
436
|
-
},
|
|
437
|
-
"timestamp": {
|
|
438
|
-
"type": "string"
|
|
439
|
-
}
|
|
440
|
-
},
|
|
441
|
-
"required": ["success", "results"]
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
"name": "send_cli_prompt",
|
|
446
|
-
"description": "Send a prompt to a CLI provider and get response. Supports both stdin and argument modes for maximum compatibility.",
|
|
447
|
-
"inputSchema": {
|
|
448
|
-
"type": "object",
|
|
449
|
-
"properties": {
|
|
450
|
-
"provider_id": {
|
|
451
|
-
"type": "string",
|
|
452
|
-
"description": "CLI provider to send prompt to",
|
|
453
|
-
"enum": ["claude_code", "codex_cli", "gemini_cli"]
|
|
454
|
-
},
|
|
455
|
-
"prompt": {
|
|
456
|
-
"type": "string",
|
|
457
|
-
"description": "Prompt to send to the CLI",
|
|
458
|
-
"minLength": 1
|
|
459
|
-
},
|
|
460
|
-
"mode": {
|
|
461
|
-
"type": "string",
|
|
462
|
-
"description": "Prompt sending mode",
|
|
463
|
-
"enum": ["stdin", "args"],
|
|
464
|
-
"default": "args"
|
|
465
|
-
},
|
|
466
|
-
"timeout_ms": {
|
|
467
|
-
"type": "integer",
|
|
468
|
-
"description": "Timeout in milliseconds (90 seconds default for CLI-within-CLI scenarios)",
|
|
469
|
-
"minimum": 1000,
|
|
470
|
-
"maximum": 600000,
|
|
471
|
-
"default": 90000
|
|
472
|
-
},
|
|
473
|
-
"user_id": {
|
|
474
|
-
"type": "string",
|
|
475
|
-
"description": "User ID for usage tracking (optional)",
|
|
476
|
-
"minLength": 1
|
|
477
|
-
}
|
|
478
|
-
},
|
|
479
|
-
"required": ["prompt"]
|
|
480
|
-
},
|
|
481
|
-
"outputSchema": {
|
|
482
|
-
"type": "object",
|
|
483
|
-
"properties": {
|
|
484
|
-
"success": {
|
|
485
|
-
"type": "boolean",
|
|
486
|
-
"description": "Whether the prompt was sent successfully"
|
|
487
|
-
},
|
|
488
|
-
"content": {
|
|
489
|
-
"type": "string",
|
|
490
|
-
"description": "CLI response content"
|
|
491
|
-
},
|
|
492
|
-
"error": {
|
|
493
|
-
"type": "string",
|
|
494
|
-
"description": "Error message if prompt failed"
|
|
495
|
-
},
|
|
496
|
-
"tokens_used": {
|
|
497
|
-
"type": "integer",
|
|
498
|
-
"description": "Number of tokens used"
|
|
499
|
-
},
|
|
500
|
-
"latency_ms": {
|
|
501
|
-
"type": "integer",
|
|
502
|
-
"description": "Response latency in milliseconds"
|
|
503
|
-
},
|
|
504
|
-
"provider": {
|
|
505
|
-
"type": "string",
|
|
506
|
-
"description": "CLI provider used"
|
|
507
|
-
},
|
|
508
|
-
"mode": {
|
|
509
|
-
"type": "string",
|
|
510
|
-
"description": "Mode used for sending"
|
|
511
|
-
},
|
|
512
|
-
"timestamp": {
|
|
513
|
-
"type": "string",
|
|
514
|
-
"description": "Response timestamp"
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
"required": ["success", "provider", "timestamp"]
|
|
518
|
-
},
|
|
519
|
-
"examples": [
|
|
520
|
-
{
|
|
521
|
-
"description": "Send prompt to Claude Code",
|
|
522
|
-
"input": {
|
|
523
|
-
"provider_id": "claude_code",
|
|
524
|
-
"prompt": "Help me debug this TypeScript error: Property 'map' does not exist on type 'string'",
|
|
525
|
-
"mode": "args",
|
|
526
|
-
"user_id": "user_123"
|
|
527
|
-
},
|
|
528
|
-
"output": {
|
|
529
|
-
"success": true,
|
|
530
|
-
"content": "This error occurs when you're trying to use the .map() method on a string variable. The .map() method is an array method, not a string method...",
|
|
531
|
-
"tokens_used": 150,
|
|
532
|
-
"latency_ms": 1200,
|
|
533
|
-
"provider": "claude_code",
|
|
534
|
-
"mode": "args",
|
|
535
|
-
"timestamp": "2024-01-15T10:35:00Z"
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
]
|
|
539
|
-
},
|
|
540
295
|
{
|
|
541
296
|
"name": "enable_status_reporting",
|
|
542
297
|
"description": "Enable automatic CLI status reporting to polydev.ai server. Reports are sent when CLI detection runs and via periodic heartbeat. Requires a Polydev user token.",
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -453,7 +453,11 @@ Token will be saved automatically after login.`
|
|
|
453
453
|
}
|
|
454
454
|
|
|
455
455
|
// Handle get_perspectives with local CLIs + remote perspectives
|
|
456
|
-
|
|
456
|
+
// Also redirect send_cli_prompt → get_perspectives for backward compat
|
|
457
|
+
// (send_cli_prompt was removed from tool list to prevent AI models from choosing it
|
|
458
|
+
// over get_perspectives, but old clients may still call it)
|
|
459
|
+
if (toolName === 'get_perspectives' || toolName === 'polydev.get_perspectives' ||
|
|
460
|
+
toolName === 'send_cli_prompt' || toolName === 'polydev.send_cli_prompt') {
|
|
457
461
|
return await this.handleGetPerspectivesWithCLIs(params, id);
|
|
458
462
|
}
|
|
459
463
|
|
|
@@ -1096,11 +1100,10 @@ To authenticate, pass your token directly:
|
|
|
1096
1100
|
perspectivesSection += ` (${perspectiveCount} active)`;
|
|
1097
1101
|
|
|
1098
1102
|
// Show providers in order with their selected models
|
|
1099
|
-
for (
|
|
1100
|
-
const p = modelPrefs.allProviders[i];
|
|
1103
|
+
for (const p of modelPrefs.allProviders) {
|
|
1101
1104
|
const providerName = p.provider.charAt(0).toUpperCase() + p.provider.slice(1);
|
|
1102
1105
|
const source = p.cliId ? 'CLI' : (p.tier ? `Credits/${p.tier}` : 'API');
|
|
1103
|
-
perspectivesSection += `\n ${
|
|
1106
|
+
perspectivesSection += `\n ${providerName.padEnd(12)} ${p.model} [${source}]`;
|
|
1104
1107
|
}
|
|
1105
1108
|
} else {
|
|
1106
1109
|
perspectivesSection += '\n (none configured - using defaults)';
|
|
@@ -1630,10 +1633,8 @@ To re-login: /polydev:login`
|
|
|
1630
1633
|
const cliTools = [
|
|
1631
1634
|
'force_cli_detection',
|
|
1632
1635
|
'get_cli_status',
|
|
1633
|
-
'send_cli_prompt',
|
|
1634
1636
|
'polydev.force_cli_detection',
|
|
1635
|
-
'polydev.get_cli_status'
|
|
1636
|
-
'polydev.send_cli_prompt'
|
|
1637
|
+
'polydev.get_cli_status'
|
|
1637
1638
|
];
|
|
1638
1639
|
return cliTools.includes(toolName);
|
|
1639
1640
|
}
|
|
@@ -1721,11 +1722,6 @@ To re-login: /polydev:login`
|
|
|
1721
1722
|
result = await this.localGetCliStatus(args);
|
|
1722
1723
|
break;
|
|
1723
1724
|
|
|
1724
|
-
case 'send_cli_prompt':
|
|
1725
|
-
case 'polydev.send_cli_prompt':
|
|
1726
|
-
result = await this.localSendCliPrompt(args);
|
|
1727
|
-
break;
|
|
1728
|
-
|
|
1729
1725
|
default:
|
|
1730
1726
|
throw new Error(`Unknown CLI tool: ${toolName}`);
|
|
1731
1727
|
}
|
|
@@ -2194,7 +2190,7 @@ To re-login: /polydev:login`
|
|
|
2194
2190
|
if (result.success) successCount++;
|
|
2195
2191
|
completedCount++;
|
|
2196
2192
|
|
|
2197
|
-
// Resolve early if we have enough successes OR all
|
|
2193
|
+
// Resolve early if we have enough successes OR all complete
|
|
2198
2194
|
if (successCount >= needed || completedCount >= promises.length) {
|
|
2199
2195
|
resolved = true;
|
|
2200
2196
|
resolve([...results]); // Copy to prevent mutation from late arrivals
|
|
@@ -2462,7 +2458,7 @@ To re-login: /polydev:login`
|
|
|
2462
2458
|
user_token: this.userToken,
|
|
2463
2459
|
// Exclude providers that succeeded locally
|
|
2464
2460
|
exclude_providers: excludeProviders,
|
|
2465
|
-
// NEW: Specific providers to request (from API-only
|
|
2461
|
+
// NEW: Specific providers to request (from API-only providers)
|
|
2466
2462
|
request_providers: requestProviders.length > 0 ? requestProviders : undefined,
|
|
2467
2463
|
// Pass CLI responses for dashboard logging
|
|
2468
2464
|
cli_responses: cliResponses,
|
|
@@ -2524,9 +2520,6 @@ To re-login: /polydev:login`
|
|
|
2524
2520
|
}
|
|
2525
2521
|
}
|
|
2526
2522
|
|
|
2527
|
-
/**
|
|
2528
|
-
* Combine multiple CLI results and remote perspectives
|
|
2529
|
-
*/
|
|
2530
2523
|
combineAllCliAndPerspectives(localResults, perspectivesResult, args) {
|
|
2531
2524
|
// Ensure perspectivesResult is always an object to prevent undefined errors
|
|
2532
2525
|
const safePersp = perspectivesResult || { success: false, error: 'No response from perspectives server' };
|
|
@@ -2572,8 +2565,8 @@ To re-login: /polydev:login`
|
|
|
2572
2565
|
if (safePersp.raw) {
|
|
2573
2566
|
// Raw content is already formatted - use as-is
|
|
2574
2567
|
formatted += `${safePersp.content}\n\n`;
|
|
2575
|
-
} else {
|
|
2576
|
-
// Legacy formatting
|
|
2568
|
+
} else if (!safePersp.skipped) {
|
|
2569
|
+
// Legacy formatting (only if not skipped — skipped means CLIs filled all slots)
|
|
2577
2570
|
const title = (successfulClis.length === 0) ? 'Perspectives Fallback' : 'Supplemental Multi-Model Perspectives';
|
|
2578
2571
|
formatted += `${title}\n\n`;
|
|
2579
2572
|
formatted += `${safePersp.content}\n\n`;
|
|
@@ -2583,6 +2576,10 @@ To re-login: /polydev:login`
|
|
|
2583
2576
|
formatted += `❌ Perspectives request failed: ${safePersp.error || 'Unknown error'}\n\n`;
|
|
2584
2577
|
}
|
|
2585
2578
|
|
|
2579
|
+
// Strip "LOGIN SUCCESSFUL" banner that leaks from remote server responses
|
|
2580
|
+
// It gets appended to perspective results and pollutes the output
|
|
2581
|
+
formatted = formatted.replace(/\n*LOGIN SUCCESSFUL\n={4,}\n[\s\S]*?Dashboard:.*(\n|$)/g, '');
|
|
2582
|
+
|
|
2586
2583
|
return formatted.trim();
|
|
2587
2584
|
}
|
|
2588
2585
|
|
|
@@ -2900,25 +2897,6 @@ To re-login: /polydev:login`
|
|
|
2900
2897
|
} else {
|
|
2901
2898
|
return `CLI Response (${result.provider || 'Unknown'} - ${result.mode || 'unknown'} mode)\n\n${result.content}\n\nLatency: ${result.latency_ms || 0}ms | Tokens: ${result.tokens_used || 0} | ${result.timestamp}`;
|
|
2902
2899
|
}
|
|
2903
|
-
} else {
|
|
2904
|
-
// Status/detection response
|
|
2905
|
-
let formatted = `CLI Operation Success\n\n`;
|
|
2906
|
-
formatted += `${result.message}\n\n`;
|
|
2907
|
-
|
|
2908
|
-
if (result.results) {
|
|
2909
|
-
formatted += `Results:\n`;
|
|
2910
|
-
for (const [providerId, status] of Object.entries(result.results)) {
|
|
2911
|
-
const icon = status.available ? '[+]' : '[-]';
|
|
2912
|
-
const authStatus = status.authenticated ? '[auth]' : '[no-auth]';
|
|
2913
|
-
formatted += `- ${icon} ${authStatus} ${providerId}: ${status.available ? 'Available' : 'Not Available'}`;
|
|
2914
|
-
if (status.version) formatted += ` (${status.version})`;
|
|
2915
|
-
if (status.error) formatted += ` - ${status.error}`;
|
|
2916
|
-
formatted += `\n`;
|
|
2917
|
-
}
|
|
2918
|
-
}
|
|
2919
|
-
|
|
2920
|
-
formatted += `\n${result.local_only ? 'Local execution' : 'Remote execution'} | ${result.timestamp}`;
|
|
2921
|
-
return formatted;
|
|
2922
2900
|
}
|
|
2923
2901
|
}
|
|
2924
2902
|
|
|
@@ -2963,7 +2941,7 @@ To re-login: /polydev:login`
|
|
|
2963
2941
|
this.userModelPreferences = result.modelPreferences;
|
|
2964
2942
|
this.modelPreferencesCacheTime = Date.now();
|
|
2965
2943
|
|
|
2966
|
-
// Also cache
|
|
2944
|
+
// Also cache perspectivesPerMessage setting (default 2)
|
|
2967
2945
|
this.perspectivesPerMessage = result.perspectivesPerMessage || 2;
|
|
2968
2946
|
|
|
2969
2947
|
// Cache provider order from user's dashboard (respects display_order)
|
|
@@ -3141,6 +3119,7 @@ To re-login: /polydev:login`
|
|
|
3141
3119
|
return this.localForceCliDetection({});
|
|
3142
3120
|
}).then(() => {
|
|
3143
3121
|
this._cliDetectionComplete = true;
|
|
3122
|
+
// Display CLI status after detection
|
|
3144
3123
|
return this.displayCliStatus();
|
|
3145
3124
|
}).catch((error) => {
|
|
3146
3125
|
console.error('[Polydev] Auto-login flow error:', error.message);
|
|
@@ -3416,37 +3395,6 @@ function createSandboxServer() {
|
|
|
3416
3395
|
required: ['prompt']
|
|
3417
3396
|
}
|
|
3418
3397
|
},
|
|
3419
|
-
{
|
|
3420
|
-
name: 'get_cli_status',
|
|
3421
|
-
description: 'Check status of local CLI tools (Claude Code, Codex CLI, Gemini CLI)',
|
|
3422
|
-
inputSchema: {
|
|
3423
|
-
type: 'object',
|
|
3424
|
-
properties: {
|
|
3425
|
-
provider_id: {
|
|
3426
|
-
type: 'string',
|
|
3427
|
-
description: 'Optional specific provider to check'
|
|
3428
|
-
}
|
|
3429
|
-
}
|
|
3430
|
-
}
|
|
3431
|
-
},
|
|
3432
|
-
{
|
|
3433
|
-
name: 'force_cli_detection',
|
|
3434
|
-
description: 'Force re-detection of installed local CLI tools',
|
|
3435
|
-
inputSchema: { type: 'object', properties: {} }
|
|
3436
|
-
},
|
|
3437
|
-
{
|
|
3438
|
-
name: 'send_cli_prompt',
|
|
3439
|
-
description: 'Send prompt to local CLI with perspectives fallback',
|
|
3440
|
-
inputSchema: {
|
|
3441
|
-
type: 'object',
|
|
3442
|
-
properties: {
|
|
3443
|
-
provider_id: { type: 'string', description: 'CLI provider ID' },
|
|
3444
|
-
prompt: { type: 'string', description: 'Prompt to send' },
|
|
3445
|
-
mode: { type: 'string', enum: ['args', 'stdin'], default: 'args' }
|
|
3446
|
-
},
|
|
3447
|
-
required: ['provider_id', 'prompt']
|
|
3448
|
-
}
|
|
3449
|
-
}
|
|
3450
3398
|
]
|
|
3451
3399
|
};
|
|
3452
3400
|
}
|