polydev-ai 1.8.42 → 1.8.43
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 -5
- package/mcp/stdio-wrapper.js +23 -1
- package/package.json +2 -2
package/lib/cliManager.js
CHANGED
|
@@ -585,8 +585,9 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
585
585
|
args = ['--model', model, ...args, prompt];
|
|
586
586
|
} else if (providerId === 'gemini_cli') {
|
|
587
587
|
// Gemini CLI: -m for model, -p for prompt (headless mode)
|
|
588
|
-
//
|
|
589
|
-
|
|
588
|
+
// Add prompt prefix to prevent tool planning in non-interactive mode
|
|
589
|
+
const geminiPrompt = `Answer directly without using any tools, file operations, or searches. Do not say "I will search" or "I will look up". Provide your analysis immediately.\n\n${prompt}`;
|
|
590
|
+
args = ['-m', model, '-p', geminiPrompt];
|
|
590
591
|
} else {
|
|
591
592
|
// Default: just append prompt
|
|
592
593
|
args = [...args, prompt];
|
|
@@ -594,8 +595,10 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
594
595
|
} else {
|
|
595
596
|
// No model specified
|
|
596
597
|
if (providerId === 'gemini_cli') {
|
|
597
|
-
// Gemini CLI
|
|
598
|
-
|
|
598
|
+
// Gemini CLI: -p for headless mode
|
|
599
|
+
// Add prompt prefix to prevent tool planning in non-interactive mode
|
|
600
|
+
const geminiPrompt = `Answer directly without using any tools, file operations, or searches. Do not say "I will search" or "I will look up". Provide your analysis immediately.\n\n${prompt}`;
|
|
601
|
+
args = ['-p', geminiPrompt];
|
|
599
602
|
} else {
|
|
600
603
|
args = [...args, prompt];
|
|
601
604
|
}
|
|
@@ -752,7 +755,13 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
|
|
|
752
755
|
const child = spawn(command, args, {
|
|
753
756
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
754
757
|
shell: process.platform === 'win32',
|
|
755
|
-
timeout: timeoutMs
|
|
758
|
+
timeout: timeoutMs,
|
|
759
|
+
// Explicitly pass environment to ensure HOME is available for CLI tools
|
|
760
|
+
// that read config from ~/.config or similar paths (e.g., Gemini CLI)
|
|
761
|
+
env: {
|
|
762
|
+
...process.env,
|
|
763
|
+
HOME: process.env.HOME || os.homedir()
|
|
764
|
+
}
|
|
756
765
|
});
|
|
757
766
|
|
|
758
767
|
if (child.stdin) {
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -265,7 +265,14 @@ class StdioMCPWrapper {
|
|
|
265
265
|
// Smart refresh scheduler (will be started after initialization)
|
|
266
266
|
this.refreshScheduler = null;
|
|
267
267
|
|
|
268
|
-
//
|
|
268
|
+
// CLI detection readiness tracking - requests will wait for this
|
|
269
|
+
// Create the promise NOW in constructor so it exists before any requests arrive
|
|
270
|
+
this._cliDetectionComplete = false;
|
|
271
|
+
this._cliDetectionReady = new Promise((resolve) => {
|
|
272
|
+
this._cliDetectionResolver = resolve;
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
// Cache for user model preferences
|
|
269
276
|
this.userModelPreferences = null;
|
|
270
277
|
this.perspectivesPerMessage = 2; // Default to 2 perspectives
|
|
271
278
|
this.modelPreferencesCacheTime = null;
|
|
@@ -788,6 +795,13 @@ class StdioMCPWrapper {
|
|
|
788
795
|
*/
|
|
789
796
|
async getAllAvailableProviders() {
|
|
790
797
|
try {
|
|
798
|
+
// Wait for initial CLI detection to complete if it's still running
|
|
799
|
+
if (this._cliDetectionReady && !this._cliDetectionComplete) {
|
|
800
|
+
console.error('[Stdio Wrapper] Waiting for initial CLI detection to complete...');
|
|
801
|
+
await this._cliDetectionReady;
|
|
802
|
+
console.error('[Stdio Wrapper] CLI detection ready, proceeding with request');
|
|
803
|
+
}
|
|
804
|
+
|
|
791
805
|
const results = await this.cliManager.forceCliDetection();
|
|
792
806
|
const availableProviders = [];
|
|
793
807
|
const unavailableProviders = [];
|
|
@@ -1645,15 +1659,23 @@ class StdioMCPWrapper {
|
|
|
1645
1659
|
console.error('Stdio MCP Wrapper ready and listening on stdin...');
|
|
1646
1660
|
|
|
1647
1661
|
// Run initial CLI detection in the background so MCP handshake isn't blocked.
|
|
1662
|
+
// The promise was already created in constructor so requests will wait for it
|
|
1648
1663
|
console.error('[Stdio Wrapper] Running initial CLI detection...');
|
|
1664
|
+
|
|
1649
1665
|
this.localForceCliDetection({})
|
|
1650
1666
|
.then(() => {
|
|
1651
1667
|
console.error('[Stdio Wrapper] Initial CLI detection completed');
|
|
1668
|
+
this._cliDetectionComplete = true;
|
|
1652
1669
|
})
|
|
1653
1670
|
.catch((error) => {
|
|
1654
1671
|
console.error('[Stdio Wrapper] Initial CLI detection failed:', error);
|
|
1672
|
+
this._cliDetectionComplete = true; // Mark complete even on failure
|
|
1655
1673
|
})
|
|
1656
1674
|
.finally(() => {
|
|
1675
|
+
// Resolve the readiness promise so waiting requests can proceed
|
|
1676
|
+
if (this._cliDetectionResolver) {
|
|
1677
|
+
this._cliDetectionResolver();
|
|
1678
|
+
}
|
|
1657
1679
|
// Start smart refresh scheduler after initial detection attempt
|
|
1658
1680
|
this.startSmartRefreshScheduler();
|
|
1659
1681
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydev-ai",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.43",
|
|
4
4
|
"mcpName": "io.github.backspacevenkat/perspectives",
|
|
5
5
|
"description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
|
|
6
6
|
"keywords": [
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"lucide-react": "^0.542.0",
|
|
69
69
|
"marked": "^16.2.1",
|
|
70
70
|
"next": "^15.5.7",
|
|
71
|
-
"polydev-ai": "^1.8.
|
|
71
|
+
"polydev-ai": "^1.8.42",
|
|
72
72
|
"posthog-js": "^1.157.2",
|
|
73
73
|
"prismjs": "^1.30.0",
|
|
74
74
|
"react": "^18.3.1",
|