polydev-ai 1.10.2 → 1.10.3

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/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-perspectives",
3
- "version": "1.10.1",
3
+ "version": "1.10.2",
4
4
  "description": "Multi-model AI perspectives - query GPT 5.2, Claude Opus 4.5, Gemini 3, and Grok 4.1 simultaneously. Get diverse perspectives when stuck or need enhanced reasoning. Achieved 74.6% on SWE-bench Verified.",
5
5
  "author": "Polydev AI",
6
6
  "license": "MIT",
package/mcp/server.js CHANGED
@@ -1876,7 +1876,7 @@ class MCPServer {
1876
1876
  body: JSON.stringify({
1877
1877
  prompt: args.prompt,
1878
1878
  user_token: userToken,
1879
- provider: args.provider || 'openai',
1879
+ provider: args.provider || 'gemini',
1880
1880
  model: args.model,
1881
1881
  size: args.size || '1024x1024',
1882
1882
  quality: args.quality || 'auto'
@@ -1974,8 +1974,8 @@ class MCPServer {
1974
1974
  formatImageResponse(result) {
1975
1975
  let formatted = `# Image Generated\n\n`;
1976
1976
 
1977
- formatted += `**Provider**: ${result.provider || 'openai'}\n`;
1978
- formatted += `**Model**: ${result.model || 'gpt-image-1'}\n`;
1977
+ formatted += `**Provider**: ${result.provider || 'gemini'}\n`;
1978
+ formatted += `**Model**: ${result.model || 'gemini-3.1-flash-image-preview'}\n`;
1979
1979
 
1980
1980
  if (result.size) {
1981
1981
  formatted += `**Size**: ${result.size}\n`;
@@ -1831,7 +1831,7 @@ To re-login: /polydev:login`
1831
1831
  body: JSON.stringify({
1832
1832
  prompt: args.prompt,
1833
1833
  user_token: userToken,
1834
- provider: args.provider || 'openai',
1834
+ provider: args.provider || 'gemini',
1835
1835
  model: args.model,
1836
1836
  size: args.size || '1024x1024',
1837
1837
  quality: args.quality || 'auto'
@@ -1868,8 +1868,8 @@ To re-login: /polydev:login`
1868
1868
 
1869
1869
  // Format response
1870
1870
  let formatted = '# Image Generated\n\n';
1871
- formatted += `**Provider**: ${result.provider || 'openai'}\n`;
1872
- formatted += `**Model**: ${result.model || 'gpt-image-1.5'}\n`;
1871
+ formatted += `**Provider**: ${result.provider || 'gemini'}\n`;
1872
+ formatted += `**Model**: ${result.model || 'gemini-3.1-flash-image-preview'}\n`;
1873
1873
  if (result.size) formatted += `**Size**: ${result.size}\n`;
1874
1874
  if (result.revised_prompt) formatted += `**Revised prompt**: ${result.revised_prompt}\n`;
1875
1875
  if (result.text_response) formatted += `**Description**: ${result.text_response}\n`;
@@ -2416,34 +2416,36 @@ To re-login: /polydev:login`
2416
2416
  console.error(`[Stdio Wrapper] Perspectives breakdown: ${successfulLocalCount} successful CLI, ${failedCliCount} failed CLI, ${apiOnlyCount} API-only, need ${remainingPerspectives} more from remote (target: ${maxPerspectives})`);
2417
2417
 
2418
2418
  // Get remote perspectives for API-only providers and failed CLIs
2419
+ // ALWAYS call the server when CLIs succeeded, even if remainingPerspectives=0.
2420
+ // The server has the authoritative perspectives_per_message from the database.
2421
+ // If fetchUserModelPreferences failed (e.g., timeout), maxPerspectives defaults to 2,
2422
+ // which can cause remainingPerspectives=0 with 2+ CLIs. The server will correct this
2423
+ // using the user's actual DB setting.
2419
2424
  let perspectivesResult;
2420
- if (remainingPerspectives > 0) {
2421
- this.sendProgressNotification(progressToken, 65, 100, `Fetching ${remainingPerspectives} more perspectives from API...`);
2422
- console.error(`[Stdio Wrapper] Calling remote API for ${remainingPerspectives} more perspectives (have ${successfulLocalCount}/${maxPerspectives})`);
2423
-
2425
+ if (remainingPerspectives > 0 || successfulLocalCount > 0) {
2426
+ const fetchCount = Math.max(remainingPerspectives, 0);
2427
+ this.sendProgressNotification(progressToken, 65, 100, fetchCount > 0
2428
+ ? `Fetching ${fetchCount} more perspectives from API...`
2429
+ : 'Checking for supplemental credits perspectives...');
2430
+ console.error(`[Stdio Wrapper] Calling remote API for ${fetchCount} more perspectives (have ${successfulLocalCount}/${maxPerspectives})`);
2431
+
2424
2432
  // Pass API-only provider info to help remote API choose correct models
2425
2433
  const apiProvidersInfo = (this._apiOnlyProviders || []).map(p => ({
2426
2434
  provider: p.provider,
2427
2435
  model: p.model
2428
2436
  }));
2429
-
2437
+
2430
2438
  // Note: Remote API will handle logging of CLI + API results together
2431
2439
  // We do NOT call reportCliResultsToServer() here to avoid duplicate logs
2432
- perspectivesResult = await this.callPerspectivesForCli(args, localResults, remainingPerspectives, apiProvidersInfo);
2440
+ perspectivesResult = await this.callPerspectivesForCli(args, localResults, fetchCount, apiProvidersInfo);
2433
2441
  } else {
2434
- console.error(`[Stdio Wrapper] Already have ${successfulLocalCount} perspectives (max: ${maxPerspectives})`);
2435
-
2436
- // ONLY report CLI results when NOT calling remote API
2437
- // (When we call remote API, it handles logging CLI + API results together)
2438
- this.reportCliResultsToServer(prompt, localResults, args).catch(err => {
2439
- console.error('[Stdio Wrapper] CLI results reporting failed (non-critical):', err.message);
2440
- });
2441
-
2442
+ console.error(`[Stdio Wrapper] No CLIs and no remaining perspectives skipping remote call`);
2443
+
2442
2444
  perspectivesResult = {
2443
2445
  success: true,
2444
2446
  content: '',
2445
2447
  skipped: true,
2446
- reason: `Already have ${successfulLocalCount} perspectives (max: ${maxPerspectives})`,
2448
+ reason: `No CLIs available and no remaining perspectives needed`,
2447
2449
  timestamp: new Date().toISOString()
2448
2450
  };
2449
2451
  }
@@ -2726,16 +2728,12 @@ To re-login: /polydev:login`
2726
2728
  })
2727
2729
  .filter(Boolean);
2728
2730
 
2729
- // If we don't need any perspectives, skip remote call
2731
+ // NOTE: We no longer early-return when maxPerspectives=0.
2732
+ // The server has the authoritative perspectives_per_message from the DB.
2733
+ // When maxPerspectives=0, we send max_perspectives=0 (or omit it) and let
2734
+ // the server compute the correct value from user settings minus CLI count.
2730
2735
  if (maxPerspectives <= 0) {
2731
- console.error(`[Stdio Wrapper] Max perspectives is 0, skipping remote perspectives`);
2732
- return {
2733
- success: true,
2734
- content: '',
2735
- skipped: true,
2736
- reason: 'No perspectives needed',
2737
- timestamp: new Date().toISOString()
2738
- };
2736
+ console.error(`[Stdio Wrapper] Client-side maxPerspectives is ${maxPerspectives}, but still calling server — server has authoritative DB setting`);
2739
2737
  }
2740
2738
 
2741
2739
  // Build list of specific providers to request (from API-only providers + failed CLI fallbacks)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.10.2",
3
+ "version": "1.10.3",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },
@@ -87,6 +87,7 @@
87
87
  "react": "^18.3.1",
88
88
  "react-dom": "^18.3.1",
89
89
  "resend": "^6.0.2",
90
+ "sharp": "^0.34.5",
90
91
  "sonner": "^2.0.7",
91
92
  "stripe": "^20.3.0",
92
93
  "tailwind-merge": "^3.3.1",