import { s as normalizeOptionalLowercaseString } from "./string-coerce-LndEvhRk.js";
import { o as resolveRequiredHomeDir } from "./home-dir-Be-LF1OW.js";
import path from "node:path";
import os from "node:os";
//#region src/agents/workspace-default.ts
function resolveDefaultAgentWorkspaceDir(env = process.env, homedir = os.homedir) {
	const workspaceDir = env.KLAW_WORKSPACE_DIR?.trim();
	if (workspaceDir) return path.resolve(workspaceDir);
	const home = resolveRequiredHomeDir(env, homedir);
	const profile = env.KLAW_PROFILE?.trim();
	if (profile && normalizeOptionalLowercaseString(profile) !== "default") return path.join(home, ".klaw", `workspace-${profile}`);
	return path.join(home, ".klaw", "workspace");
}
const DEFAULT_AGENT_WORKSPACE_DIR = resolveDefaultAgentWorkspaceDir();
//#endregion
export { resolveDefaultAgentWorkspaceDir as n, DEFAULT_AGENT_WORKSPACE_DIR as t };
