// storage/living-dashboard-store.ts — Dashboard data persistence
// Stores dashboard data in data/projects/{hash}/living-dashboard.json
import { projectDataDir, readJson, writeJson } from './base-store.js';
const DEFAULT_DATA = {
    entries: [],
    summary: {
        totalSpecs: 0,
        specsWithDrift: 0,
        averageCompletion: 0,
        healthScore: 100,
        generatedAt: '',
    },
    trends: [],
    updatedAt: '',
};
function dashboardPath(projectId) {
    return `${projectDataDir(projectId)}/living-dashboard.json`;
}
/**
 * Load dashboard data for a project. Returns defaults if not found.
 */
export async function getDashboard(projectId) {
    return readJson(dashboardPath(projectId), DEFAULT_DATA);
}
/**
 * Save dashboard data for a project.
 */
export async function saveDashboard(projectId, data) {
    await writeJson(dashboardPath(projectId), data);
}
//# sourceMappingURL=living-dashboard-store.js.map