polydev-ai 1.8.97 → 1.8.99
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/server.js +2 -2
- package/mcp/stdio-wrapper.js +76 -65
- package/package.json +1 -1
package/mcp/server.js
CHANGED
|
@@ -400,7 +400,7 @@ class MCPServer {
|
|
|
400
400
|
mcp_tools: 'https://polydev.ai/dashboard/mcp-tools',
|
|
401
401
|
documentation: 'https://polydev.ai/docs/mcp-integration'
|
|
402
402
|
},
|
|
403
|
-
available_models: ['
|
|
403
|
+
available_models: ['GPT-5.2', 'Claude Opus 4.5', 'Gemini 3 Pro', 'Grok 4.1'],
|
|
404
404
|
pricing: {
|
|
405
405
|
free_tier: '500 credits/month (no credit card required)',
|
|
406
406
|
premium_tier: '$10/month for 10,000 credits',
|
|
@@ -432,7 +432,7 @@ class MCPServer {
|
|
|
432
432
|
credits_used_today: data.credits_used_today || 0,
|
|
433
433
|
subscription_tier: data.subscription_tier || 'Free',
|
|
434
434
|
token_expires_at: data.token_expires_at,
|
|
435
|
-
enabled_models: data.enabled_models || ['
|
|
435
|
+
enabled_models: data.enabled_models || ['GPT-5.2', 'Claude Opus 4.5', 'Gemini 3 Pro', 'Grok 4.1'],
|
|
436
436
|
cli_subscriptions: data.cli_subscriptions || [],
|
|
437
437
|
quick_links: {
|
|
438
438
|
dashboard: 'https://polydev.ai/dashboard',
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -371,7 +371,16 @@ class StdioMCPWrapper {
|
|
|
371
371
|
result: {
|
|
372
372
|
content: [{
|
|
373
373
|
type: 'text',
|
|
374
|
-
text: `
|
|
374
|
+
text: `POLYDEV STATUS
|
|
375
|
+
==============
|
|
376
|
+
|
|
377
|
+
Authentication: Not connected
|
|
378
|
+
|
|
379
|
+
To login:
|
|
380
|
+
1. Use the "login" tool (opens browser)
|
|
381
|
+
2. Or run: npx polydev-ai
|
|
382
|
+
|
|
383
|
+
Token will be saved automatically after login.`
|
|
375
384
|
}],
|
|
376
385
|
isError: true
|
|
377
386
|
}
|
|
@@ -617,25 +626,24 @@ After login:
|
|
|
617
626
|
result: {
|
|
618
627
|
content: [{
|
|
619
628
|
type: 'text',
|
|
620
|
-
text:
|
|
621
|
-
|
|
622
|
-
╰─────────────────────────────────────────╯
|
|
629
|
+
text: `POLYDEV STATUS
|
|
630
|
+
==============
|
|
623
631
|
|
|
624
|
-
|
|
632
|
+
Authentication: Not connected
|
|
625
633
|
|
|
626
634
|
To login:
|
|
627
635
|
1. Use the "login" tool (opens browser)
|
|
628
636
|
2. Or run: npx polydev-ai
|
|
629
637
|
|
|
630
|
-
|
|
638
|
+
Token will be saved automatically after login.`
|
|
631
639
|
}]
|
|
632
640
|
}
|
|
633
641
|
};
|
|
634
642
|
}
|
|
635
643
|
|
|
636
644
|
try {
|
|
637
|
-
// Fetch account status
|
|
638
|
-
const [accountResponse, cliStatus] = await Promise.all([
|
|
645
|
+
// Fetch account status and model preferences in parallel
|
|
646
|
+
const [accountResponse, modelPrefsResponse, cliStatus] = await Promise.all([
|
|
639
647
|
fetch('https://www.polydev.ai/api/auth/status', {
|
|
640
648
|
method: 'POST',
|
|
641
649
|
headers: {
|
|
@@ -644,6 +652,13 @@ After login, restart your IDE.`
|
|
|
644
652
|
'User-Agent': 'polydev-stdio-wrapper/1.0.0'
|
|
645
653
|
}
|
|
646
654
|
}),
|
|
655
|
+
fetch('https://www.polydev.ai/api/model-preferences', {
|
|
656
|
+
method: 'GET',
|
|
657
|
+
headers: {
|
|
658
|
+
'Authorization': `Bearer ${this.userToken}`,
|
|
659
|
+
'User-Agent': 'polydev-stdio-wrapper/1.0.0'
|
|
660
|
+
}
|
|
661
|
+
}).catch(() => null),
|
|
647
662
|
this.cliManager?.getCliStatus?.() || null
|
|
648
663
|
]);
|
|
649
664
|
|
|
@@ -654,47 +669,61 @@ After login, restart your IDE.`
|
|
|
654
669
|
const tier = data.subscription_tier || 'Free';
|
|
655
670
|
const email = data.email || 'Connected';
|
|
656
671
|
|
|
657
|
-
//
|
|
658
|
-
let
|
|
659
|
-
if (
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
if (cliLines.length > 0) {
|
|
665
|
-
cliSection = `\n🖥️ Local CLI Tools:\n${cliLines.join('\n')}`;
|
|
672
|
+
// Parse model preferences
|
|
673
|
+
let modelPrefs = null;
|
|
674
|
+
if (modelPrefsResponse?.ok) {
|
|
675
|
+
try {
|
|
676
|
+
modelPrefs = await modelPrefsResponse.json();
|
|
677
|
+
} catch (e) {
|
|
678
|
+
// Ignore parse errors
|
|
666
679
|
}
|
|
667
680
|
}
|
|
668
681
|
|
|
682
|
+
// Build configured perspectives section
|
|
683
|
+
let perspectivesSection = '\nConfigured Perspectives:';
|
|
684
|
+
if (modelPrefs?.allProviders && modelPrefs.allProviders.length > 0) {
|
|
685
|
+
const perspectiveCount = modelPrefs.perspectivesPerMessage || modelPrefs.allProviders.length;
|
|
686
|
+
perspectivesSection += ` (${perspectiveCount} active)`;
|
|
687
|
+
|
|
688
|
+
// Show providers in order with their selected models
|
|
689
|
+
for (let i = 0; i < modelPrefs.allProviders.length; i++) {
|
|
690
|
+
const p = modelPrefs.allProviders[i];
|
|
691
|
+
const providerName = p.provider.charAt(0).toUpperCase() + p.provider.slice(1);
|
|
692
|
+
const source = p.cliId ? 'CLI' : (p.tier ? `Credits/${p.tier}` : 'API');
|
|
693
|
+
perspectivesSection += `\n ${i + 1}. ${providerName.padEnd(12)} ${p.model} [${source}]`;
|
|
694
|
+
}
|
|
695
|
+
} else {
|
|
696
|
+
perspectivesSection += '\n (none configured - using defaults)';
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
// Build CLI status section
|
|
700
|
+
let cliSection = '\nLocal CLI Tools:';
|
|
701
|
+
if (cliStatus) {
|
|
702
|
+
cliSection += `\n Claude Code ${cliStatus.claude_code?.available ? '[connected]' : '[not found]'}${cliStatus.claude_code?.version ? ' ' + cliStatus.claude_code.version : ''}`;
|
|
703
|
+
cliSection += `\n Codex CLI ${cliStatus.codex_cli?.available ? '[connected]' : '[not found]'}${cliStatus.codex_cli?.version ? ' ' + cliStatus.codex_cli.version : ''}`;
|
|
704
|
+
cliSection += `\n Gemini CLI ${cliStatus.gemini_cli?.available ? '[connected]' : '[not found]'}${cliStatus.gemini_cli?.version ? ' ' + cliStatus.gemini_cli.version : ''}`;
|
|
705
|
+
} else {
|
|
706
|
+
cliSection += '\n (detecting...)';
|
|
707
|
+
}
|
|
708
|
+
|
|
669
709
|
return {
|
|
670
710
|
jsonrpc: '2.0',
|
|
671
711
|
id,
|
|
672
712
|
result: {
|
|
673
713
|
content: [{
|
|
674
714
|
type: 'text',
|
|
675
|
-
text:
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
715
|
+
text: `POLYDEV STATUS
|
|
716
|
+
==============
|
|
717
|
+
|
|
718
|
+
Authentication: Connected
|
|
719
|
+
Account: ${email}
|
|
720
|
+
Credits: ${credits}
|
|
721
|
+
Messages: ${messages}
|
|
722
|
+
Tier: ${tier}
|
|
723
|
+
${perspectivesSection}
|
|
684
724
|
${cliSection}
|
|
685
725
|
|
|
686
|
-
|
|
687
|
-
• GPT-5.2 (OpenAI)
|
|
688
|
-
• Claude Opus 4.5 (Anthropic)
|
|
689
|
-
• Gemini 3 Pro (Google)
|
|
690
|
-
• Grok 4.1 (xAI)
|
|
691
|
-
|
|
692
|
-
🛠️ Tools:
|
|
693
|
-
• get_perspectives - Query multiple AI models
|
|
694
|
-
• get_cli_status - Check local CLI tools
|
|
695
|
-
• send_cli_prompt - Use local CLIs
|
|
696
|
-
|
|
697
|
-
📊 Dashboard: https://polydev.ai/dashboard`
|
|
726
|
+
Configure: https://polydev.ai/dashboard/models`
|
|
698
727
|
}]
|
|
699
728
|
}
|
|
700
729
|
};
|
|
@@ -705,11 +734,10 @@ ${cliSection}
|
|
|
705
734
|
result: {
|
|
706
735
|
content: [{
|
|
707
736
|
type: 'text',
|
|
708
|
-
text:
|
|
709
|
-
|
|
710
|
-
╰─────────────────────────────────────────╯
|
|
737
|
+
text: `POLYDEV STATUS
|
|
738
|
+
==============
|
|
711
739
|
|
|
712
|
-
|
|
740
|
+
Token invalid or expired.
|
|
713
741
|
|
|
714
742
|
Please re-login:
|
|
715
743
|
1. Use the "login" tool
|
|
@@ -726,11 +754,10 @@ Please re-login:
|
|
|
726
754
|
result: {
|
|
727
755
|
content: [{
|
|
728
756
|
type: 'text',
|
|
729
|
-
text:
|
|
730
|
-
|
|
731
|
-
╰─────────────────────────────────────────╯
|
|
757
|
+
text: `POLYDEV STATUS
|
|
758
|
+
==============
|
|
732
759
|
|
|
733
|
-
|
|
760
|
+
Could not verify status (offline?)
|
|
734
761
|
|
|
735
762
|
Error: ${error.message}`
|
|
736
763
|
}],
|
|
@@ -2193,31 +2220,15 @@ Error: ${error.message}`
|
|
|
2193
2220
|
fs.mkdirSync(polydevevDir, { recursive: true });
|
|
2194
2221
|
}
|
|
2195
2222
|
|
|
2196
|
-
// Load existing usage data
|
|
2197
|
-
let usageData = [];
|
|
2198
|
-
if (fs.existsSync(usageFile)) {
|
|
2199
|
-
try {
|
|
2200
|
-
usageData = JSON.parse(fs.readFileSync(usageFile, 'utf8'));
|
|
2201
|
-
} catch (parseError) {
|
|
2202
|
-
console.error('[Stdio Wrapper] Failed to parse existing usage file, starting fresh:', parseError);
|
|
2203
|
-
usageData = [];
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
2223
|
// Add new usage record
|
|
2208
|
-
usageData
|
|
2224
|
+
const usageData = {
|
|
2209
2225
|
timestamp: new Date().toISOString(),
|
|
2210
2226
|
provider: providerId,
|
|
2211
2227
|
prompt_length: prompt.length,
|
|
2212
2228
|
success: response.success,
|
|
2213
2229
|
latency_ms: response.latency_ms || response.latencyMs || 0,
|
|
2214
2230
|
tokens_used: response.tokens_used || response.tokensUsed || 0
|
|
2215
|
-
}
|
|
2216
|
-
|
|
2217
|
-
// Keep only last 1000 records
|
|
2218
|
-
if (usageData.length > 1000) {
|
|
2219
|
-
usageData = usageData.slice(-1000);
|
|
2220
|
-
}
|
|
2231
|
+
};
|
|
2221
2232
|
|
|
2222
2233
|
fs.writeFileSync(usageFile, JSON.stringify(usageData, null, 2));
|
|
2223
2234
|
console.error(`[Stdio Wrapper] Usage recorded locally`);
|
|
@@ -2324,7 +2335,7 @@ Error: ${error.message}`
|
|
|
2324
2335
|
? result.providerOrder
|
|
2325
2336
|
: ['claude_code', 'codex_cli', 'gemini_cli'];
|
|
2326
2337
|
|
|
2327
|
-
// NEW: Cache full list of all providers (CLI + API-only) from dashboard
|
|
2338
|
+
// NEW: Cache full list of all providers (CLI + API-only providers) from dashboard
|
|
2328
2339
|
// Format: [{ provider: 'openai', model: 'gpt-52-codex', cliId: 'codex_cli' }, { provider: 'x-ai', model: 'grok-4', cliId: null }, ...]
|
|
2329
2340
|
this.allProviders = result.allProviders || [];
|
|
2330
2341
|
|