codeep 1.2.45 → 1.2.47

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 +35 -10
  2. package/package.json +1 -1
@@ -4,7 +4,8 @@ import { randomUUID } from 'crypto';
4
4
  import { StdioTransport } from './transport.js';
5
5
  import { runAgentSession } from './session.js';
6
6
  import { initWorkspace, loadWorkspace, handleCommand } from './commands.js';
7
- import { autoSaveSession, config, getModelsForCurrentProvider } from '../config/index.js';
7
+ import { autoSaveSession, config, setProvider } from '../config/index.js';
8
+ import { PROVIDERS } from '../config/providers.js';
8
9
  import { getCurrentVersion } from '../utils/update.js';
9
10
  // ─── Slash commands advertised to Zed ────────────────────────────────────────
10
11
  const AVAILABLE_COMMANDS = [
@@ -59,15 +60,21 @@ const AGENT_MODES = {
59
60
  };
60
61
  // ─── Config options ───────────────────────────────────────────────────────────
61
62
  function buildConfigOptions() {
62
- const models = getModelsForCurrentProvider();
63
63
  const currentModel = config.get('model') ?? '';
64
- const modelOptions = Object.entries(models).map(([id, label]) => ({
65
- value: id,
66
- name: label,
67
- }));
68
- // Ensure currentValue is always one of the valid options
69
- const currentValue = modelOptions.some(o => o.value === currentModel)
70
- ? currentModel
64
+ // Flatten all providers × models into one list so Zed shows a single dropdown
65
+ const modelOptions = [];
66
+ for (const [providerId, provider] of Object.entries(PROVIDERS)) {
67
+ for (const model of provider.models) {
68
+ modelOptions.push({
69
+ value: `${providerId}/${model.id}`,
70
+ name: `${model.name} - ${model.description} (${provider.name})`,
71
+ });
72
+ }
73
+ }
74
+ const currentProviderId = config.get('provider') ?? '';
75
+ const compositeValue = `${currentProviderId}/${currentModel}`;
76
+ const currentValue = modelOptions.some(o => o.value === compositeValue)
77
+ ? compositeValue
71
78
  : (modelOptions[0]?.value ?? '');
72
79
  return [
73
80
  {
@@ -252,9 +259,27 @@ export function startAcpServer() {
252
259
  return;
253
260
  }
254
261
  if (configId === 'model' && typeof value === 'string') {
255
- config.set('model', value);
262
+ // value is "providerId/modelId" — split and switch both
263
+ const slashIdx = value.indexOf('/');
264
+ if (slashIdx !== -1) {
265
+ const providerId = value.slice(0, slashIdx);
266
+ const modelId = value.slice(slashIdx + 1);
267
+ setProvider(providerId); // sets provider + defaultModel + protocol
268
+ config.set('model', modelId);
269
+ }
270
+ else {
271
+ config.set('model', value);
272
+ }
256
273
  }
257
274
  transport.respond(msg.id, {});
275
+ // Confirm the new value back to Zed so its UI state stays in sync
276
+ transport.notify('session/update', {
277
+ sessionId,
278
+ update: {
279
+ sessionUpdate: 'config_option_update',
280
+ configOptions: buildConfigOptions(),
281
+ },
282
+ });
258
283
  }
259
284
  // ── session/prompt ──────────────────────────────────────────────────────────
260
285
  function handleSessionPrompt(msg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.45",
3
+ "version": "1.2.47",
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",