const MAX_CHARS = 4000;
export function synthesizeFindings(originalTechnical, findings) {
    if (findings.length === 0) {
        return originalTechnical;
    }
    const sections = findings.map((f) => [`### ${f.role}`, f.findings.trim()].join('\n'));
    const synthesized = [
        originalTechnical.trimEnd(),
        '',
        '---',
        '',
        '## Expert Analysis (auto-generated by SPEC-697 agent team)',
        ...sections,
    ].join('\n');
    if (synthesized.length <= MAX_CHARS) {
        return synthesized;
    }
    return (synthesized.slice(0, MAX_CHARS) +
        '\n\n> [truncated — see individual agent outputs for full details]');
}
//# sourceMappingURL=findings-synthesizer.js.map