polydev-ai 1.8.87 → 1.8.88
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/login.js +0 -0
- package/mcp/stdio-wrapper.js +131 -25
- package/package.json +1 -1
package/mcp/login.js
CHANGED
|
File without changes
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -421,7 +421,18 @@ class StdioMCPWrapper {
|
|
|
421
421
|
result: {
|
|
422
422
|
content: [{
|
|
423
423
|
type: 'text',
|
|
424
|
-
text:
|
|
424
|
+
text: `╭─────────────────────────────────────────╮
|
|
425
|
+
│ ALREADY AUTHENTICATED ✓ │
|
|
426
|
+
╰─────────────────────────────────────────╯
|
|
427
|
+
|
|
428
|
+
🔐 Your token is configured and ready.
|
|
429
|
+
|
|
430
|
+
🤖 Available commands:
|
|
431
|
+
• /polydev:ask - Query multiple AI models
|
|
432
|
+
• /polydev:auth - Check status & credits
|
|
433
|
+
• get_perspectives - Direct tool call
|
|
434
|
+
|
|
435
|
+
To re-login: npx polydev-ai`
|
|
425
436
|
}]
|
|
426
437
|
}
|
|
427
438
|
});
|
|
@@ -467,7 +478,22 @@ class StdioMCPWrapper {
|
|
|
467
478
|
result: {
|
|
468
479
|
content: [{
|
|
469
480
|
type: 'text',
|
|
470
|
-
text:
|
|
481
|
+
text: `╭─────────────────────────────────────────╮
|
|
482
|
+
│ LOGIN SUCCESSFUL! ✓ │
|
|
483
|
+
╰─────────────────────────────────────────╯
|
|
484
|
+
|
|
485
|
+
🔐 Token saved to:
|
|
486
|
+
• ~/.polydev.env
|
|
487
|
+
• ~/.zshrc
|
|
488
|
+
|
|
489
|
+
⚠️ IMPORTANT: Restart your IDE to activate.
|
|
490
|
+
|
|
491
|
+
🤖 After restart, you can:
|
|
492
|
+
• Use /polydev:ask to query multiple AI models
|
|
493
|
+
• Use /polydev:auth to check status & credits
|
|
494
|
+
• Use get_perspectives tool directly
|
|
495
|
+
|
|
496
|
+
📊 Dashboard: https://polydev.ai/dashboard`
|
|
471
497
|
}]
|
|
472
498
|
}
|
|
473
499
|
});
|
|
@@ -531,7 +557,7 @@ class StdioMCPWrapper {
|
|
|
531
557
|
}
|
|
532
558
|
|
|
533
559
|
/**
|
|
534
|
-
* Handle get_auth_status tool
|
|
560
|
+
* Handle get_auth_status tool - comprehensive status display
|
|
535
561
|
*/
|
|
536
562
|
async handleGetAuthStatus(params, id) {
|
|
537
563
|
// Try to hot-reload token if not authenticated
|
|
@@ -546,27 +572,52 @@ class StdioMCPWrapper {
|
|
|
546
572
|
result: {
|
|
547
573
|
content: [{
|
|
548
574
|
type: 'text',
|
|
549
|
-
text:
|
|
575
|
+
text: `╭─────────────────────────────────────────╮
|
|
576
|
+
│ POLYDEV STATUS │
|
|
577
|
+
╰─────────────────────────────────────────╯
|
|
578
|
+
|
|
579
|
+
🔐 Authentication: Not logged in
|
|
580
|
+
|
|
581
|
+
To login:
|
|
582
|
+
1. Use the "login" tool (opens browser)
|
|
583
|
+
2. Or run: npx polydev-ai
|
|
584
|
+
|
|
585
|
+
After login, restart your IDE.`
|
|
550
586
|
}]
|
|
551
587
|
}
|
|
552
588
|
};
|
|
553
589
|
}
|
|
554
590
|
|
|
555
591
|
try {
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
592
|
+
// Fetch account status and CLI status in parallel
|
|
593
|
+
const [accountResponse, cliStatus] = await Promise.all([
|
|
594
|
+
fetch('https://www.polydev.ai/api/mcp', {
|
|
595
|
+
method: 'POST',
|
|
596
|
+
headers: {
|
|
597
|
+
'Content-Type': 'application/json',
|
|
598
|
+
'Authorization': `Bearer ${this.userToken}`,
|
|
599
|
+
'User-Agent': 'polydev-stdio-wrapper/1.0.0'
|
|
600
|
+
},
|
|
601
|
+
body: JSON.stringify({ action: 'check_status' })
|
|
602
|
+
}),
|
|
603
|
+
this.cliManager?.getQuickStatus?.() || null
|
|
604
|
+
]);
|
|
565
605
|
|
|
566
|
-
if (
|
|
567
|
-
const data = await
|
|
606
|
+
if (accountResponse.ok) {
|
|
607
|
+
const data = await accountResponse.json();
|
|
568
608
|
const credits = data.credits_remaining?.toLocaleString() || 0;
|
|
569
609
|
const tier = data.subscription_tier || 'Free';
|
|
610
|
+
const email = data.email || 'Connected';
|
|
611
|
+
|
|
612
|
+
// Build CLI status string
|
|
613
|
+
let cliSection = '';
|
|
614
|
+
if (cliStatus) {
|
|
615
|
+
const cliLines = [];
|
|
616
|
+
if (cliStatus.claude_code) cliLines.push(` ✓ Claude Code ${cliStatus.claude_code.available ? '(ready)' : '(not found)'}`);
|
|
617
|
+
if (cliStatus.codex_cli) cliLines.push(` ✓ Codex CLI ${cliStatus.codex_cli.available ? '(ready)' : '(not found)'}`);
|
|
618
|
+
if (cliStatus.gemini_cli) cliLines.push(` ✓ Gemini CLI ${cliStatus.gemini_cli.available ? '(ready)' : '(not found)'}`);
|
|
619
|
+
cliSection = cliLines.length > 0 ? `\n🖥️ Local CLI Tools:\n${cliLines.join('\n')}` : '\n🖥️ Local CLI Tools: None detected';
|
|
620
|
+
}
|
|
570
621
|
|
|
571
622
|
return {
|
|
572
623
|
jsonrpc: '2.0',
|
|
@@ -574,7 +625,28 @@ class StdioMCPWrapper {
|
|
|
574
625
|
result: {
|
|
575
626
|
content: [{
|
|
576
627
|
type: 'text',
|
|
577
|
-
text:
|
|
628
|
+
text: `╭─────────────────────────────────────────╮
|
|
629
|
+
│ POLYDEV STATUS │
|
|
630
|
+
╰─────────────────────────────────────────╯
|
|
631
|
+
|
|
632
|
+
🔐 Authentication: ✓ Logged in
|
|
633
|
+
👤 Account: ${email}
|
|
634
|
+
💰 Credits: ${credits}
|
|
635
|
+
⭐ Tier: ${tier}
|
|
636
|
+
${cliSection}
|
|
637
|
+
|
|
638
|
+
🤖 Available Models:
|
|
639
|
+
• GPT-5.2 (OpenAI)
|
|
640
|
+
• Claude Opus 4.5 (Anthropic)
|
|
641
|
+
• Gemini 3 Pro (Google)
|
|
642
|
+
• Grok 4.1 (xAI)
|
|
643
|
+
|
|
644
|
+
🛠️ Tools:
|
|
645
|
+
• get_perspectives - Query multiple AI models
|
|
646
|
+
• get_cli_status - Check local CLI tools
|
|
647
|
+
• send_cli_prompt - Use local CLIs
|
|
648
|
+
|
|
649
|
+
📊 Dashboard: https://polydev.ai/dashboard`
|
|
578
650
|
}]
|
|
579
651
|
}
|
|
580
652
|
};
|
|
@@ -585,7 +657,15 @@ class StdioMCPWrapper {
|
|
|
585
657
|
result: {
|
|
586
658
|
content: [{
|
|
587
659
|
type: 'text',
|
|
588
|
-
text:
|
|
660
|
+
text: `╭─────────────────────────────────────────╮
|
|
661
|
+
│ POLYDEV STATUS │
|
|
662
|
+
╰─────────────────────────────────────────╯
|
|
663
|
+
|
|
664
|
+
⚠️ Token invalid or expired.
|
|
665
|
+
|
|
666
|
+
Please re-login:
|
|
667
|
+
1. Use the "login" tool
|
|
668
|
+
2. Or run: npx polydev-ai login`
|
|
589
669
|
}],
|
|
590
670
|
isError: true
|
|
591
671
|
}
|
|
@@ -598,7 +678,13 @@ class StdioMCPWrapper {
|
|
|
598
678
|
result: {
|
|
599
679
|
content: [{
|
|
600
680
|
type: 'text',
|
|
601
|
-
text:
|
|
681
|
+
text: `╭─────────────────────────────────────────╮
|
|
682
|
+
│ POLYDEV STATUS │
|
|
683
|
+
╰─────────────────────────────────────────╯
|
|
684
|
+
|
|
685
|
+
⚠️ Could not verify status (offline?)
|
|
686
|
+
|
|
687
|
+
Error: ${error.message}`
|
|
602
688
|
}],
|
|
603
689
|
isError: true
|
|
604
690
|
}
|
|
@@ -1491,7 +1577,7 @@ class StdioMCPWrapper {
|
|
|
1491
1577
|
// Map CLI provider IDs to API provider names for exclusion
|
|
1492
1578
|
const cliToApiProvider = {
|
|
1493
1579
|
'claude_code': 'anthropic',
|
|
1494
|
-
'codex_cli': 'openai',
|
|
1580
|
+
'codex_cli': 'openai',
|
|
1495
1581
|
'gemini_cli': 'google'
|
|
1496
1582
|
};
|
|
1497
1583
|
|
|
@@ -2284,15 +2370,35 @@ class StdioMCPWrapper {
|
|
|
2284
2370
|
});
|
|
2285
2371
|
res.end(this.getLoginSuccessHTML());
|
|
2286
2372
|
|
|
2287
|
-
console.error('[
|
|
2288
|
-
console.error(' Token saved to ~/.zshrc and ~/.polydev.env');
|
|
2289
|
-
console.error('');
|
|
2290
|
-
console.error(' IMPORTANT: Restart your IDE to use the new token.');
|
|
2291
|
-
console.error('─'.repeat(50) + '\n');
|
|
2373
|
+
console.error('[Polydev] Login successful, token saved');
|
|
2292
2374
|
|
|
2293
2375
|
setTimeout(() => {
|
|
2294
2376
|
server.close();
|
|
2295
|
-
resolve(
|
|
2377
|
+
resolve({
|
|
2378
|
+
jsonrpc: '2.0',
|
|
2379
|
+
id,
|
|
2380
|
+
result: {
|
|
2381
|
+
content: [{
|
|
2382
|
+
type: 'text',
|
|
2383
|
+
text: `╭─────────────────────────────────────────╮
|
|
2384
|
+
│ LOGIN SUCCESSFUL! ✓ │
|
|
2385
|
+
╰─────────────────────────────────────────╯
|
|
2386
|
+
|
|
2387
|
+
🔐 Token saved to:
|
|
2388
|
+
• ~/.polydev.env
|
|
2389
|
+
• ~/.zshrc
|
|
2390
|
+
|
|
2391
|
+
⚠️ IMPORTANT: Restart your IDE to activate.
|
|
2392
|
+
|
|
2393
|
+
🤖 After restart, you can:
|
|
2394
|
+
• Use /polydev:ask to query multiple AI models
|
|
2395
|
+
• Use /polydev:auth to check status & credits
|
|
2396
|
+
• Use get_perspectives tool directly
|
|
2397
|
+
|
|
2398
|
+
📊 Dashboard: https://polydev.ai/dashboard`
|
|
2399
|
+
}]
|
|
2400
|
+
}
|
|
2401
|
+
});
|
|
2296
2402
|
}, 500);
|
|
2297
2403
|
} else {
|
|
2298
2404
|
res.writeHead(400, { 'Content-Type': 'text/plain' });
|