/** * Log output management utilities. * This file contains MCP response detection and simplification functions. */ /** * Interface for notifications/message parameters. */ interface NotificationMessageParams { level?: string; logger?: string; data?: unknown; } /** * Interface for notifications/message. */ interface NotificationMessage { method: string; params?: NotificationMessageParams; } /** * Check if a message is a notifications/message. * * @param message - The message to check * @returns true if the message is a notifications/message */ export declare function isNotificationMessage(message: unknown): message is NotificationMessage; /** * Log a notifications/message to the application logs. * * @param message - The notification message * @param context - Optional context (server name, session ID, etc.) * @param serverId - Optional server ID for log storage (for frontend display) */ export declare function logNotificationMessage(message: unknown, context: string, serverId?: string): void; /** * Check if JSON string contains data:image/*;base64 data URIs. * These commonly appear in serverInfo.icons[].src and other metadata fields. * * @param data - JSON string to check * @returns true if it contains data:image data URIs */ export declare function hasDataUriImage(data: string): boolean; /** * Simplify data URI images by replacing base64 payload with placeholder. * Matches all data:image/*;base64,... patterns and truncates the payload. * * @param data - JSON string containing data URIs * @returns JSON string with base64 payloads replaced */ export declare function simplifyDataUriImages(data: string): string; /** * Format an MCP message for logging, with simplification for tools/list, * resources/list, capabilities responses, image content, and data URI images. * * @param message - The MCP message object to format * @returns Formatted log message string */ export declare function formatMcpMessageForLogging(message: unknown): string; /** * Check if data contains image content with binary data. * @param data - stdout or response data * @returns true if it contains image content with data field */ export declare function hasImageContent(data: string): boolean; /** * Simplify image content by replacing binary data with placeholder. * @param data - Complete response data * @returns Log information with binary image data replaced */ export declare function simplifyImageContent(data: string): string; /** * Check if data is a tools/list response. * @param data - stdout or response data * @returns true if it's a tools/list response */ export declare function isToolsListResponse(data: string): boolean; /** * Simplify tools/list response log information. * @param data - Complete response data * @returns Simplified log information, or null if cannot be simplified */ export declare function simplifyToolsListResponse(data: string): string | null; export {}; //# sourceMappingURL=log-output.d.ts.map