@pikecode/api-key-manager 1.0.31 → 1.0.32

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikecode/api-key-manager",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "description": "A CLI tool for managing and switching multiple API provider configurations",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -21,6 +21,7 @@ class EnvSwitcher extends BaseCommand {
21
21
  this.currentPromptContext = null;
22
22
  this.activeStatusRefresh = null;
23
23
  this.filter = null;
24
+ this.filteredProviders = null; // 保存过滤后的供应商列表用于状态更新
24
25
  }
25
26
 
26
27
  async validateProvider(providerName) {
@@ -348,7 +349,10 @@ class EnvSwitcher extends BaseCommand {
348
349
  } else if (this.filter === 'claude') {
349
350
  providers = providers.filter(p => p.ideName !== 'codex');
350
351
  }
351
-
352
+
353
+ // 保存过滤后的供应商列表用于状态更新
354
+ this.filteredProviders = providers;
355
+
352
356
  const initialStatusMap = this._buildInitialStatusMap(providers);
353
357
  // 显示欢迎界面(立即渲染)
354
358
  this.showWelcomeScreen(providers, initialStatusMap, null);
@@ -429,6 +433,7 @@ class EnvSwitcher extends BaseCommand {
429
433
  this.currentPromptContext = null;
430
434
  }
431
435
  this._cancelStatusRefresh();
436
+ this.filteredProviders = null; // 清除保存的供应商列表
432
437
  }
433
438
  }
434
439
 
@@ -1141,7 +1146,8 @@ class EnvSwitcher extends BaseCommand {
1141
1146
  }
1142
1147
 
1143
1148
  const includeActions = this.currentPromptContext === 'manage';
1144
- const providers = this.configManager.listProviders();
1149
+ // 使用保存的过滤后供应商列表,而不是重新获取全部
1150
+ const providers = this.filteredProviders || this.configManager.listProviders();
1145
1151
  const statusMap = this.latestStatusMap || {};
1146
1152
  const updatedChoicesBase = this.createProviderChoices(providers, includeActions, statusMap);
1147
1153
  const updatedChoices = [...updatedChoicesBase];