export type SafeContentLimits = { /** Max input characters considered; the rest is dropped and `truncated` set. */ readonly maxInputLength: number; /** Max element nesting tracked by the HTML parser; deeper structure is flattened to text. */ readonly maxDepth: number; /** Max AST nodes emitted per document. */ readonly maxNodes: number; /** Max characters in any single URL. */ readonly maxUrlLength: number; }; export const DEFAULT_LIMITS: SafeContentLimits = { maxInputLength: 20_000, maxDepth: 32, maxNodes: 2_000, maxUrlLength: 2_048, }; export const LINK_PREVIEW_LIMITS = { title: 300, description: 1_000, siteName: 100, } as const;