/** * Command Execution Strategy Pattern * * Implements different execution strategies for commands: * - Dry-run execution (preview and cache) * - Pipeline execution (default, with cache support) * - Isolated stage execution * - Interactive execution */ import type { CommandDefinition, CommandResult } from '../types/command.types.js'; import type { ExecutionContext } from './execution-context.js'; /** * Register plugin-contributed agent and prompt directories on freshly created loaders. * Must be called after `initializePlugins` has run; uses the module-level plugin list * populated by `di/container.initializePlugins`. */ export interface CommandExecutionStrategy { /** * Check if this strategy can handle the given command and options */ canExecute(command: CommandDefinition, context: ExecutionContext): boolean; /** * Execute the command using this strategy */ execute(command: CommandDefinition, context: ExecutionContext): Promise; } export declare function registerPluginAgentDirs(agentLoader: { registerPluginDir(dir: string): void; }): Promise; export declare function registerPluginDirsOnLoaders(agentLoader: { registerPluginDir(dir: string): void; }, promptLoader: { registerPluginPromptsDir(dir: string): void; }): Promise; /** * Pipeline Execution Strategy * * Executes commands through the full pipeline with all stages. * Supports using cached dry-run results for faster execution. */ export declare class PipelineExecutionStrategy implements CommandExecutionStrategy { constructor(); canExecute(command: CommandDefinition, context: ExecutionContext): boolean; execute(command: CommandDefinition, context: ExecutionContext): Promise; /** * Execute pipeline with cached dry-run analysis */ private executeWithCachedAnalysis; /** * Inject cached analysis outputs into execution context */ private injectCachedAnalysisOutputs; /** * Record precomputed outputs as completed stages */ private recordPrecomputedStages; /** * Get stages that need execution (excluding cached ones) */ private getStagesForExecution; /** * Log cached resource usage statistics */ private logCachedResourceUsage; /** * Execute pipeline stages using cached precomputed data */ private executePipelineStagesWithCache; /** * Execute standard pipeline */ private executePipeline; /** * Execute pipeline stages */ private executePipelineStages; } /** * Isolated Stage Execution Strategy * * Executes only specific stages of a command in isolation */ export declare class IsolatedExecutionStrategy implements CommandExecutionStrategy { canExecute(command: CommandDefinition, context: ExecutionContext): boolean; execute(command: CommandDefinition, context: ExecutionContext): Promise; } /** * Interactive Execution Strategy * * Executes commands with interactive prompts and user input */ export declare class InteractiveExecutionStrategy implements CommandExecutionStrategy { canExecute(_command: CommandDefinition, context: ExecutionContext): boolean; execute(_command: CommandDefinition, context: ExecutionContext): Promise; } /** * Strategy Factory for Command Execution * * Determines the appropriate execution strategy based on command and context. * Strategy order matters - first matching strategy is used: * 1. DryRunExecutionStrategy - handles --dry-run mode * 2. IsolatedExecutionStrategy - handles --isolated mode * 3. InteractiveExecutionStrategy - handles --interactive mode * 4. PipelineExecutionStrategy - default (also checks for cached dry-run results) */ export declare class CommandExecutionStrategyFactory { private strategies; /** * Get the appropriate execution strategy for the given command and context */ getStrategy(command: CommandDefinition, context: ExecutionContext): CommandExecutionStrategy; /** * Register a new execution strategy */ registerStrategy(strategy: CommandExecutionStrategy): void; } //# sourceMappingURL=execution-strategy.d.ts.map