/**
 * Debug logging utilities for troubleshooting
 *
 * Provides structured debug logging with different verbosity levels
 * and optional output to file for detailed investigation.
 */
import type { Logger } from '@polka-codes/core';
/**
 * Debug verbosity levels
 */
export declare enum DebugLevel {
    /** No debug output */
    NONE = 0,
    /** Basic debug information */
    BASIC = 1,
    /** Verbose debug information */
    VERBOSE = 2,
    /** Extremely detailed (includes all logs) */
    TRACE = 3
}
/**
 * Debug categories for selective logging
 */
export declare enum DebugCategory {
    WORKFLOW = "workflow",
    STATE = "state",
    EXECUTOR = "executor",
    PLANNER = "planner",
    DISCOVERY = "discovery",
    APPROVAL = "approval",
    SAFETY = "safety",
    SESSION = "session",
    ALL = "*"
}
/**
 * Debug logger configuration
 */
export interface DebugLoggerConfig {
    /** Debug verbosity level */
    level: DebugLevel;
    /** Specific categories to debug (empty = all) */
    categories: DebugCategory[];
    /** Optional file to write debug logs to */
    outputFile?: string;
    /** Include timestamps */
    timestamps: boolean;
    /** Include stack traces */
    stackTraces: boolean;
}
/**
 * Default debug configuration
 */
export declare const DEFAULT_DEBUG_CONFIG: DebugLoggerConfig;
/**
 * Debug logger for structured debugging
 */
export declare class DebugLogger {
    #private;
    constructor(baseLogger: Logger, config?: Partial<DebugLoggerConfig>);
    /**
     * Update debug configuration
     */
    updateConfig(config: Partial<DebugLoggerConfig>): void;
    /**
     * Check if a category is enabled for debugging
     */
    isCategoryEnabled(category: DebugCategory): boolean;
    /**
     * Log at basic level
     */
    basic(category: DebugCategory, message: string, data?: any): void;
    /**
     * Log at verbose level
     */
    verbose(category: DebugCategory, message: string, data?: any): void;
    /**
     * Log at trace level (most detailed)
     */
    trace(category: DebugCategory, message: string, data?: any): void;
    /**
     * Log error with context
     */
    error(category: DebugCategory, message: string, error: unknown): void;
    /**
     * Log function entry
     */
    enter(category: DebugCategory, fnName: string, args?: any): void;
    /**
     * Log function exit
     */
    exit(category: DebugCategory, fnName: string, result?: any): void;
    /**
     * Log state transition
     */
    stateTransition(from: string, to: string, context?: any): void;
    /**
     * Log workflow execution
     */
    workflow(workflow: string, input: any, result?: any): void;
    /**
     * Log task execution
     */
    task(taskId: string, action: string, details?: any): void;
    /**
     * Internal log method
     */
    private log;
    /**
     * Flush debug buffer to file
     */
    flush(): Promise<void>;
    /**
     * Create a child debug logger with a default category
     */
    child(category: DebugCategory): DebugLoggerChild;
}
/**
 * Child debug logger for a specific category
 */
export declare class DebugLoggerChild {
    #private;
    constructor(debugLogger: DebugLogger, category: DebugCategory);
    basic(message: string, data?: any): void;
    verbose(message: string, data?: any): void;
    trace(message: string, data?: any): void;
    error(message: string, error: unknown): void;
    enter(fnName: string, args?: any): void;
    exit(fnName: string, result?: any): void;
}
/**
 * Create a debug logger from environment variable
 *
 * Usage: DEBUG=1,2,3,4 or DEBUG_LEVEL=1 DEBUG_CATEGORIES=workflow,executor
 *
 * Environment variables:
 * - DEBUG: Enable debug logging (1, true, yes, verbose, or *) -> level 1
 * - DEBUG_LEVEL: Set specific level (0-4)
 * - DEBUG_CATEGORIES: Comma-separated categories (e.g., workflow,executor)
 */
export declare function createDebugLoggerFromEnv(baseLogger: Logger, stateDir: string): DebugLogger;
//# sourceMappingURL=debug-logger.d.ts.map