/** * QA360 Hooks Runner * Executes declarative hooks with timeouts, failure handling, and security */ import { PackHooks, PackExecution } from '../types/pack-v1.js'; import { SecurityRedactor } from '../security/redactor.js'; export interface HookExecutionResult { success: boolean; duration: number; output: string; error?: string; code?: number; } export interface HookRunnerOptions { workingDir: string; hooks: PackHooks; execution?: PackExecution; redactor?: SecurityRedactor; } export declare class HooksRunner { private workingDir; private hooks; private execution; private redactor; private composeHelper; constructor(options: HookRunnerOptions); /** * Execute hooks for a specific lifecycle phase */ executeHooks(phase: keyof PackHooks): Promise; /** * Execute a single hook action */ private executeHook; /** * Execute a shell command */ private executeCommand; /** * Execute Docker Compose command */ private executeCompose; /** * Execute wait-on for service readiness */ private executeWaitOn; /** * Wait for HTTP endpoint to be ready */ private waitForHttp; /** * Wait for TCP port to be ready */ private waitForTcp; /** * Get human-readable description of hook action */ private getHookDescription; /** * Execute all lifecycle hooks in order */ executeLifecycle(): Promise<{ beforeAll: HookExecutionResult[]; beforeEach: HookExecutionResult[]; afterEach: HookExecutionResult[]; afterAll: HookExecutionResult[]; }>; }