polydev-ai 1.8.87 → 1.8.89

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 CHANGED
File without changes
@@ -421,7 +421,18 @@ class StdioMCPWrapper {
421
421
  result: {
422
422
  content: [{
423
423
  type: 'text',
424
- text: `Already authenticated.\n\nYour token is configured. Use get_perspectives to query multiple AI models.\n\nTo re-login, run in terminal: npx polydev-ai`
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: `Login successful!\n\nYour token has been saved to ~/.zshrc and ~/.polydev.env\n\nIMPORTANT: Restart your IDE to use the new token.\n\nAfter restart, use get_perspectives to query GPT-5, Claude, Gemini, and Grok in parallel.`
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,51 @@ class StdioMCPWrapper {
546
572
  result: {
547
573
  content: [{
548
574
  type: 'text',
549
- text: `Not authenticated.\n\nTo login:\n1. Use the "login" tool (opens browser)\n2. Or run in terminal: npx polydev-ai\n\nAfter login, restart your IDE.`
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
- const response = await fetch('https://www.polydev.ai/api/mcp', {
557
- method: 'POST',
558
- headers: {
559
- 'Content-Type': 'application/json',
560
- 'Authorization': `Bearer ${this.userToken}`,
561
- 'User-Agent': 'polydev-stdio-wrapper/1.0.0'
562
- },
563
- body: JSON.stringify({ action: 'check_status' })
564
- });
592
+ // Fetch account status from simple REST endpoint (not JSON-RPC)
593
+ const [accountResponse, cliStatus] = await Promise.all([
594
+ fetch('https://www.polydev.ai/api/auth/status', {
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
+ }),
602
+ this.cliManager?.getQuickStatus?.() || null
603
+ ]);
565
604
 
566
- if (response.ok) {
567
- const data = await response.json();
605
+ if (accountResponse.ok) {
606
+ const data = await accountResponse.json();
568
607
  const credits = data.credits_remaining?.toLocaleString() || 0;
569
608
  const tier = data.subscription_tier || 'Free';
609
+ const email = data.email || 'Connected';
610
+
611
+ // Build CLI status string
612
+ let cliSection = '';
613
+ if (cliStatus) {
614
+ const cliLines = [];
615
+ if (cliStatus.claude_code) cliLines.push(` ✓ Claude Code ${cliStatus.claude_code.available ? '(ready)' : '(not found)'}`);
616
+ if (cliStatus.codex_cli) cliLines.push(` ✓ Codex CLI ${cliStatus.codex_cli.available ? '(ready)' : '(not found)'}`);
617
+ if (cliStatus.gemini_cli) cliLines.push(` ✓ Gemini CLI ${cliStatus.gemini_cli.available ? '(ready)' : '(not found)'}`);
618
+ cliSection = cliLines.length > 0 ? `\n🖥️ Local CLI Tools:\n${cliLines.join('\n')}` : '\n🖥️ Local CLI Tools: None detected';
619
+ }
570
620
 
571
621
  return {
572
622
  jsonrpc: '2.0',
@@ -574,7 +624,28 @@ class StdioMCPWrapper {
574
624
  result: {
575
625
  content: [{
576
626
  type: 'text',
577
- text: `Polydev Status\n${'─'.repeat(40)}\n\nAuthenticated: Yes\nAccount: ${data.email || 'Connected'}\nCredits: ${credits}\nTier: ${tier}\n\nAvailable tools:\n- get_perspectives (query multiple AI models)\n- get_cli_status (check local CLI tools)\n- send_cli_prompt (use local CLIs)\n\nDashboard: https://polydev.ai/dashboard`
627
+ text: `╭─────────────────────────────────────────╮
628
+ │ POLYDEV STATUS │
629
+ ╰─────────────────────────────────────────╯
630
+
631
+ 🔐 Authentication: ✓ Logged in
632
+ 👤 Account: ${email}
633
+ 💰 Credits: ${credits}
634
+ ⭐ Tier: ${tier}
635
+ ${cliSection}
636
+
637
+ 🤖 Available Models:
638
+ • GPT-5.2 (OpenAI)
639
+ • Claude Opus 4.5 (Anthropic)
640
+ • Gemini 3 Pro (Google)
641
+ • Grok 4.1 (xAI)
642
+
643
+ 🛠️ Tools:
644
+ • get_perspectives - Query multiple AI models
645
+ • get_cli_status - Check local CLI tools
646
+ • send_cli_prompt - Use local CLIs
647
+
648
+ 📊 Dashboard: https://polydev.ai/dashboard`
578
649
  }]
579
650
  }
580
651
  };
@@ -585,7 +656,15 @@ class StdioMCPWrapper {
585
656
  result: {
586
657
  content: [{
587
658
  type: 'text',
588
- text: `Token invalid or expired.\n\nPlease re-login:\n1. Use the "login" tool\n2. Or run: npx polydev-ai login`
659
+ text: `╭─────────────────────────────────────────╮
660
+ │ POLYDEV STATUS │
661
+ ╰─────────────────────────────────────────╯
662
+
663
+ ⚠️ Token invalid or expired.
664
+
665
+ Please re-login:
666
+ 1. Use the "login" tool
667
+ 2. Or run: npx polydev-ai login`
589
668
  }],
590
669
  isError: true
591
670
  }
@@ -598,7 +677,13 @@ class StdioMCPWrapper {
598
677
  result: {
599
678
  content: [{
600
679
  type: 'text',
601
- text: `Could not verify status (offline?)\n\nError: ${error.message}`
680
+ text: `╭─────────────────────────────────────────╮
681
+ │ POLYDEV STATUS │
682
+ ╰─────────────────────────────────────────╯
683
+
684
+ ⚠️ Could not verify status (offline?)
685
+
686
+ Error: ${error.message}`
602
687
  }],
603
688
  isError: true
604
689
  }
@@ -1491,7 +1576,7 @@ class StdioMCPWrapper {
1491
1576
  // Map CLI provider IDs to API provider names for exclusion
1492
1577
  const cliToApiProvider = {
1493
1578
  'claude_code': 'anthropic',
1494
- 'codex_cli': 'openai',
1579
+ 'codex_cli': 'openai',
1495
1580
  'gemini_cli': 'google'
1496
1581
  };
1497
1582
 
@@ -2284,15 +2369,35 @@ class StdioMCPWrapper {
2284
2369
  });
2285
2370
  res.end(this.getLoginSuccessHTML());
2286
2371
 
2287
- console.error('[OK] Authentication successful!');
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');
2372
+ console.error('[Polydev] Login successful, token saved');
2292
2373
 
2293
2374
  setTimeout(() => {
2294
2375
  server.close();
2295
- resolve(true);
2376
+ resolve({
2377
+ jsonrpc: '2.0',
2378
+ id,
2379
+ result: {
2380
+ content: [{
2381
+ type: 'text',
2382
+ text: `╭─────────────────────────────────────────╮
2383
+ │ LOGIN SUCCESSFUL! ✓ │
2384
+ ╰─────────────────────────────────────────╯
2385
+
2386
+ 🔐 Token saved to:
2387
+ • ~/.polydev.env
2388
+ • ~/.zshrc
2389
+
2390
+ ⚠️ IMPORTANT: Restart your IDE to activate.
2391
+
2392
+ 🤖 After restart, you can:
2393
+ • Use /polydev:ask to query multiple AI models
2394
+ • Use /polydev:auth to check status & credits
2395
+ • Use get_perspectives tool directly
2396
+
2397
+ 📊 Dashboard: https://polydev.ai/dashboard`
2398
+ }]
2399
+ }
2400
+ });
2296
2401
  }, 500);
2297
2402
  } else {
2298
2403
  res.writeHead(400, { 'Content-Type': 'text/plain' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.8.87",
3
+ "version": "1.8.89",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },