// Planu — README and Setup Guide generators
import { buildReadmeIntro, buildTechStackSection, buildGettingStartedSection, buildProjectStructureSection, buildDevelopmentSection, buildPrerequisitesSection, buildInstallationSection, buildEnvVarsSection, buildDatabaseSetupSection, buildRunningSection, buildVerifySection, } from './builders.js';
export function generateReadme(knowledge, _specs, _language) {
    const sections = [];
    const projectName = 
    /* v8 ignore next -- defensive nullish coalescing */
    knowledge.projectPath.split('/').pop() ?? 'Project';
    sections.push({
        title: projectName,
        level: 1,
        content: buildReadmeIntro(knowledge),
    });
    sections.push({
        title: 'Tech Stack',
        level: 2,
        content: buildTechStackSection(knowledge),
    });
    sections.push({
        title: 'Getting Started',
        level: 2,
        content: buildGettingStartedSection(knowledge),
    });
    sections.push({
        title: 'Project Structure',
        level: 2,
        content: buildProjectStructureSection(knowledge),
    });
    sections.push({
        title: 'Development',
        level: 2,
        content: buildDevelopmentSection(knowledge),
    });
    sections.push({
        title: 'Contributing',
        level: 2,
        content: 'Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.',
    });
    const content = sections
        .map((s) => `${'#'.repeat(s.level)} ${s.title}\n\n${s.content}`)
        .join('\n\n');
    return {
        type: 'readme',
        title: `README — ${projectName}`,
        path: 'README.md',
        content,
        audience: 'developer',
        sections,
        diagrams: [],
        relatedSpecs: [],
    };
}
export function generateSetupGuide(knowledge, _language) {
    const sections = [];
    sections.push({
        title: 'Prerequisites',
        level: 2,
        content: buildPrerequisitesSection(knowledge),
    });
    sections.push({
        title: 'Installation',
        level: 2,
        content: buildInstallationSection(knowledge),
    });
    sections.push({
        title: 'Environment Variables',
        level: 2,
        content: buildEnvVarsSection(knowledge),
    });
    sections.push({
        title: 'Database Setup',
        level: 2,
        content: buildDatabaseSetupSection(knowledge),
    });
    sections.push({
        title: 'Running the Project',
        level: 2,
        content: buildRunningSection(knowledge),
    });
    sections.push({
        title: 'Verifying Setup',
        level: 2,
        content: buildVerifySection(knowledge),
    });
    const content = `# Setup Guide\n\n` +
        sections.map((s) => `${'#'.repeat(s.level)} ${s.title}\n\n${s.content}`).join('\n\n');
    return {
        type: 'setup-guide',
        title: 'Setup Guide',
        path: 'docs/setup-guide.md',
        content,
        audience: 'developer',
        sections,
        diagrams: [],
        relatedSpecs: [],
    };
}
//# sourceMappingURL=readme-setup-generators.js.map