orquesta-cli 0.1.23 → 0.1.25
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.
|
@@ -5,12 +5,15 @@ import { NetworkError, APIError, TimeoutError, ConnectionError, } from '../../er
|
|
|
5
5
|
import { LLMError, TokenLimitError, RateLimitError, ContextLengthError, } from '../../errors/llm.js';
|
|
6
6
|
import { logger, isLLMLogEnabled } from '../../utils/logger.js';
|
|
7
7
|
import { usageTracker } from '../usage-tracker.js';
|
|
8
|
-
import { getForcedTier } from '../routing-state.js';
|
|
8
|
+
import { getForcedTier, getBatutaSessionId } from '../routing-state.js';
|
|
9
9
|
function buildPerRequestHeaders() {
|
|
10
|
+
const headers = {
|
|
11
|
+
'X-Batuta-Session-ID': getBatutaSessionId(),
|
|
12
|
+
};
|
|
10
13
|
const tier = getForcedTier();
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
+
if (tier)
|
|
15
|
+
headers['X-Batuta-Force-Tier'] = tier;
|
|
16
|
+
return headers;
|
|
14
17
|
}
|
|
15
18
|
export class LLMClient {
|
|
16
19
|
axiosInstance;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type ForcedTier = 'fast' | 'balanced' | 'premium' | null;
|
|
2
2
|
export declare function getForcedTier(): ForcedTier;
|
|
3
3
|
export declare function setForcedTier(tier: ForcedTier): void;
|
|
4
|
+
export declare function getBatutaSessionId(): string;
|
|
5
|
+
export declare function resetBatutaSession(): void;
|
|
4
6
|
//# sourceMappingURL=routing-state.d.ts.map
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { randomUUID } from 'crypto';
|
|
1
2
|
let forcedTier = null;
|
|
3
|
+
let sessionId = randomUUID();
|
|
2
4
|
export function getForcedTier() {
|
|
3
5
|
return forcedTier;
|
|
4
6
|
}
|
|
5
7
|
export function setForcedTier(tier) {
|
|
6
8
|
forcedTier = tier;
|
|
7
9
|
}
|
|
10
|
+
export function getBatutaSessionId() {
|
|
11
|
+
return sessionId;
|
|
12
|
+
}
|
|
13
|
+
export function resetBatutaSession() {
|
|
14
|
+
sessionId = randomUUID();
|
|
15
|
+
}
|
|
8
16
|
//# sourceMappingURL=routing-state.js.map
|
|
@@ -3,7 +3,7 @@ import { usageTracker } from './usage-tracker.js';
|
|
|
3
3
|
import { logger } from '../utils/logger.js';
|
|
4
4
|
import { fullSync } from '../orquesta/config-sync.js';
|
|
5
5
|
import { configManager } from './config/config-manager.js';
|
|
6
|
-
import { getForcedTier, setForcedTier } from './routing-state.js';
|
|
6
|
+
import { getForcedTier, setForcedTier, resetBatutaSession } from './routing-state.js';
|
|
7
7
|
export async function executeSlashCommand(command, context) {
|
|
8
8
|
const trimmedCommand = command.trim();
|
|
9
9
|
logger.enter('executeSlashCommand', { command: trimmedCommand });
|
|
@@ -17,6 +17,7 @@ export async function executeSlashCommand(command, context) {
|
|
|
17
17
|
logger.flow('Clear command - resetting messages and todos');
|
|
18
18
|
context.setMessages([]);
|
|
19
19
|
context.setTodos([]);
|
|
20
|
+
resetBatutaSession();
|
|
20
21
|
logger.exit('executeSlashCommand', { handled: true, command: 'clear' });
|
|
21
22
|
return {
|
|
22
23
|
handled: true,
|
|
@@ -83,7 +83,6 @@ export async function syncOrquestaConfigs() {
|
|
|
83
83
|
const endpoints = data.endpoints || [];
|
|
84
84
|
const hasBatuta = endpoints.some((e) => e.provider === 'batuta' || e.id === 'batuta-proxy');
|
|
85
85
|
if (!hasBatuta) {
|
|
86
|
-
const healthy = { enabled: true, healthStatus: 'healthy', lastHealthCheck: new Date() };
|
|
87
86
|
endpoints.push({
|
|
88
87
|
id: 'batuta-proxy',
|
|
89
88
|
name: 'Batuta',
|
|
@@ -91,16 +90,14 @@ export async function syncOrquestaConfigs() {
|
|
|
91
90
|
apiKey: orquestaConfig.token,
|
|
92
91
|
provider: 'batuta',
|
|
93
92
|
models: [
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
{ id: 'gemini-2.0-pro', name: 'Gemini 2.0 Pro', maxTokens: 1048576, ...healthy },
|
|
103
|
-
{ id: 'grok-4', name: 'Grok 4', maxTokens: 131072, ...healthy },
|
|
93
|
+
{
|
|
94
|
+
id: 'batuta-auto',
|
|
95
|
+
name: 'Batuta Auto (smart routing)',
|
|
96
|
+
maxTokens: 200000,
|
|
97
|
+
enabled: true,
|
|
98
|
+
healthStatus: 'healthy',
|
|
99
|
+
lastHealthCheck: new Date(),
|
|
100
|
+
},
|
|
104
101
|
],
|
|
105
102
|
createdAt: new Date(),
|
|
106
103
|
updatedAt: new Date(),
|