import fs from "node:fs";
import path from "node:path";
export function configPath(dataDir) {
    return path.join(dataDir, "config", "deepseekcode.json");
}
export function readGlobalConfig(dataDir) {
    const file = configPath(dataDir);
    if (!fs.existsSync(file))
        return {};
    return JSON.parse(fs.readFileSync(file, "utf8"));
}
export function saveGlobalConfig(dataDir, config) {
    const file = configPath(dataDir);
    fs.mkdirSync(path.dirname(file), { recursive: true });
    fs.writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`, "utf8");
}
