import { isSensitiveDiffPath } from '@canonmsg/backend-contracts'; import type { CanonUnifiedDiff } from './types.js'; export { isSensitiveDiffPath }; /** Total unified hunk text budget across all files (~96 KB). */ export declare const UNIFIED_DIFF_MAX_TOTAL_BYTES: number; /** Per-file unified hunk text budget (~24 KB). */ export declare const UNIFIED_DIFF_MAX_FILE_BYTES: number; /** Maximum number of file entries carried on one diff payload. */ export declare const UNIFIED_DIFF_MAX_FILES = 100; export interface TruncateUnifiedDiffOptions { maxTotalBytes?: number; maxFileBytes?: number; maxFiles?: number; } /** * Enforce the unified-diff payload budget: clips each file's hunk text at a * line boundary to `maxFileBytes`, then drops hunk text entirely once the * running total exceeds `maxTotalBytes`. File entries (path, status, counts) * always survive — only hunk text is clipped or dropped — and every clip sets * the corresponding `truncated` flag. */ export declare function truncateUnifiedDiff(diff: CanonUnifiedDiff, options?: TruncateUnifiedDiffOptions): CanonUnifiedDiff; /** * Suppress and redact sensitive content in a diff before it leaves the host. * Apply BEFORE truncateUnifiedDiff so byte budgets are spent on hunks that * actually ship. */ export declare function sanitizeUnifiedDiffForSharing(diff: CanonUnifiedDiff): CanonUnifiedDiff; /** * Parse an untrusted unified-diff payload (message metadata travels through * Firestore and arbitrary hosts). Invalid file entries are dropped; the result * is re-truncated to the standard budgets so clients never render an * oversized payload. Returns undefined when nothing renderable remains. */ export declare function normalizeCanonUnifiedDiff(value: unknown): CanonUnifiedDiff | undefined;