// tools/create-spec/privacy-spec-adapter.ts — Privacy section for create_spec (SPEC-030)
// Detects PII in spec content and generates a "Privacidad y Datos" section.
import { detectPIIInSpec, detectLegalFramework, generateRetentionPolicy, generatePrivacySection, } from '../../engine/pii-detector.js';
/**
 * Generates a privacy section for the HU.md if the spec involves PII.
 * Returns empty array when no PII is detected.
 */
export function buildPrivacyHuSection(spec, description, knowledge) {
    const criteria = `${spec.title} ${description}`;
    const result = detectPIIInSpec(spec.title, description, criteria);
    if (!result.hasPII) {
        return [];
    }
    const framework = detectLegalFramework({
        projectPath: knowledge?.projectPath ?? '',
        language: knowledge?.language,
        existingText: description,
    });
    const retentionPolicy = generateRetentionPolicy(result.fields, framework);
    return generatePrivacySection(result, framework, retentionPolicy);
}
//# sourceMappingURL=privacy-spec-adapter.js.map