// storage/auto-promoter-config-store.ts — Persists auto-promoter config (SPEC-391)
// Layout: data/projects/{hash}/config/auto-promoter.json
import { readJson, writeJson, projectDataDir, hashProjectPath } from './base-store.js';
import { getDefaultConfig } from '../engine/auto-promoter.js';
function configFile(projectId) {
    return `${projectDataDir(projectId)}/config/auto-promoter.json`;
}
/**
 * Load the auto-promoter config for a project.
 * Returns the default config when no file exists yet.
 */
export async function getConfig(projectPath) {
    const projectId = hashProjectPath(projectPath);
    return readJson(configFile(projectId), getDefaultConfig(projectPath));
}
/**
 * Persist the auto-promoter config for a project.
 */
export async function saveConfig(projectPath, config) {
    const projectId = hashProjectPath(projectPath);
    await writeJson(configFile(projectId), config);
}
//# sourceMappingURL=auto-promoter-config-store.js.map