UNPKG

deepsource-mcp-server

Version:
138 lines (137 loc) 3.76 kB
/** * @fileoverview Default configuration values for the DeepSource MCP server * * This module centralizes all default configuration values, providing * a single source of truth for server settings and constants. * * @packageDocumentation */ /** * Server configuration interface */ export interface ServerConfig { /** Server name */ name: string; /** Server version */ version: string; /** Whether to auto-register DeepSource tools */ autoRegisterTools: boolean; /** Whether to start the server immediately */ autoStart: boolean; /** Log level for the server */ logLevel: 'DEBUG' | 'INFO' | 'WARN' | 'ERROR'; /** Path to log file (optional) */ logFile?: string; } /** * Default server configuration */ export declare const DEFAULT_SERVER_CONFIG: ServerConfig; /** * API configuration interface */ export interface ApiConfig { /** DeepSource API base URL */ baseUrl: string; /** Request timeout in milliseconds */ timeout: number; /** Maximum number of retries for failed requests */ maxRetries: number; /** Base delay for retry backoff in milliseconds */ retryBaseDelay: number; } /** * Default API configuration */ export declare const DEFAULT_API_CONFIG: ApiConfig; /** * Tool discovery configuration interface */ export interface DiscoveryConfig { /** Directories to scan for tools */ directories: string[]; /** File patterns to match */ patterns: string[]; /** Enable recursive scanning */ recursive: boolean; /** Tool categories to include */ includeCategories: string[]; /** Tool categories to exclude */ excludeCategories: string[]; /** Tool tags to include */ includeTags: string[]; /** Tool tags to exclude */ excludeTags: string[]; } /** * Default tool discovery configuration */ export declare const DEFAULT_DISCOVERY_CONFIG: DiscoveryConfig; /** * Environment-specific discovery configuration */ export declare const DISCOVERY_CONFIG_BY_ENV: Record<string, Partial<DiscoveryConfig>>; /** * Tool categories enum */ export declare enum ToolCategory { CORE = "core", ANALYTICS = "analytics", SECURITY = "security", COMPLIANCE = "compliance", UTILITIES = "utilities", DEVELOPMENT = "development", EXPERIMENTAL = "experimental" } /** * Tool tags enum */ export declare enum ToolTag { STABLE = "stable", BETA = "beta", ALPHA = "alpha", DEPRECATED = "deprecated", EXPERIMENTAL = "experimental", DEVELOPMENT = "development", TEST = "test" } /** * Get configuration for the current environment * * @param env - Environment name (defaults to NODE_ENV or 'development') * @returns Merged configuration for the environment */ export declare function getEnvironmentConfig(env?: string): { server: ServerConfig; api: ApiConfig; discovery: DiscoveryConfig; }; /** * Validation thresholds for configuration */ export declare const CONFIG_VALIDATION: { /** Minimum timeout in milliseconds */ MIN_TIMEOUT: number; /** Maximum timeout in milliseconds */ MAX_TIMEOUT: number; /** Minimum retry attempts */ MIN_RETRIES: number; /** Maximum retry attempts */ MAX_RETRIES: number; /** Valid log levels */ VALID_LOG_LEVELS: readonly ["DEBUG", "INFO", "WARN", "ERROR"]; }; /** * Validate server configuration * * @param config - Configuration to validate * @throws Error if configuration is invalid */ export declare function validateServerConfig(config: Partial<ServerConfig>): void; /** * Validate API configuration * * @param config - Configuration to validate * @throws Error if configuration is invalid */ export declare function validateApiConfig(config: Partial<ApiConfig>): void;