/** * Element Display Formatter Utility * * Provides consistent formatting for element display output across the codebase. * Extracted from listElements.ts to eliminate duplication between query and legacy paths. * * This utility produces character-for-character identical output to the original * formatting logic to ensure backward compatibility. * * Note: This is separate from ElementFormatter.ts which handles file formatting/cleaning. */ import { ElementType } from '../portfolio/PortfolioManager.js'; import { IElement } from '../types/elements/IElement.js'; /** * Configuration for element display formatting */ export interface ElementDisplayFormatterConfig { /** * The currently active persona ID (filename), used to display active indicator * Only relevant for persona formatting */ activePersonaId?: string | null; } /** * Static utility class for formatting element display output */ export declare class ElementDisplayFormatter { /** * Normalize a string value using Unicode validation * Protects against homograph attacks and other Unicode-based exploits * * @param value The string to normalize * @returns Normalized string, or empty string if value is undefined */ private static normalize; /** * Format a single element for display based on its type * * @param element The element to format * @param type The element type * @param config Optional configuration (e.g., active persona ID) * @returns Formatted string representation of the element */ static formatElement(element: IElement, type: ElementType, config?: ElementDisplayFormatterConfig): string; /** * Format multiple elements for display * * @param elements The elements to format * @param type The element type * @param config Optional configuration (e.g., active persona ID) * @returns Formatted string with all elements separated by double newlines */ static formatElements(elements: IElement[], type: ElementType, config?: ElementDisplayFormatterConfig): string; /** * Format a persona element for display * * @param element The persona element to format * @param activePersonaId The currently active persona ID (filename) * @returns Formatted string representation * * @example * // Returns: * // 🔹 **Creative Writer** (creative-writer) * // A creative writing assistant * // 📁 creative | 🎭 John Doe | 🔖 premium * // Version: 2.0 | Triggers: write, story, creative * * Output format: * 🔹/▫️ **Name** (unique_id) * Description * 📁 category | 🎭 author | 🔖 price * Version: version | Triggers: triggers */ private static formatPersona; /** * Format a skill element for display * * @param element The skill element to format * @returns Formatted string representation * * @example * // Returns: * // 🛠️ Code Review (v3.2.1) - Reviews code for quality * // Complexity: intermediate | Domains: code, quality, review * * Output format: * 🛠️ Name (vVersion) - Description * Complexity: complexity | Domains: domains */ private static formatSkill; /** * Format a template element for display * * @param element The template element to format * @returns Formatted string representation * * @example * // Returns: * // 📄 Meeting Notes (v1.2.0) - Template for meeting notes * // Variables: title, date, attendees * * Output format: * 📄 Name (vVersion) - Description * Variables: variables */ private static formatTemplate; /** * Format an agent element for display * * @param element The agent element to format * @returns Formatted string representation * * @example * // Returns: * // 🤖 Task Manager (v2.1.0) - Manages tasks automatically * // Status: active | Specializations: planning, execution, monitoring * * Output format: * 🤖 Name (vVersion) - Description * Status: status | Specializations: specializations */ private static formatAgent; /** * Format a memory element for display * * @param element The memory element to format * @returns Formatted string representation * * @example * // Returns: * // 🧠 Project Context (v1.1.0) - Context about the current project * // Retention: 90 days | Tags: project, context, important * * Output format: * 🧠 Name (vVersion) - Description * Retention: retentionDays days | Tags: tags */ private static formatMemory; /** * Format an ensemble element for display * * @param element The ensemble element to format * @returns Formatted string representation * * @example * // Returns: * // 🎭 Research Team (v1.0.0) - Coordinated research workflow * // Elements: 3 | Strategy: parallel * * Output format: * 🎭 Name (vVersion) - Description * Elements: elementCount | Strategy: strategy */ private static formatEnsemble; } //# sourceMappingURL=ElementDisplayFormatter.d.ts.map