deepsource-mcp-server
Version:
Model Context Protocol server for DeepSource
76 lines (75 loc) • 2.14 kB
TypeScript
/**
* @fileoverview Feature flags configuration for the DeepSource MCP server
*
* This module provides a centralized system for managing feature flags,
* allowing experimental and optional features to be toggled via environment
* variables without code changes.
*
* @packageDocumentation
*/
/**
* Feature flags interface defining all available toggles
*/
export interface FeatureFlags {
/** Enable automatic tool discovery from filesystem */
toolDiscovery: boolean;
/** Enable enhanced logging with additional debug information */
enhancedLogging: boolean;
/** Enable metrics collection and reporting */
metrics: boolean;
/** Enable caching layer for API responses (future) */
cache: boolean;
}
/**
* Get current feature flags from environment variables
*
* @returns Current feature flag configuration
*
* @example
* ```typescript
* const features = getFeatureFlags();
* if (features.toolDiscovery) {
* await discoverTools();
* }
* ```
*/
export declare function getFeatureFlags(): FeatureFlags;
/**
* Check if a specific feature is enabled
*
* @param feature - The feature to check
* @returns Whether the feature is enabled
*
* @example
* ```typescript
* if (isFeatureEnabled('toolDiscovery')) {
* // Feature-specific code
* }
* ```
*/
export declare function isFeatureEnabled(feature: keyof FeatureFlags): boolean;
/**
* Get all enabled features as an array
*
* @returns Array of enabled feature names
*
* @example
* ```typescript
* const enabled = getEnabledFeatures();
* console.log('Enabled features:', enabled);
* // Output: ['toolDiscovery', 'metrics']
* ```
*/
export declare function getEnabledFeatures(): Array<keyof FeatureFlags>;
/**
* Get feature flags with defaults applied
*
* @returns Feature flags with defaults for unset values
*/
export declare function getFeaturesWithDefaults(): FeatureFlags;
/**
* Log current feature flag configuration (for debugging)
*
* @param logger - Optional logger function (defaults to console.log)
*/
export declare function logFeatureFlags(logger?: (message: string, data?: unknown) => void): void;