export function renderJsonReport(input) {
    const visible = input.findings.filter((f) => f.confidence >= input.minConfidence);
    const hidden = input.findings.filter((f) => f.confidence < input.minConfidence);
    const counts = {
        total: input.findings.length,
        shown: visible.length,
        hidden: hidden.length,
        bySeverity: countBy(visible, (f) => f.severity),
    };
    return (JSON.stringify({
        workspace: input.workspaceRoot,
        generated_at: input.generatedAt.toISOString(),
        duration_ms: input.durationMs,
        symbols_scanned: input.symbolCount,
        min_confidence: input.minConfidence,
        counts,
        findings: visible,
    }, null, 2) + '\n');
}
function countBy(items, key) {
    const out = {};
    for (const it of items) {
        const k = key(it);
        out[k] = (out[k] ?? 0) + 1;
    }
    return out;
}
//# sourceMappingURL=json-reporter.js.map