/** * Console Output Service * * Centralised service for all CLI output that respects MCP mode. * All console output should flow through this service to ensure * consistent behaviour and MCP JSON-RPC compatibility. * * In MCP mode, output is suppressed to avoid interfering with * stdout JSON-RPC communication. All output uses stderr to leave * stdout available for structured data. */ import { type ColorAdapter } from './color-adapter.interface.js'; export interface ConsoleOutputOptions { /** Force mute regardless of MCP mode */ muted?: boolean; } /** * Console Output Service * * Provides consistent console output across the CLI with: * - MCP mode awareness (automatic suppression) * - Styled output methods (success, error, warn, info) * - Box formatting for structured content * - Group support for hierarchical output */ export declare class ConsoleOutput { private readonly boxFormatter; private readonly color; private groupDepth; private muted; constructor(options?: ConsoleOutputOptions); /** * Check if running in MCP mode * MCP mode uses stdout for JSON-RPC, so we should not print to stdout */ private isMcpMode; /** * Check if output should be suppressed */ private shouldSuppress; /** * Get indentation for current group depth */ private getIndent; /** * Write to stderr (used for all output to avoid MCP stdout conflicts) */ private write; /** * Write to stderr without indentation */ private writeRaw; /** * Print a basic message */ print(message: string): void; /** * Print a success message with green checkmark prefix */ success(message: string): void; /** * Print an info message with gray bullet prefix */ info(message: string): void; /** * Print a warning message with yellow prefix */ warn(message: string): void; /** * Print an error message with red prefix */ error(message: string): void; /** * Print dimmed text (for secondary information) */ dim(message: string): void; /** * Print bold text (for emphasis) */ bold(message: string): void; /** * Print a box with optional title */ box(content: string | string[], title?: string): void; /** * Print a header (double-line box style) */ header(title: string): void; /** * Print a divider line */ divider(width?: number): void; /** * Print a blank line */ blank(): void; /** * Start a group with a label */ startGroup(label: string): void; /** * End the current group */ endGroup(): void; /** * Print only if in interactive (non-MCP) mode * Same as print() but more semantically clear */ printIfInteractive(message: string): void; /** * Force output even in MCP mode (for critical messages) * Use sparingly - this writes to stderr which is safe in MCP mode */ always(message: string): void; /** * Print a labeled value */ labelValue(label: string, value: string): void; /** * Print a bulleted list */ list(items: string[], bullet?: string): void; /** * Print a numbered list */ numberedList(items: string[]): void; /** * Mute all output */ mute(): void; /** * Unmute output */ unmute(): void; /** * Check if muted */ isMuted(): boolean; /** * Check if currently in MCP mode */ isInMcpMode(): boolean; /** * Get the color adapter for custom styling */ getColorAdapter(): ColorAdapter; } /** * Get the singleton ConsoleOutput instance */ export declare function getConsoleOutput(): ConsoleOutput; /** * Set a custom ConsoleOutput instance (useful for testing) */ export declare function setConsoleOutput(output: ConsoleOutput): void; //# sourceMappingURL=console-output.d.ts.map