codeep 1.2.47 → 1.2.48

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.
Files changed (2) hide show
  1. package/dist/acp/server.js +24 -4
  2. package/package.json +1 -1
@@ -13,7 +13,6 @@ const AVAILABLE_COMMANDS = [
13
13
  { name: 'help', description: 'Show available commands' },
14
14
  { name: 'status', description: 'Show current config and session info' },
15
15
  { name: 'version', description: 'Show version and current model' },
16
- { name: 'provider', description: 'List or switch AI provider', input: { hint: '<provider-id>' } },
17
16
  { name: 'model', description: 'List or switch model', input: { hint: '<model-id>' } },
18
17
  { name: 'login', description: 'Set API key for a provider', input: { hint: '<providerId> <apiKey>' } },
19
18
  { name: 'apikey', description: 'Show or set API key for current provider', input: { hint: '<key>' } },
@@ -59,19 +58,40 @@ const AGENT_MODES = {
59
58
  ],
60
59
  };
61
60
  // ─── Config options ───────────────────────────────────────────────────────────
61
+ /** Check if a provider has an API key stored (reads config directly, no async) */
62
+ function providerHasKey(providerId) {
63
+ // Check environment variable first
64
+ const envKey = PROVIDERS[providerId]?.envKey;
65
+ if (envKey && process.env[envKey])
66
+ return true;
67
+ // Check stored providerApiKeys
68
+ const stored = (config.get('providerApiKeys') || []);
69
+ return stored.some(k => k.providerId === providerId && !!k.apiKey);
70
+ }
62
71
  function buildConfigOptions() {
63
72
  const currentModel = config.get('model') ?? '';
64
- // Flatten all providers × models into one list so Zed shows a single dropdown
73
+ const currentProviderId = config.get('provider') ?? '';
74
+ // Only show providers that have an API key configured
65
75
  const modelOptions = [];
66
76
  for (const [providerId, provider] of Object.entries(PROVIDERS)) {
77
+ if (!providerHasKey(providerId))
78
+ continue;
67
79
  for (const model of provider.models) {
68
80
  modelOptions.push({
69
81
  value: `${providerId}/${model.id}`,
70
- name: `${model.name} - ${model.description} (${provider.name})`,
82
+ name: model.name,
71
83
  });
72
84
  }
73
85
  }
74
- const currentProviderId = config.get('provider') ?? '';
86
+ // Always include current provider's models even if key is missing (avoids empty list)
87
+ if (modelOptions.length === 0) {
88
+ const fallback = PROVIDERS[currentProviderId];
89
+ if (fallback) {
90
+ for (const model of fallback.models) {
91
+ modelOptions.push({ value: `${currentProviderId}/${model.id}`, name: model.name });
92
+ }
93
+ }
94
+ }
75
95
  const compositeValue = `${currentProviderId}/${currentModel}`;
76
96
  const currentValue = modelOptions.some(o => o.value === compositeValue)
77
97
  ? compositeValue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.47",
3
+ "version": "1.2.48",
4
4
  "description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",