/** Preserve indentation and blank lines; normalize only platform line endings. */ export function normalizePaste(text: string): string { return text.replace(/\r\n?/g, '\n'); } /** Fallback for terminals without explicit paste events. Speed alone is not evidence. */ export function looksLikePaste(input: string): boolean { return Array.from(input).length > 20 || (input.length > 1 && /[\r\n]/.test(input)); }