// engine/shared/line-diff.ts — Shared Set-based line diff utility
// Used by: spec-versioning/differ.ts, living-spec/conflict-resolver.ts
/**
 * Compute a simple line-level diff between two content strings.
 * Uses Set-based comparison — order-independent, trims whitespace.
 *
 * Returns arrays of added and removed lines.
 */
export function computeLineDiff(fromContent, toContent) {
    const fromLines = new Set(fromContent
        .split('\n')
        .map((l) => l.trim())
        .filter(Boolean));
    const toLines = new Set(toContent
        .split('\n')
        .map((l) => l.trim())
        .filter(Boolean));
    const added = [];
    const removed = [];
    for (const line of toLines) {
        if (!fromLines.has(line)) {
            added.push(line);
        }
    }
    for (const line of fromLines) {
        if (!toLines.has(line)) {
            removed.push(line);
        }
    }
    return { added, removed };
}
//# sourceMappingURL=line-diff.js.map