polydev-ai 1.8.95 → 1.8.97
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/lib/cliManager.js +14 -0
- package/mcp/stdio-wrapper.js +9 -5
- package/package.json +1 -1
package/lib/cliManager.js
CHANGED
|
@@ -156,6 +156,20 @@ class CLIManager {
|
|
|
156
156
|
return (now - checked) < this.CACHE_TIMEOUT_MS;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/**
|
|
160
|
+
* Get all cached CLI statuses (synchronous)
|
|
161
|
+
* Returns empty object if no statuses cached
|
|
162
|
+
*/
|
|
163
|
+
getCachedStatus() {
|
|
164
|
+
const result = {};
|
|
165
|
+
for (const [providerId, status] of this.statusCache.entries()) {
|
|
166
|
+
if (this.isCacheValid(status)) {
|
|
167
|
+
result[providerId] = status;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return result;
|
|
171
|
+
}
|
|
172
|
+
|
|
159
173
|
async detectCliProvider(provider) {
|
|
160
174
|
try {
|
|
161
175
|
const cliPath = await this.findCliPath(provider.command);
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -644,12 +644,13 @@ After login, restart your IDE.`
|
|
|
644
644
|
'User-Agent': 'polydev-stdio-wrapper/1.0.0'
|
|
645
645
|
}
|
|
646
646
|
}),
|
|
647
|
-
this.cliManager?.
|
|
647
|
+
this.cliManager?.getCliStatus?.() || null
|
|
648
648
|
]);
|
|
649
649
|
|
|
650
650
|
if (accountResponse.ok) {
|
|
651
651
|
const data = await accountResponse.json();
|
|
652
652
|
const credits = data.credits_remaining?.toLocaleString() || 0;
|
|
653
|
+
const messages = data.messages_remaining?.toLocaleString() || 0;
|
|
653
654
|
const tier = data.subscription_tier || 'Free';
|
|
654
655
|
const email = data.email || 'Connected';
|
|
655
656
|
|
|
@@ -657,10 +658,12 @@ After login, restart your IDE.`
|
|
|
657
658
|
let cliSection = '';
|
|
658
659
|
if (cliStatus) {
|
|
659
660
|
const cliLines = [];
|
|
660
|
-
if (cliStatus.claude_code) cliLines.push(` ✓ Claude Code ${cliStatus.claude_code.available ? '(ready)' : '(not found)'}`);
|
|
661
|
-
if (cliStatus.codex_cli) cliLines.push(` ✓ Codex CLI ${cliStatus.codex_cli.available ? '(ready)' : '(not found)'}`);
|
|
662
|
-
if (cliStatus.gemini_cli) cliLines.push(` ✓ Gemini CLI ${cliStatus.gemini_cli.available ? '(ready)' : '(not found)'}`);
|
|
663
|
-
|
|
661
|
+
if (cliStatus.claude_code) cliLines.push(` ${cliStatus.claude_code.available ? '✓' : '✗'} Claude Code ${cliStatus.claude_code.available ? '(ready)' : '(not found)'}`);
|
|
662
|
+
if (cliStatus.codex_cli) cliLines.push(` ${cliStatus.codex_cli.available ? '✓' : '✗'} Codex CLI ${cliStatus.codex_cli.available ? '(ready)' : '(not found)'}`);
|
|
663
|
+
if (cliStatus.gemini_cli) cliLines.push(` ${cliStatus.gemini_cli.available ? '✓' : '✗'} Gemini CLI ${cliStatus.gemini_cli.available ? '(ready)' : '(not found)'}`);
|
|
664
|
+
if (cliLines.length > 0) {
|
|
665
|
+
cliSection = `\n🖥️ Local CLI Tools:\n${cliLines.join('\n')}`;
|
|
666
|
+
}
|
|
664
667
|
}
|
|
665
668
|
|
|
666
669
|
return {
|
|
@@ -676,6 +679,7 @@ After login, restart your IDE.`
|
|
|
676
679
|
🔐 Authentication: ✓ Logged in
|
|
677
680
|
👤 Account: ${email}
|
|
678
681
|
💰 Credits: ${credits}
|
|
682
|
+
📨 Messages: ${messages}
|
|
679
683
|
⭐ Tier: ${tier}
|
|
680
684
|
${cliSection}
|
|
681
685
|
|