orquesta-cli 0.2.94 → 0.2.95
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/dist/cli.js
CHANGED
|
@@ -17,6 +17,7 @@ import React from 'react';
|
|
|
17
17
|
import { render } from 'ink';
|
|
18
18
|
import { createRequire } from 'module';
|
|
19
19
|
import { configManager } from './core/config/config-manager.js';
|
|
20
|
+
import { resolveEndpointOverride } from './core/config/endpoint-override.js';
|
|
20
21
|
import { createLLMClient } from './core/llm/llm-client.js';
|
|
21
22
|
import { PlanExecuteApp } from './ui/components/PlanExecuteApp.js';
|
|
22
23
|
import { setAppendedSystemPrompt } from './orchestration/plan-executor.js';
|
|
@@ -155,17 +156,12 @@ program
|
|
|
155
156
|
await configManager.initialize();
|
|
156
157
|
await ensureBatutaFromEnv();
|
|
157
158
|
if (options.endpoint) {
|
|
158
|
-
const wanted = String(options.endpoint).toLowerCase();
|
|
159
159
|
const all = configManager.getAllEndpoints();
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
await configManager.setCurrentEndpoint(ep.id);
|
|
166
|
-
const m = ep.models.find((x) => x.enabled) || ep.models[0];
|
|
167
|
-
if (m)
|
|
168
|
-
await configManager.setCurrentModel(m.id);
|
|
160
|
+
const resolved = resolveEndpointOverride(all, String(options.endpoint));
|
|
161
|
+
if (resolved) {
|
|
162
|
+
await configManager.setCurrentEndpoint(resolved.endpointId);
|
|
163
|
+
if (resolved.modelId)
|
|
164
|
+
await configManager.setCurrentModel(resolved.modelId);
|
|
169
165
|
}
|
|
170
166
|
else {
|
|
171
167
|
logger.warn(`--endpoint "${options.endpoint}" matched no configured endpoint (have: ${all.map(e => e.id).join(', ') || 'none'}); keeping current selection`);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface OverrideEndpoint {
|
|
2
|
+
id: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
provider?: string;
|
|
5
|
+
models?: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export interface ResolvedOverride {
|
|
11
|
+
endpointId: string;
|
|
12
|
+
modelId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function resolveEndpointOverride(endpoints: OverrideEndpoint[], wanted: string): ResolvedOverride | null;
|
|
15
|
+
//# sourceMappingURL=endpoint-override.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function resolveEndpointOverride(endpoints, wanted) {
|
|
2
|
+
const w = String(wanted).toLowerCase();
|
|
3
|
+
const ep = w === 'batuta'
|
|
4
|
+
? endpoints.find((e) => e.id === 'batuta-proxy' || e.provider === 'batuta')
|
|
5
|
+
: endpoints.find((e) => e.id === wanted) ||
|
|
6
|
+
endpoints.find((e) => (e.name || '').toLowerCase() === w);
|
|
7
|
+
if (!ep)
|
|
8
|
+
return null;
|
|
9
|
+
const m = ep.models?.find((x) => x.enabled) || ep.models?.[0];
|
|
10
|
+
return { endpointId: ep.id, modelId: m?.id };
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=endpoint-override.js.map
|