// dep-audit-catalog.ts — Build dep-audit tooling lines for suggest_tooling (SPEC-025)
// Integrates with the dep-auditor engine to produce Markdown output.
import { auditDeps, formatDepAuditMarkdown, formatDepAuditAcceptanceCriteria, } from '../../engine/dep-auditor/index.js';
/**
 * Run a full dependency audit for a project and return Markdown lines.
 */
export async function buildDepAuditLines(projectPath) {
    const report = await auditDeps(projectPath);
    const markdown = formatDepAuditMarkdown(report);
    return markdown.split('\n');
}
/**
 * Run a full dependency audit and return both the report and Markdown lines.
 * Used internally to allow single-dep lookup after scanning.
 */
export async function buildDepAuditReport(projectPath) {
    const report = await auditDeps(projectPath);
    const markdown = formatDepAuditMarkdown(report);
    return { report, lines: markdown.split('\n') };
}
/**
 * Find a specific dep entry across all severity buckets.
 */
export function findEntryByName(report, packageName) {
    const allEntries = [...report.critical, ...report.warnings, ...report.clean];
    return allEntries.find((e) => e.name === packageName);
}
/**
 * Build acceptance-criteria lines for a single package pre-check (C5).
 */
export function buildSingleDepAuditLines(report, packageName) {
    const entry = findEntryByName(report, packageName);
    if (!entry) {
        return [
            `## Pre-check: \`${packageName}\``,
            '',
            `_Package \`${packageName}\` was not found in project dependencies._`,
            '',
            '**Note:** This package is not listed in your manifest file.',
            'Add it first, then re-run the audit, or check the package name.',
        ];
    }
    return formatDepAuditAcceptanceCriteria(entry).split('\n');
}
//# sourceMappingURL=dep-audit-catalog.js.map