/** * Summary generation utilities for natural language tool outputs * * Provides consistent formatting for human-readable summaries across all tools. * These utilities help maintain a consistent tone, style, and format. * * @module lib/summary-helpers */ /** * Format duration in human-readable form * * @param seconds - Duration in seconds * @returns Human-readable duration string * * @example * formatDuration(30) // "30s" * formatDuration(90) // "1m 30s" * formatDuration(3665) // "1h 1m" */ export declare function formatDuration(seconds: number): string; /** * Format byte size in human-readable form * * @param bytes - Size in bytes * @returns Human-readable size string * * @example * formatSize(1024) // "1KB" * formatSize(1536) // "2KB" * formatSize(1048576) // "1MB" * formatSize(245678234) // "234MB" */ export declare function formatSize(bytes: number): string; /** * Format plurals correctly * * @param count - Number of items * @param singular - Singular form of the word * @param plural - Optional plural form (defaults to singular + 's') * @returns Formatted string with count and properly pluralized word * * @example * pluralize(1, 'file') // "1 file" * pluralize(3, 'file') // "3 files" * pluralize(2, 'vulnerability', 'vulnerabilities') // "2 vulnerabilities" */ export declare function pluralize(count: number, singular: string, plural?: string): string; /** * Build summary with icon based on success status * * @param success - Whether the operation succeeded * @param successMessage - Message to display on success * @param failureMessage - Message to display on failure * @returns Formatted summary with status icon * * @example * buildStatusSummary(true, 'Build completed', 'Build failed') * // "✅ Build completed" * * buildStatusSummary(false, 'Tests passed', 'Tests failed') * // "❌ Tests failed" */ export declare function buildStatusSummary(success: boolean, successMessage: string, failureMessage: string): string; /** * Build multi-part summary with bullet points * * Creates a detailed summary with sections, useful for NATURAL_LANGUAGE format. * * @param heading - Main heading for the summary * @param details - Array of detail lines (will be bulleted) * @param nextSteps - Optional array of next step items (will be arrowed) * @returns Multi-line formatted summary * * @example * buildDetailedSummary( * 'Deployment Complete', * ['3 replicas running', 'Service exposed on port 8080'], * ['Verify health endpoints', 'Monitor logs'] * ) * // Returns: * // "Deployment Complete * // • 3 replicas running * // • Service exposed on port 8080 * // Next steps: * // → Verify health endpoints * // → Monitor logs" */ export declare function buildDetailedSummary(heading: string, details: string[], nextSteps?: string[]): string; /** * Truncate text with ellipsis * * @param text - Text to truncate * @param maxLength - Maximum length including ellipsis * @returns Truncated text * * @example * truncate('This is a long message', 10) // "This is..." * truncate('Short', 10) // "Short" */ export declare function truncate(text: string, maxLength: number): string; /** * Vulnerability summary for formatVulnerabilities */ export interface VulnerabilitySummary { critical: number; high: number; medium: number; low: number; total: number; } /** * Format vulnerability counts in human-readable form * * Focuses on critical, high, and medium vulnerabilities for concise summaries. * * @param vulns - Vulnerability counts by severity * @returns Formatted vulnerability summary * * @example * formatVulnerabilities({ critical: 2, high: 5, medium: 12, low: 34, total: 53 }) * // "53 vulnerabilities (2 critical, 5 high, 12 medium)" * * formatVulnerabilities({ critical: 0, high: 0, medium: 0, low: 5, total: 5 }) * // "No significant vulnerabilities" */ export declare function formatVulnerabilities(vulns: VulnerabilitySummary): string; /** * Format timestamp in human-readable form * * @param timestamp - ISO timestamp string or Date object * @returns Human-readable timestamp * * @example * formatTimestamp('2025-01-15T10:30:00Z') // "2025-01-15 10:30:00" */ export declare function formatTimestamp(timestamp: string | Date): string; /** * Build a concise list summary * * Useful for summarizing arrays with truncation for long lists. * * @param items - Array of items to summarize * @param maxItems - Maximum items to show before truncation (default: 3) * @returns Formatted list summary * * @example * summarizeList(['v1.0.0', 'latest', 'stable']) // "v1.0.0, latest, stable" * summarizeList(['tag1', 'tag2', 'tag3', 'tag4'], 2) // "tag1, tag2, and 2 more" */ export declare function summarizeList(items: string[], maxItems?: number): string; //# sourceMappingURL=summary-helpers.d.ts.map