// ---------------------------------------------------------------------------
// benchmark.json read/write
// ---------------------------------------------------------------------------
import { writeFileSync, readFileSync, existsSync, mkdirSync } from "node:fs";
import { join } from "node:path";
export async function writeBenchmark(skillDir, result) {
    const evalsDir = join(skillDir, "evals");
    mkdirSync(evalsDir, { recursive: true });
    const filePath = join(evalsDir, "benchmark.json");
    writeFileSync(filePath, JSON.stringify(result, null, 2), "utf-8");
}
export async function readBenchmark(skillDir) {
    const filePath = join(skillDir, "evals", "benchmark.json");
    if (!existsSync(filePath))
        return null;
    try {
        const raw = readFileSync(filePath, "utf-8");
        return JSON.parse(raw);
    }
    catch {
        return null;
    }
}
//# sourceMappingURL=benchmark.js.map