UNPKG

woaru

Version:

Universal Project Setup Autopilot - Analyze and automatically configure development tools for ANY programming language

135 lines 3.78 kB
/** * MessageHandler options for sending reports */ export interface MessageHandlerOptions { type?: 'analyze' | 'review' | 'audit' | 'llm-review' | 'all'; latest?: boolean; url?: string; format?: 'markdown' | 'json'; verbose?: boolean; } /** * Report metadata structure */ export interface ReportMetadata { filename: string; filepath: string; timestamp: Date; type: string; size: number; } /** * Webhook payload structure */ export interface WebhookPayload { reportType: string; timestamp: string; filename: string; content: string; metadata: { size: number; originalPath: string; }; } /** * MessageHandler - Core system for reading, filtering, and sending WOARU reports * Handles integration with CLI commands and external services via webhooks */ export declare class MessageHandler { private sentReportsDir; private woaruDir; constructor(); /** * Static method for CLI integration - main entry point * @param options - MessageHandler options from CLI arguments * @returns Promise<void> */ static send(options: MessageHandlerOptions): Promise<void>; /** * Read all reports from .woaru/sent-reports/ directory * @returns Promise<ReportMetadata[]> Array of report metadata */ readReports(): Promise<ReportMetadata[]>; /** * Filter reports based on criteria * @param reports - Array of report metadata * @param criteria - Filter criteria from CLI options * @returns ReportMetadata[] Filtered reports */ filterReports(reports: ReportMetadata[], criteria: MessageHandlerOptions): ReportMetadata[]; /** * Format reports for terminal output * @param reports - Array of report metadata * @param options - Display options */ formatForTerminal(reports: ReportMetadata[], options: MessageHandlerOptions): Promise<void>; /** * Send reports to webhook URL * @param url - Webhook URL * @param reports - Array of report metadata * @param options - Send options */ sendWebhook(url: string, reports: ReportMetadata[], options: MessageHandlerOptions): Promise<void>; /** * Check if filename matches WOARU report pattern * @param filename - Filename to check * @returns boolean */ private isWOARUReportFile; /** * Extract timestamp from filename * @param filename - Report filename * @returns Date | null */ private extractTimestampFromFilename; /** * Extract report type from filename * @param filename - Report filename * @returns string */ private extractReportType; /** * Get icon for report type * @param type - Report type * @returns string */ private getTypeIcon; /** * Format file size for display * @param bytes - File size in bytes * @returns string */ private formatFileSize; /** * Extract content preview from report * @param content - Full report content * @returns string */ private extractContentPreview; /** * Validate webhook URL * @param url - URL to validate * @returns boolean */ private isValidWebhookUrl; /** * Sanitize URL for logging * @param url - URL to sanitize * @returns string */ private sanitizeUrl; /** * Convert markdown content to JSON format * @param content - Markdown content * @returns string */ private convertToJson; /** * Send HTTP POST request to webhook * @param url - Webhook URL * @param payload - Payload to send * @param options - Request options */ private sendHttpPost; } //# sourceMappingURL=MessageHandler.d.ts.map