import { GATEWAY_MANAGED_KEY_PLACEHOLDER } from '../../core/utils.js'; export interface ModeFileData { mode?: string; claudeMode?: string; backend?: string; claudeModel?: string; activeProfile?: string | null; defaultAgent?: string | null; channelProfiles?: Record; } export interface ApiEnv { ANTHROPIC_API_KEY: string | undefined; ANTHROPIC_BASE_URL: string | undefined; } declare const GATEWAY_ANTHROPIC_URL = "http://127.0.0.1:9880/anthropic"; export declare function gatewayModeUrl(mode: string, metadata?: Record): string; declare function loadModeFile(): ModeFileData; export declare function loadMode(): string; export declare function loadBackend(): string; declare function saveModeFile(mode: string, backend: string, model?: string, profile?: string | null, agent?: string | null): void; export declare function saveMode(mode: string): void; export declare function getClaudeMode(): string; export declare function getActiveBackend(): string; export declare function getClaudeModel(): string; export declare function setActiveBackend(backend: string): void; export declare function setClaudeModel(model: string): void; export declare function getActiveProfile(channel?: string): string | null; /** * Resolve the effective backend for a channel. Channel profile overrides global activeBackend * — without this, conversations on channels using a non-default profile (e.g. profile `execute` * with `backend: pi`) end up storing the wrong backend in the conversation ledger and routing * rollback / session lookup to the wrong adapter. * * Falls back to global activeBackend when the channel has no profile or the profile lookup * fails (e.g. profile was renamed/removed since channelProfiles was last persisted). */ export declare function resolveBackendForChannel(channel?: string): string; export declare function setActiveProfile(profileName: string | null, channel?: string): void; export declare function clearChannelProfile(channel: string): void; export declare function getChannelProfiles(): Record; export declare function getDefaultAgent(): string | null; export declare function setDefaultAgent(name: string | null): void; export declare function switchMode(): { oldMode: string; newMode: string; }; export declare function isApiRateLimitError(errorMessage: string | null | undefined): boolean; export declare function isRetryableResult(result: { rateLimited?: boolean; } | null): boolean; export declare function isRetryableError(error: Error | null | undefined): boolean; export declare function configureEnvForMode(mode: string, metadata?: Record): string | undefined; export declare function setGatewayMode(mode: string): Promise; export declare function resolveAgentModel({ profileName, modelOverride }?: { profileName?: string | null; modelOverride?: string | null; }): string; export declare function detectBillingMode(): string; export { GATEWAY_ANTHROPIC_URL, GATEWAY_MANAGED_KEY_PLACEHOLDER, saveModeFile, loadModeFile, };