import { mkdir } from "node:fs/promises";
import { platform } from "node:os";
import { getConfigDir, getLogDir } from "./paths.js";
/**
 * Ensures the config directory structure exists with proper permissions.
 * Creates the config directory and logs subdirectory if they don't exist.
 * On Unix systems, directories are created with 0700 permissions.
 * This function is idempotent — safe to call multiple times.
 */
export async function ensureConfigDirs() {
    const mode = platform() === "win32" ? undefined : 0o700;
    const options = { recursive: true, mode };
    await mkdir(getConfigDir(), options);
    await mkdir(getLogDir(), options);
}
//# sourceMappingURL=config.js.map