// storage/crash-shield-store.ts — Crash Shield config persistence (SPEC-442)
import { readFile, writeFile, mkdir } from 'node:fs/promises';
import { join, dirname } from 'node:path';
import { safeJsonParse } from './base-store.js';
function crashShieldConfigPath(projectId) {
    return join('data', 'projects', projectId, 'crash-shield-config.json');
}
export async function getCrashShieldConfig(projectId) {
    try {
        const raw = await readFile(crashShieldConfigPath(projectId), 'utf-8');
        return safeJsonParse(raw, null);
    }
    catch {
        return null;
    }
}
export async function saveCrashShieldConfig(config) {
    const filePath = crashShieldConfigPath(config.projectId);
    await mkdir(dirname(filePath), { recursive: true });
    await writeFile(filePath, JSON.stringify(config, null, 2), 'utf-8');
}
//# sourceMappingURL=crash-shield-store.js.map