UNPKG

@simonecoelhosfo/optimizely-mcp-server

Version:

Optimizely MCP Server for AI assistants with integrated CLI tools

27 lines 1 kB
import { LocalCountStrategy } from './LocalCountStrategy'; import { getLogger } from '../../logging/Logger'; export class StrategySelector { strategies = []; logger = getLogger(); constructor() { // Register strategies in priority order this.strategies.push(new LocalCountStrategy()); // Add more strategies as implemented } selectStrategy(query, intent) { // Try each strategy in order for (const strategy of this.strategies) { if (strategy.canHandle(query, intent)) { this.logger.info({ strategy: strategy.getName(), queryType: intent?.type, reason: 'Strategy can handle query' }, 'Strategy selected'); return strategy; } } // Fallback - you'll need to implement StandardQueryStrategy throw new Error('No strategy found for query'); } } //# sourceMappingURL=StrategySelector.js.map