/** * Execution Coordinator - Orchestrates the main command execution flow */ import type { AgentSelectionAnalyticsService, DynamicAgentResolverService } from '../services/index.js'; import type { CommandResult } from '../types/command.types.js'; import { type SessionInfo } from '../executor/execution-context.js'; import { SessionContextManager } from '../session/context.js'; import type { CommandExecutionOptions } from './command-executor.js'; import type { ResolvedCommand } from './command-resolver.js'; export interface ExecutionResult { result: CommandResult; sessionManager: SessionContextManager; startTime: number; } export declare class ExecutionCoordinator { private readonly agentLoader; private analyticsService?; private dynamicAgentResolver?; private readonly LOW_CONFIDENCE_THRESHOLD; private strategyFactory; constructor(dynamicAgentResolver?: DynamicAgentResolverService, analyticsService?: AgentSelectionAnalyticsService); /** * Get feature flags for agent selection */ private getAgentSelectionFeatureFlags; /** * Check if dynamic agent selection should be used */ private shouldUseDynamicSelection; /** * Resolve agent using dynamic selection */ private resolveDynamicAgent; /** * Prompt user to confirm or choose a different agent when confidence is low */ private promptForAgentConfirmation; /** * Handle dynamic agent resolution with fallback */ private handleDynamicAgentResolution; /** * Handle static agent assignment with analytics */ private handleStaticAgentAssignment; /** * Execute command with full orchestration * @param commandName - The name of the command to execute * @param resolvedCommand - The resolved command configuration * @param options - Command execution options * @param sessionManager - The session context manager * @param sessionInfo - Optional session info indicating if this is a resumed session */ executeCommand(commandName: string, resolvedCommand: ResolvedCommand, options: CommandExecutionOptions, sessionManager: SessionContextManager, sessionInfo?: SessionInfo): Promise; /** * Resolve the effective agent for command execution */ private resolveEffectiveAgent; /** * Create task context for dynamic agent resolution */ private createTaskContext; /** * Extract context from a plan file for better agent selection. * Reads the plan file content to extract task description and target files, * which dramatically improves keyword-based domain classification. */ private extractPlanContext; /** * Extract a meaningful description from plan content. * Looks for task title, overview sections, and early content. */ private extractDescriptionFromPlan; /** * Extract file paths mentioned in the plan content. * Looks for common patterns like backtick-quoted paths, list items with file paths. */ private extractFilesFromPlan; /** * Check if a string looks like a source file path */ private looksLikeFilePath; /** * Extract task description from command arguments and context */ private extractTaskDescription; /** * Extract affected files from options and session context */ private extractAffectedFiles; /** * Extract dependencies from session context */ private extractDependencies; /** * Create execution context with all dependencies * Filters session context to only include keys referenced by the pipeline * Initializes with stage outputs from previous commands in the session */ private createExecutionContext; /** * Get initial stage outputs from session for variable resolution * Allows new commands to reference outputs from previous commands in the session */ private getInitialStageOutputsFromSession; /** * Extract $CONTEXT_* variable references from all pipeline stages * Used to filter session context to only what's actually needed */ private extractPipelineContextReferences; /** * Validate file path arguments for commands that require them * Throws ValidationError if required files don't exist */ private validateFilePathArguments; } //# sourceMappingURL=execution-coordinator.d.ts.map