polydev-ai 1.8.96 → 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 +77 -62
- 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,23 +652,58 @@ 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
|
|
|
650
665
|
if (accountResponse.ok) {
|
|
651
666
|
const data = await accountResponse.json();
|
|
652
667
|
const credits = data.credits_remaining?.toLocaleString() || 0;
|
|
668
|
+
const messages = data.messages_remaining?.toLocaleString() || 0;
|
|
653
669
|
const tier = data.subscription_tier || 'Free';
|
|
654
670
|
const email = data.email || 'Connected';
|
|
655
671
|
|
|
656
|
-
//
|
|
657
|
-
let
|
|
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
|
|
679
|
+
}
|
|
680
|
+
}
|
|
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:';
|
|
658
701
|
if (cliStatus) {
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
cliSection
|
|
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...)';
|
|
664
707
|
}
|
|
665
708
|
|
|
666
709
|
return {
|
|
@@ -669,28 +712,18 @@ After login, restart your IDE.`
|
|
|
669
712
|
result: {
|
|
670
713
|
content: [{
|
|
671
714
|
type: 'text',
|
|
672
|
-
text:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
715
|
+
text: `POLYDEV STATUS
|
|
716
|
+
==============
|
|
717
|
+
|
|
718
|
+
Authentication: Connected
|
|
719
|
+
Account: ${email}
|
|
720
|
+
Credits: ${credits}
|
|
721
|
+
Messages: ${messages}
|
|
722
|
+
Tier: ${tier}
|
|
723
|
+
${perspectivesSection}
|
|
680
724
|
${cliSection}
|
|
681
725
|
|
|
682
|
-
|
|
683
|
-
• GPT-5.2 (OpenAI)
|
|
684
|
-
• Claude Opus 4.5 (Anthropic)
|
|
685
|
-
• Gemini 3 Pro (Google)
|
|
686
|
-
• Grok 4.1 (xAI)
|
|
687
|
-
|
|
688
|
-
🛠️ Tools:
|
|
689
|
-
• get_perspectives - Query multiple AI models
|
|
690
|
-
• get_cli_status - Check local CLI tools
|
|
691
|
-
• send_cli_prompt - Use local CLIs
|
|
692
|
-
|
|
693
|
-
📊 Dashboard: https://polydev.ai/dashboard`
|
|
726
|
+
Configure: https://polydev.ai/dashboard/models`
|
|
694
727
|
}]
|
|
695
728
|
}
|
|
696
729
|
};
|
|
@@ -701,11 +734,10 @@ ${cliSection}
|
|
|
701
734
|
result: {
|
|
702
735
|
content: [{
|
|
703
736
|
type: 'text',
|
|
704
|
-
text:
|
|
705
|
-
|
|
706
|
-
╰─────────────────────────────────────────╯
|
|
737
|
+
text: `POLYDEV STATUS
|
|
738
|
+
==============
|
|
707
739
|
|
|
708
|
-
|
|
740
|
+
Token invalid or expired.
|
|
709
741
|
|
|
710
742
|
Please re-login:
|
|
711
743
|
1. Use the "login" tool
|
|
@@ -722,11 +754,10 @@ Please re-login:
|
|
|
722
754
|
result: {
|
|
723
755
|
content: [{
|
|
724
756
|
type: 'text',
|
|
725
|
-
text:
|
|
726
|
-
|
|
727
|
-
╰─────────────────────────────────────────╯
|
|
757
|
+
text: `POLYDEV STATUS
|
|
758
|
+
==============
|
|
728
759
|
|
|
729
|
-
|
|
760
|
+
Could not verify status (offline?)
|
|
730
761
|
|
|
731
762
|
Error: ${error.message}`
|
|
732
763
|
}],
|
|
@@ -2189,31 +2220,15 @@ Error: ${error.message}`
|
|
|
2189
2220
|
fs.mkdirSync(polydevevDir, { recursive: true });
|
|
2190
2221
|
}
|
|
2191
2222
|
|
|
2192
|
-
// Load existing usage data
|
|
2193
|
-
let usageData = [];
|
|
2194
|
-
if (fs.existsSync(usageFile)) {
|
|
2195
|
-
try {
|
|
2196
|
-
usageData = JSON.parse(fs.readFileSync(usageFile, 'utf8'));
|
|
2197
|
-
} catch (parseError) {
|
|
2198
|
-
console.error('[Stdio Wrapper] Failed to parse existing usage file, starting fresh:', parseError);
|
|
2199
|
-
usageData = [];
|
|
2200
|
-
}
|
|
2201
|
-
}
|
|
2202
|
-
|
|
2203
2223
|
// Add new usage record
|
|
2204
|
-
usageData
|
|
2224
|
+
const usageData = {
|
|
2205
2225
|
timestamp: new Date().toISOString(),
|
|
2206
2226
|
provider: providerId,
|
|
2207
2227
|
prompt_length: prompt.length,
|
|
2208
2228
|
success: response.success,
|
|
2209
2229
|
latency_ms: response.latency_ms || response.latencyMs || 0,
|
|
2210
2230
|
tokens_used: response.tokens_used || response.tokensUsed || 0
|
|
2211
|
-
}
|
|
2212
|
-
|
|
2213
|
-
// Keep only last 1000 records
|
|
2214
|
-
if (usageData.length > 1000) {
|
|
2215
|
-
usageData = usageData.slice(-1000);
|
|
2216
|
-
}
|
|
2231
|
+
};
|
|
2217
2232
|
|
|
2218
2233
|
fs.writeFileSync(usageFile, JSON.stringify(usageData, null, 2));
|
|
2219
2234
|
console.error(`[Stdio Wrapper] Usage recorded locally`);
|
|
@@ -2320,7 +2335,7 @@ Error: ${error.message}`
|
|
|
2320
2335
|
? result.providerOrder
|
|
2321
2336
|
: ['claude_code', 'codex_cli', 'gemini_cli'];
|
|
2322
2337
|
|
|
2323
|
-
// 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
|
|
2324
2339
|
// Format: [{ provider: 'openai', model: 'gpt-52-codex', cliId: 'codex_cli' }, { provider: 'x-ai', model: 'grok-4', cliId: null }, ...]
|
|
2325
2340
|
this.allProviders = result.allProviders || [];
|
|
2326
2341
|
|