// storage/compliance-gate-config-store.ts — Compliance gate config persistence (SPEC-447)
import { readFile, writeFile, mkdir } from 'node:fs/promises';
import { join, dirname } from 'node:path';
import { safeJsonParse } from './base-store.js';
function complianceGateConfigPath(projectId) {
    return join('data', 'projects', projectId, 'compliance-gate-config.json');
}
export async function getComplianceGateConfig(projectId) {
    try {
        const raw = await readFile(complianceGateConfigPath(projectId), 'utf-8');
        return safeJsonParse(raw, null);
    }
    catch {
        return null;
    }
}
export async function saveComplianceGateConfig(projectId, config) {
    const filePath = complianceGateConfigPath(projectId);
    await mkdir(dirname(filePath), { recursive: true });
    await writeFile(filePath, JSON.stringify(config, null, 2), 'utf-8');
}
//# sourceMappingURL=compliance-gate-config-store.js.map