// tools/suggest-tooling/output-formatter-catalog.ts
// Builds the main output lines for suggest_tooling (maturity score, current tooling, gaps,
// recommendations, and recommended skills sections).
/**
 * Builds the full main output lines for suggest_tooling:
 * header, current tooling table, gaps list, recommendations, skills, and closing message.
 *
 * @param result - The structured tooling assessment result
 * @param sectionTitle - Already-resolved i18n title string for the section header
 * @param recommendedSkills - Skills recommended for the detected stack (SPEC-022)
 */
export function buildMainOutputLines(result, sectionTitle, recommendedSkills) {
    const lines = [
        `## ${sectionTitle}`,
        '',
        `**Maturity score:** ${result.maturityScore}%`,
        `**Mode:** ${result.mode}`,
        '',
    ];
    if (result.currentTooling.length > 0) {
        lines.push('### Current Tooling');
        lines.push('');
        lines.push('| Category | Tool | Status |');
        lines.push('|----------|------|--------|');
        for (const tool of result.currentTooling) {
            lines.push(`| ${tool.category} | ${tool.tool} | ${tool.status} |`);
        }
        lines.push('');
    }
    if (result.gaps.length > 0) {
        lines.push('### Gaps');
        lines.push('');
        for (const gap of result.gaps) {
            const icon = gap.importance === 'critical'
                ? '[CRITICAL]'
                : gap.importance === 'recommended'
                    ? '[RECOMMENDED]'
                    : '[NICE-TO-HAVE]';
            lines.push(`- **${icon}** \`${gap.category}\`: ${gap.reason}`);
        }
        lines.push('');
    }
    if (result.recommendations.length > 0) {
        lines.push('### Recommendations');
        lines.push('');
        for (const rec of result.recommendations) {
            lines.push(`#### ${rec.tool} (${rec.category})`);
            lines.push(`Priority: **${rec.priority}** | Effort: ${rec.effort}`);
            lines.push(`Reason: ${rec.reason}`);
            lines.push('');
            for (const step of rec.installSteps) {
                lines.push(`- ${step}`);
            }
            lines.push('');
        }
    }
    // SPEC-022: Recommended Skills section
    if (recommendedSkills.length > 0) {
        lines.push('### Recommended Skills (skills.sh)');
        lines.push('');
        lines.push('These AI agent skills are recommended for your project stack:');
        lines.push('');
        for (const skill of recommendedSkills) {
            lines.push(`#### ${skill.name}`);
            lines.push(skill.description);
            lines.push('');
            lines.push(`- **Install:** \`${skill.installCommand}\``);
            lines.push(`- **Why:** ${skill.justification}`);
            lines.push('');
        }
    }
    lines.push(`_${result.message}_`);
    return lines;
}
//# sourceMappingURL=output-formatter-catalog.js.map