/** * Terminal output utilities for processing PTY output. * * Provides functions for stripping ANSI escape codes and deduplicating * chat responses from orchestrator terminal output. * * @module terminal-output-utils */ /** * Strip ANSI escape codes from PTY output for reliable pattern matching. * * Delegates to the regex-free state-machine implementation in terminal-string-ops. * Handles color codes, cursor movements, OSC sequences, and other control * characters. Cursor forward movements are replaced with spaces to preserve * word boundaries in rendered output. * * @param content - Raw PTY output containing ANSI codes * @returns Clean text with ANSI codes removed */ import { stripAnsiCodes } from './terminal-string-ops.js'; export { stripAnsiCodes }; /** * Clean raw PTY/terminal output for sending as a Google Chat reply. * * Strips ANSI escape codes, TUI spinner/progress characters, and * status lines. Content is expected to already have NOTIFY blocks * extracted by upstream parsing (parseNotifyContent / terminal gateway). * * @param raw - Response text (may contain terminal artifacts) * @returns Cleaned text suitable for Google Chat */ export declare function cleanGoogleChatResponse(raw: string): string; /** * Generate a hash key for a chat response to detect duplicates. * * Normalizes whitespace and truncates to create a consistent key * for the same logical response content. * * @param conversationId - The conversation this response belongs to * @param content - The response content to hash * @returns A string key for deduplication */ export declare function generateResponseHash(conversationId: string, content: string): string; /** * Manages a set of recent response hashes for deduplication. * Uses a circular eviction strategy to bound memory usage. */ export declare class ResponseDeduplicator { private recentHashes; private readonly maxSize; /** * @param maxSize - Maximum number of hashes to track before evicting oldest */ constructor(maxSize?: number); /** * Check if a response is a duplicate and track it if not. * * @param hash - The response hash to check * @returns true if the response is a duplicate, false if it's new */ isDuplicate(hash: string): boolean; /** Clear all tracked hashes */ clear(): void; /** Current number of tracked hashes */ get size(): number; } //# sourceMappingURL=terminal-output.utils.d.ts.map