import { readJson, writeJson, hashProjectPath } from './base-store.js';
function profileFile(projectId) {
    return `data/projects/${projectId}/context-profile.json`;
}
/**
 * Persist the active work phase for a project.
 */
export async function setActiveProfile(projectPath, phase) {
    const projectId = hashProjectPath(projectPath);
    const file = profileFile(projectId);
    const profile = {
        projectPath,
        phase,
        activatedAt: new Date().toISOString(),
    };
    await writeJson(file, profile);
}
/**
 * Retrieve the active profile for a project, or null if none is set.
 */
export async function getActiveProfile(projectPath) {
    const projectId = hashProjectPath(projectPath);
    const file = profileFile(projectId);
    return readJson(file, null);
}
/**
 * Remove the active profile for a project.
 */
export async function clearActiveProfile(projectPath) {
    const projectId = hashProjectPath(projectPath);
    const file = profileFile(projectId);
    await writeJson(file, null);
}
//# sourceMappingURL=context-profile-store.js.map