import { readJson, writeJson, projectDataDir } from './base-store.js';
// ---------------------------------------------------------------------------
// Path helpers
// ---------------------------------------------------------------------------
/** Return the storage path for a project's stack audit result. */
export function getStackAuditPath(projectId) {
    return `${projectDataDir(projectId)}/stack-audit.json`;
}
// ---------------------------------------------------------------------------
// Public API
// ---------------------------------------------------------------------------
/** Save a stack audit result to disk. */
export async function saveStackAudit(projectPath, audit) {
    const filePath = getStackAuditPath(audit.projectId);
    await writeJson(filePath, audit);
    // projectPath is used for future cross-project storage; currently unused
    void projectPath;
}
/** Retrieve the last saved stack audit for a project. Returns null if none. */
export async function getLastStackAudit(projectPath) {
    // Derive projectId from path for consistent lookups
    const { hashProjectPath } = await import('./base-store.js');
    const projectId = hashProjectPath(projectPath);
    const filePath = getStackAuditPath(projectId);
    const result = await readJson(filePath, null);
    return result;
}
//# sourceMappingURL=stack-audit-store.js.map