/** * AI Provider Configuration * Configures AI providers (Anthropic, OpenAI, OpenRouter) for the enhancer */ import type { LanguageModel } from 'ai'; /** * Supported AI providers */ export type AIProvider = 'anthropic' | 'openai' | 'openrouter'; /** * Provider configuration result */ export interface ProviderConfig { model: LanguageModel; provider: AIProvider; modelId: string; } /** * Environment variable names for optional services */ export declare const OPTIONAL_SERVICE_ENV_VARS: { readonly tavily: "TAVILY_API_KEY"; readonly context7: "CONTEXT7_API_KEY"; readonly braintrust: "BRAINTRUST_API_KEY"; }; export type OptionalService = keyof typeof OPTIONAL_SERVICE_ENV_VARS; /** * All known API keys that can be loaded from .ralph/.env.local * Combines provider keys and optional service keys. * This is the single source of truth — used by the env loader. */ export declare const KNOWN_API_KEYS: readonly string[]; /** * Model option with label and value */ export interface ModelOption { value: string; label: string; hint?: string; } /** * Available models for each provider */ export declare const AVAILABLE_MODELS: Record; /** * Check if a model id is an Anthropic alias (sonnet/opus/haiku) */ export declare function isAnthropicAlias(modelId: string): boolean; /** * Normalize model ids for a provider (maps legacy aliases where possible) */ export declare function normalizeModelId(provider: AIProvider, modelId: string): string; /** * Check if an API key is available for a provider */ export declare function hasApiKey(provider: AIProvider): boolean; /** * Get a configured AI model for the specified provider */ export declare function getModel(provider?: AIProvider, customModelId?: string): ProviderConfig; /** * Get the first available provider with an API key * Checks in order: anthropic, openai, openrouter */ export declare function getAvailableProvider(): AIProvider | null; /** * Get the environment variable name for a provider's API key */ export declare function getApiKeyEnvVar(provider: AIProvider): string; /** * Check if a model is a reasoning model that doesn't support temperature */ export declare function isReasoningModel(modelId: string): boolean; /** * Check if Tavily API key is available */ export declare function hasTavilyKey(): boolean; /** * Get the Tavily API key */ export declare function getTavilyKey(): string | undefined; /** * Check if Context7 API key is available */ export declare function hasContext7Key(): boolean; /** * Get the Context7 API key */ export declare function getContext7Key(): string | undefined; /** * Get the status of all optional services */ export declare function getOptionalServicesStatus(): Record;