/**
 * Output formatting utilities for CLI commands
 */
/**
 * Create standardized JSON output for CLI commands
 */
export function createJsonOutput(success, data, error, duration) {
    return {
        success,
        ...(data && { data }),
        ...(error && { error }),
        ...(duration && { duration }),
    };
}
/**
 * Create success JSON output
 */
export function createSuccessOutput(data, duration) {
    return createJsonOutput(true, data, undefined, duration);
}
/**
 * Create error JSON output
 */
export function createErrorOutput(error, duration) {
    return createJsonOutput(false, undefined, error, duration);
}
/**
 * Format bytes to KB with 2 decimal places
 */
export function formatBytes(bytes) {
    return (bytes / 1024).toFixed(2);
}
/**
 * Format file size with appropriate unit
 */
export function formatFileSize(bytes) {
    const units = ['B', 'KB', 'MB', 'GB'];
    let size = bytes;
    let unitIndex = 0;
    while (size >= 1024 && unitIndex < units.length - 1) {
        size /= 1024;
        unitIndex++;
    }
    return `${size.toFixed(2)} ${units[unitIndex]}`;
}
//# sourceMappingURL=output.js.map