orquesta-cli 0.1.24 → 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,
|