/** * Shared color utilities for CLI output * * Supports: * - NO_COLOR environment variable (https://no-color.org/) * - FORCE_COLOR environment variable for override * - TTY detection */ import type { LogLevel } from "@herdctl/core"; /** * Check if colors should be used based on environment and TTY */ export declare function shouldUseColor(): boolean; /** * ANSI color codes */ export declare const colors: { readonly reset: "\u001B[0m"; readonly bold: "\u001B[1m"; readonly dim: "\u001B[2m"; readonly green: "\u001B[32m"; readonly yellow: "\u001B[33m"; readonly red: "\u001B[31m"; readonly cyan: "\u001B[36m"; readonly gray: "\u001B[90m"; readonly blue: "\u001B[34m"; readonly magenta: "\u001B[35m"; }; /** * Color name type */ export type ColorName = keyof typeof colors; /** * Get a colored string, respecting NO_COLOR */ export declare function colorize(text: string, color: ColorName): string; /** * Get color for log level */ export declare function getLevelColor(level: LogLevel): ColorName; /** * Get a brand color escape sequence for a connector log message. * * Checks two sources for connector identification: * 1. The logger prefix (e.g. "web", "web:chat") — used by createLogger instances * 2. The message content (e.g. "[discord:homelab] Connected...") — used by * createAgentLogger adapters which prepend the connector tag to the message * * Returns the ANSI escape to open the color (caller must append reset). * Returns empty string if no brand color applies or colors are disabled. */ export declare function getMessageColor(message: string, prefix?: string): string; /** * Get color for log source (output type) */ export declare function getSourceColor(source: string, data?: Record): ColorName; //# sourceMappingURL=colors.d.ts.map