import "./fs-safe-defaults-A4awSMom.js";
import { p as resolveUserPath } from "./utils-FLBGJBzj.js";
import { i as writeSecretFileAtomic, n as readSecretFileSync$1, r as tryReadSecretFileSync$1, t as DEFAULT_SECRET_FILE_MAX_BYTES$1 } from "./secret-file-UZBBE79U.js";
//#region src/infra/secret-file.ts
const DEFAULT_SECRET_FILE_MAX_BYTES = DEFAULT_SECRET_FILE_MAX_BYTES$1;
const PRIVATE_SECRET_DIR_MODE = 448;
const PRIVATE_SECRET_FILE_MODE = 384;
function readSecretFileSync(...args) {
	return readSecretFileSync$1(...args);
}
function tryReadSecretFileSync(...args) {
	return tryReadSecretFileSync$1(...args);
}
function writePrivateSecretFileAtomic(...args) {
	return writeSecretFileAtomic(...args);
}
/** @deprecated Use readSecretFileSync() or tryReadSecretFileSync(). */
function loadSecretFileSync(filePath, label, options = {}) {
	const resolvedPath = resolveUserPath(filePath.trim());
	if (!resolvedPath) return {
		ok: false,
		message: `${label} file path is empty.`
	};
	try {
		return {
			ok: true,
			secret: readSecretFileSync$1(filePath, label, options),
			resolvedPath
		};
	} catch (error) {
		return {
			ok: false,
			message: error instanceof Error ? error.message : String(error),
			resolvedPath,
			error
		};
	}
}
//#endregion
export { readSecretFileSync as a, loadSecretFileSync as i, PRIVATE_SECRET_DIR_MODE as n, tryReadSecretFileSync as o, PRIVATE_SECRET_FILE_MODE as r, writePrivateSecretFileAtomic as s, DEFAULT_SECRET_FILE_MAX_BYTES as t };
