/** * Context passed to hook scripts */ export interface HookContext { issueNumber?: number; prNumber?: number; deploymentUrl?: string; prTitle?: string; prUrl?: string; targetBranch?: string; issueName?: string; planPath?: string; branch?: string; [key: string]: unknown; } /** * Result from hook execution */ export interface HookResult { success: boolean; hookPath: string; error?: string; } /** * Result from a hook run via executeCapture(): unlike HookResult, this * carries the hook's stdout so the caller can parse a return value, and * distinguishes a nonzero exit (exitCode set) from a spawn-level failure * (error set, exitCode null). */ export interface HookCaptureResult { success: boolean; stdout: string; exitCode: number | null; error?: string; } /** * Executes project-specific hooks with proper error handling * Hooks are optional and failures don't block main operations */ export declare class HookExecutor { private projectRoot; constructor(projectRoot?: string); /** * Check if a hook file uses Playwright and ensure it's available * @param hookPath - Path to the hook script (relative to project root) * @returns Promise - true if Playwright is not needed or is available, false otherwise */ private checkPlaywrightForHook; /** * Execute a hook script if it exists (synchronous/blocking) * @param hookPath - Path to the hook script (relative to project root) * @param context - Context object passed to the hook as JSON * @returns Promise - true if hook executed successfully, false otherwise */ execute(hookPath: string, context?: HookContext): Promise; /** * Execute a hook script and capture its stdout, for hooks whose return * value the caller needs (e.g. beforeLaunch's {"envVars": {...}} contract). * Stderr streams live to the terminal (like executeBackground); stdout is * buffered and returned instead of printed. Unlike execute(), a nonzero * exit is reported via `success: false` rather than swallowed — callers * that need hooks to be optional should keep using execute() instead. */ executeCapture(hookPath: string, context?: HookContext): Promise; /** * Execute hook in background (non-blocking) * Used for long-running operations like browser automation * @param hookPath - Path to the hook script (relative to project root) * @param context - Context object passed to the hook as JSON */ executeBackground(hookPath: string, context?: HookContext): Promise; /** * Kill any running background hook processes * Can be called manually to clean up orphaned processes */ static cleanup(): void; /** * Check if a hook exists * @param hookPath - Path to the hook script (relative to project root) * @returns boolean - true if hook file exists */ exists(hookPath: string): boolean; /** * Get the full path of a hook * @param hookPath - Path to the hook script (relative to project root) * @returns string - Full absolute path to the hook */ getFullPath(hookPath: string): string; } //# sourceMappingURL=HookExecutor.d.ts.map