/** * Next Actions Helper Library * Provides reusable nextActions generators for commands * @requirement REQ-MDC-OPTIMIZATION-002 - Auto-call commands via nextActions */ import type { NextAction, ErrorType } from './output-formatter.js'; import type { WorkflowState } from '@shadel/workflow-core'; /** * CommandContext interface * Provides context for generating nextActions * @requirement NEXT-ACTIONS-001 - CommandContext interface */ export interface CommandContext { state?: WorkflowState; taskId?: string; hasActiveTask?: boolean; patternCount?: number; checklistComplete?: boolean; validationPassed?: boolean; reviewComplete?: boolean; testsPassing?: boolean; } /** * State progression conditions */ export interface StateProgressionConditions { checklistComplete?: boolean; testsPassing?: boolean; validationPassed?: boolean; reviewComplete?: boolean; } /** * Command handler function type for registry pattern */ export type CommandHandler = (commandData: any, context: CommandContext) => NextAction[]; /** * Get state progression action * Suggests moving to next state when conditions are met * @requirement NEXT-ACTIONS-003 - State progression validation with TaskStateEngine */ export declare function getStateProgressionAction(currentState: WorkflowState, conditions: StateProgressionConditions, taskContext?: { taskId?: string; hasActiveTask?: boolean; }): NextAction | null; /** * Get checklist-related actions */ export declare function getChecklistActions(state: WorkflowState, completed: number, total: number, nextRequiredItem?: { id: string; title: string; }, taskContext?: { taskId?: string; hasActiveTask?: boolean; }): NextAction[]; /** * Get validation-related actions */ export declare function getValidationActions(validationPassed: boolean, currentState: WorkflowState): NextAction[]; /** * Get pattern-related actions */ export declare function getPatternActions(state: WorkflowState, patternCount: number, hasRelevantPatterns: boolean): NextAction[]; /** * Get task queue actions */ export declare function getTaskQueueActions(hasQueuedTasks: boolean, queuedTaskId?: string, queuedTaskGoal?: string): NextAction[]; /** * Get review-related actions */ export declare function getReviewActions(state: WorkflowState, reviewComplete: boolean, validationPassed: boolean): NextAction[]; /** * Get common discovery actions * Commands that help AI discover what to do next */ export declare function getDiscoveryActions(state: WorkflowState): NextAction[]; /** * Get command-specific next actions based on command output */ export declare function getCommandSpecificActions(command: string, output: any, context: { state?: WorkflowState; taskId?: string; hasActiveTask?: boolean; }): NextAction[]; /** * Get repair actions based on error type and context * Generates context-aware repair instructions for different error scenarios * @requirement REPAIR-INSTRUCTIONS-007 - getRepairActions function */ export declare function getRepairActions(error: Error, context: import('./error-handler.js').ErrorContext, errorType?: ErrorType): NextAction[];