/**
 * Lifecycle Hooks System
 *
 * Implements pre/post hooks for various operations, similar to Claude Code.
 * Allows users to customize behavior and integrate with their workflows.
 *
 * Hook Types:
 * - pre-edit: Before file is modified
 * - post-edit: After file is modified
 * - pre-bash: Before bash command is executed
 * - post-bash: After bash command completes
 * - pre-commit: Before git commit (lint + test + review)
 * - post-commit: After git commit
 * - pre-prompt: Before LLM prompt is sent
 * - post-response: After LLM response is received
 */
import { EventEmitter } from "events";
/**
 * Hook types
 */
export type HookType = "pre-edit" | "post-edit" | "pre-bash" | "post-bash" | "pre-commit" | "post-commit" | "pre-prompt" | "post-response" | "on-error" | "on-tool-call";
/**
 * Hook execution context
 */
export interface HookContext {
    type: HookType;
    timestamp: Date;
    workingDirectory: string;
    file?: string;
    content?: string;
    command?: string;
    output?: string;
    error?: string;
    toolName?: string;
    toolArgs?: Record<string, unknown>;
    prompt?: string;
    response?: string;
    sessionId?: string;
    model?: string;
}
/**
 * Hook definition
 */
export interface HookDefinition {
    name: string;
    type: HookType;
    command?: string;
    script?: string;
    handler?: (context: HookContext) => Promise<HookResult>;
    enabled: boolean;
    timeout: number;
    failOnError: boolean;
    filePatterns?: string[];
    commandPatterns?: string[];
}
/**
 * Hook execution result
 */
export interface HookResult {
    success: boolean;
    output?: string;
    error?: string;
    duration: number;
    modified?: {
        content?: string;
        command?: string;
        prompt?: string;
    };
    abort?: boolean;
}
/**
 * Hooks configuration
 */
export interface HooksConfig {
    enabled: boolean;
    configPath: string;
    timeout: number;
    hooks: HookDefinition[];
}
/**
 * Default hooks configuration
 */
export declare const DEFAULT_HOOKS_CONFIG: HooksConfig;
/**
 * Built-in hooks
 */
export declare const BUILTIN_HOOKS: HookDefinition[];
/**
 * Lifecycle Hooks Manager
 *
 * Manages hook registration, execution, and configuration.
 */
export declare class HooksManager extends EventEmitter {
    private config;
    private hooks;
    private workingDirectory;
    constructor(workingDirectory: string, config?: Partial<HooksConfig>);
    /**
     * Load hooks from configuration
     */
    private loadHooks;
    /**
     * Check if hook exists
     */
    hasHook(name: string): boolean;
    /**
     * Register a hook
     */
    registerHook(hook: HookDefinition): void;
    /**
     * Unregister a hook
     */
    unregisterHook(name: string): boolean;
    /**
     * Enable/disable a hook
     */
    setHookEnabled(name: string, enabled: boolean): boolean;
    /**
     * Execute a shell command
     */
    private executeCommand;
    /**
     * Check if hook matches context
     */
    private matchesContext;
    /**
     * Execute hooks for a given type
     */
    executeHooks(type: HookType, context: Omit<HookContext, "type" | "timestamp" | "workingDirectory">): Promise<HookResult[]>;
    /**
     * Get all registered hooks
     */
    getHooks(): Map<HookType, HookDefinition[]>;
    /**
     * Get hooks by type
     */
    getHooksByType(type: HookType): HookDefinition[];
    /**
     * Format hooks status for display
     */
    formatStatus(): string;
    /**
     * Save hooks configuration
     */
    saveConfig(): void;
    /**
     * Get configuration
     */
    getConfig(): HooksConfig;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<HooksConfig>): void;
}
/**
 * Get or create hooks manager instance
 */
export declare function getHooksManager(workingDirectory?: string, config?: Partial<HooksConfig>): HooksManager;
/**
 * Initialize hooks manager
 */
export declare function initializeHooks(workingDirectory: string, config?: Partial<HooksConfig>): HooksManager;
