UNPKG

terminal-chat-ui

Version:

Shared UI components for terminal-based chat interfaces using Theater actors

38 lines (37 loc) 1 kB
/** * Message formatting utilities */ import type { Message, UIVariant } from '../types/common.js'; /** * Get default message prefixes based on UI variant */ export declare function getMessagePrefixes(variant?: UIVariant): { user: string; assistant: string; system: string; tool: string; }; /** * Get content color for message role */ export declare function getMessageColor(role: Message['role'], variant?: UIVariant): string; /** * Format message content for display */ export declare function formatMessageContent(content: string, maxLineLength?: number): string; /** * Extract tool information from message content */ export declare function extractToolInfo(content: string): { toolName?: string; toolArgs?: string[]; }; /** * Filter messages based on criteria */ export declare function filterMessages(messages: Message[], criteria: { role?: Message['role']; status?: Message['status']; hideEmpty?: boolean; hideSystem?: boolean; }): Message[];