import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
import { join } from "node:path";
import { homedir } from "node:os";
//#region src/config/paths-state.ts
function resolveHomeDir(env = process.env) {
	return env[ENV_VARS.HOME] || homedir();
}
function resolveStateDir(env = process.env) {
	if (env[ENV_VARS.STATE_DIR]) return env[ENV_VARS.STATE_DIR];
	return join(resolveHomeDir(env), ".xopc");
}
/** Persisted npm update check throttle / notification state (`~/.xopc/update-check.json`). */
function resolveUpdateCheckStatePath(env = process.env) {
	return join(resolveStateDir(env), "update-check.json");
}
/** Cross-process lock for one-click / CLI / auto npm updates (`~/.xopc/update.lock`). */
function resolveUpdateLockPath(env = process.env) {
	return join(resolveStateDir(env), "update.lock");
}
var ENV_VARS;
var init_paths_state = __esmMin((() => {
	ENV_VARS = {
		STATE_DIR: "XOPC_STATE_DIR",
		PROFILE: "XOPC_PROFILE",
		HOME: "XOPC_HOME",
		CONFIG_PATH: "XOPC_CONFIG_PATH",
		CREDENTIALS_DIR: "XOPC_CREDENTIALS_DIR",
		LOG_LEVEL: "XOPC_LOG_LEVEL",
		LOG_DIR: "XOPC_LOG_DIR",
		LOG_CONSOLE: "XOPC_LOG_CONSOLE",
		LOG_FILE: "XOPC_LOG_FILE",
		LOG_RETENTION_DAYS: "XOPC_LOG_RETENTION_DAYS",
		PRETTY_LOGS: "XOPC_PRETTY_LOGS"
	};
}));
//#endregion
init_paths_state();
export { ENV_VARS, init_paths_state, resolveHomeDir, resolveStateDir, resolveUpdateCheckStatePath, resolveUpdateLockPath };

//# sourceMappingURL=paths-state.js.map