/** * Context Injector for AI Memory * Auto-updates context files after every workflow command * @requirement REQ-V2-010 - Context Injection System */ import type { Task } from '@shadel/workflow-core'; import { Role } from '../roles/role-definitions.js'; import { PatternProvider } from './pattern-provider.js'; /** * Context for injection * @requirement REQ-V2-010 - AI Memory context structure * @requirement REQ-V2-011 - Include active roles */ export interface ContextInjectionContext { task: Task; warnings?: string[]; nextSteps?: string[]; blockers?: string[]; activeRoles?: Role[]; localRules?: any[]; } /** * Context Injector - Auto-updates context files for AI * @requirement REQ-V2-010 - Core value proposition: AI memory */ export declare class ContextInjector { private contextDir; private ruleManager; private patternProvider; private queueManager; /** * Get PatternProvider instance (for sharing with other services) * Phase 2.3: Allow StateChecklistService to access PatternProvider */ getPatternProvider(): PatternProvider; constructor(contextDir?: string); /** * Update all context files after workflow command * @requirement REQ-V2-010 - Auto-update after every command */ updateAfterCommand(command: string, context: ContextInjectionContext): Promise; /** * Generate STATUS.txt - Always current workflow status * @requirement REQ-V2-010 - Rich visual output with borders, emojis * @requirement FREE-TIER-001 - Show task queue information for Cursor */ /** * Validate context for STATUS.txt generation * @throws Error if context is invalid */ private validateContext; /** * Generate patterns section with state-aware display * Shows top 3 patterns by priority (mandatory first, then recommended) */ private generatePatternsSection; private generateStatusFile; /** * Generate NEXT_STEPS.md - Context-aware next actions * @requirement REQ-V2-010 - Actionable guidance for AI * @requirement FREE-TIER-001 - Show task queue overview for Cursor */ private generateNextStepsFile; /** * Generate WARNINGS.md - Active warnings and blockers * @requirement REQ-V2-010 - Warnings/blockers highlighted */ private generateWarningsFile; /** * Calculate next steps based on command and state * @requirement REQ-V2-010 - Context-aware guidance * @requirement BUG-FIX-ROLES-1 - State-aware next steps suggestions */ private calculateNextSteps; /** * Get workflow progress visualization * @requirement REQ-V2-010 - Visual workflow progress */ private getWorkflowProgress; /** * Clear warning file * @requirement REQ-V2-010 - Clean up when no warnings */ clearWarnings(): Promise; /** * Get priority emoji indicator * @requirement FREE-TIER-002 - Priority display */ private getPriorityEmoji; /** * Filter role checklist items by current workflow state * @requirement BUG-FIX-ROLES-2 - State-aware role checklist filtering * @param checklist - Full checklist items from role * @param state - Current workflow state * @returns Filtered checklist items relevant to current state */ private filterChecklistByState; }