orquesta-cli 0.2.86 → 0.2.87

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.
@@ -322,22 +322,23 @@ export class ConfigManager {
322
322
  added++;
323
323
  }
324
324
  }
325
+ const serverDefaultId = orquestaEndpoints.find((e) => e.is_default === true)?.id;
326
+ const serverDefault = serverDefaultId ? config.endpoints.find((e) => e.id === serverDefaultId) : undefined;
327
+ const batuta = config.endpoints.find((e) => e.provider === 'batuta' || e.id === 'batuta-proxy');
325
328
  const currentExists = !!config.currentEndpoint && config.endpoints.some((e) => e.id === config.currentEndpoint);
326
- if (!currentExists && config.endpoints.length > 0) {
327
- const fallback = config.endpoints.find((e) => e.provider === 'batuta' || e.id === 'batuta-proxy') ||
328
- config.endpoints[0];
329
- config.currentEndpoint = fallback.id;
330
- const enabledModel = fallback.models.find((m) => m.enabled) || fallback.models[0];
331
- if (enabledModel)
332
- config.currentModel = enabledModel.id;
329
+ const preferred = serverDefault || batuta || (!currentExists ? config.endpoints[0] : undefined);
330
+ if (preferred) {
331
+ config.currentEndpoint = preferred.id;
332
+ const m = preferred.models.find((x) => x.enabled) || preferred.models[0];
333
+ if (m)
334
+ config.currentModel = m.id;
333
335
  }
334
336
  else if (currentExists) {
335
337
  const ep = config.endpoints.find((e) => e.id === config.currentEndpoint);
336
- const modelExists = ep.models.some((m) => m.id === config.currentModel);
337
- if (!modelExists) {
338
- const enabledModel = ep.models.find((m) => m.enabled) || ep.models[0];
339
- if (enabledModel)
340
- config.currentModel = enabledModel.id;
338
+ if (!ep.models.some((m) => m.id === config.currentModel)) {
339
+ const m = ep.models.find((x) => x.enabled) || ep.models[0];
340
+ if (m)
341
+ config.currentModel = m.id;
341
342
  }
342
343
  }
343
344
  await this.saveConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orquesta-cli",
3
- "version": "0.2.86",
3
+ "version": "0.2.87",
4
4
  "description": "Orquesta CLI - AI-powered coding assistant with team collaboration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",