import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
import { ENV_VARS, init_paths_state, resolveStateDir } from "./paths-state.js";
import { expandWorkspacePathString, init_workspace_path } from "./workspace-path.js";
import { join } from "node:path";
//#region src/config/workspace-defaults.ts
/**
* Default Markdown workspace for the primary agent.
*
* OpenClaw-aligned: `<stateDir>/workspace` (no `/main` suffix).
* When `XOPC_PROFILE` is set (and not `default`), returns `<stateDir>/workspace-<profile>`.
*/
function resolveDefaultAgentWorkspaceDir(env = process.env) {
	const fromEnv = env.XOPC_WORKSPACE?.trim();
	if (fromEnv) return expandWorkspacePathString(fromEnv);
	const stateDir = resolveStateDir(env);
	const profile = env[ENV_VARS.PROFILE]?.trim();
	if (profile && profile.toLowerCase() !== "default") return join(stateDir, `workspace-${profile}`);
	return join(stateDir, "workspace");
}
var init_workspace_defaults = __esmMin((() => {
	init_workspace_path();
	init_paths_state();
}));
//#endregion
init_workspace_defaults();
export { init_workspace_defaults, resolveDefaultAgentWorkspaceDir };

//# sourceMappingURL=workspace-defaults.js.map