/** * Debug logging layer identifiers. * Each layer represents a distinct architectural boundary in the application. */ export type DebugLayer = 'ADAPTER' | 'SERVICE' | 'MCP' | 'CLI'; /** * Unified debug logging utility for infrastructure-level logging. * * Provides consistent debug output across all layers (Adapter, Service, MCP, CLI) * with zero overhead when disabled. All output goes to stderr to preserve * stdout for JSON-RPC communication and command output. * * @example * ```typescript * // Enable debug logging * DebugLogger.setEnabled(true); * * // Log at different layers * DebugLogger.log('MCP', 'cuneiform_org_details', 'params', '{ verbose: true }'); * DebugLogger.log('SERVICE', 'OrgInfoService.getOrgIdentity', 'called', ''); * DebugLogger.log('ADAPTER', 'SOQL', 'query', 'SELECT Id FROM Account'); * DebugLogger.logResult('MCP', 'cuneiform_org_details', true, 1234, 4300); * ``` * * Output format: `[DEBUG] [LAYER] context: phase → details` */ export declare class DebugLogger { private static enabled; /** * Enable or disable debug logging globally. * * @param debug - Whether to enable debug logging */ static setEnabled(debug: boolean): void; /** * Check if debug logging is currently enabled. * * @returns True if debug logging is enabled */ static isEnabled(): boolean; /** * Log a debug message with consistent formatting. * * Output format: `[DEBUG] [LAYER] context: phase → details` * * @param layer - The architectural layer (ADAPTER, SERVICE, MCP, CLI) * @param context - The context identifier (tool name, service name, etc.) * @param phase - The phase of operation (params, called, result, etc.) * @param details - Additional details to log */ static log(layer: DebugLayer, context: string, phase: string, details: string): void; /** * Log timing information for an operation. * * @param layer - The architectural layer * @param context - The context identifier * @param durationMs - Duration in milliseconds */ static logTiming(layer: DebugLayer, context: string, durationMs: number): void; /** * Log a result with success status, duration, and optional response size. * * @param layer - The architectural layer * @param context - The context identifier * @param success - Whether the operation succeeded * @param durationMs - Duration in milliseconds * @param sizeBytes - Response size in bytes (omitted when debug is off and serialization is skipped) */ static logResult(layer: DebugLayer, context: string, success: boolean, durationMs: number, sizeBytes?: number): void; /** * Format bytes as human-readable size (B, KB, MB). * * @param bytes - Size in bytes * @returns Human-readable size string */ static formatSize(bytes: number): string; /** * Truncate a string to a maximum length, adding ellipsis if truncated. * * @param str - The string to truncate * @param maxLen - Maximum length (including ellipsis) * @returns Truncated string */ static truncate(str: string, maxLen: number): string; }