UNPKG

@bobmatnyc/ai-code-review

Version:

A TypeScript-based tool for automated code reviews using AI models from Google Gemini, Anthropic Claude, and OpenRouter

98 lines (97 loc) 3.13 kB
/** * @fileoverview Configuration manager for centralized configuration access. * * This module provides a comprehensive and type-safe configuration management system, * centralizing all configuration values, eliminating hardcoded values, and providing * consistent access to configuration options throughout the application. */ import { CliOptions } from '../cli/argumentParser'; import { ApplicationConfig, ApiProvider } from '../types/configuration'; /** * Get the application configuration * @param cliOptions CLI options to override environment variables * @returns The application configuration */ export declare function getApplicationConfig(cliOptions?: CliOptions): ApplicationConfig; /** * Reset the configuration (mainly for testing) */ export declare function resetConfig(): void; /** * Get a specific API key * @param provider The API provider * @returns The API key or undefined if not available */ export declare function getApiKey(provider: ApiProvider): string | undefined; /** * Get the API endpoint for a provider * @param provider The API provider * @returns The API endpoint */ export declare function getApiEndpoint(provider: ApiProvider): string; /** * Get the API version for a provider * @param provider The API provider * @returns The API version */ export declare function getApiVersion(provider: ApiProvider): string; /** * Get the rate limit configuration * @returns The rate limit configuration */ export declare function getRateLimitConfig(): { tokensPerSecond: number; maxConcurrentRequests: number; retryDelayMs: number; maxRetries: number; }; /** * Get token configuration for cost estimation * @param provider The API provider * @returns Token configuration */ export declare function getTokenConfig(provider: ApiProvider): { maxTokensPerRequest: number; contextWindowSize: number; costPerInputToken: number; costPerOutputToken: number; }; /** * Get paths configuration * @returns The paths configuration */ export declare function getPathsConfig(): { outputDir: string; promptsDir: string; templatesDir: string; contextPaths?: string[]; }; /** * Checks if the configuration is valid for the selected model * @returns Object containing validation result and error message if applicable */ export declare function validateConfigForSelectedModel(): { valid: boolean; message: string; }; /** * Check if any API key is available * @returns True if at least one API key is available */ export declare function hasAnyApiKey(): boolean; /** * Export a default configuration manager object */ declare const _default: { getApplicationConfig: typeof getApplicationConfig; resetConfig: typeof resetConfig; getApiKey: typeof getApiKey; getApiEndpoint: typeof getApiEndpoint; getApiVersion: typeof getApiVersion; getRateLimitConfig: typeof getRateLimitConfig; getTokenConfig: typeof getTokenConfig; getPathsConfig: typeof getPathsConfig; validateConfigForSelectedModel: typeof validateConfigForSelectedModel; hasAnyApiKey: typeof hasAnyApiKey; }; export default _default;