import { B as resolvePreferredSymiTmpDir } from "./registry-Sbac4a4z.js";
import { _ as resolveStateDir } from "./paths-By0XjHBk.js";
import { c as resolveAgentWorkspaceDir } from "./agent-scope-DOrZjOnW.js";
import path from "node:path";

//#region src/media/local-roots.ts
function buildMediaLocalRoots(stateDir) {
	const resolvedStateDir = path.resolve(stateDir);
	return [
		resolvePreferredSymiTmpDir(),
		path.join(resolvedStateDir, "media"),
		path.join(resolvedStateDir, "agents"),
		path.join(resolvedStateDir, "workspace"),
		path.join(resolvedStateDir, "sandboxes")
	];
}
function getDefaultMediaLocalRoots() {
	return buildMediaLocalRoots(resolveStateDir());
}
function getAgentScopedMediaLocalRoots(cfg, agentId) {
	const roots = buildMediaLocalRoots(resolveStateDir());
	if (!agentId?.trim()) return roots;
	const workspaceDir = resolveAgentWorkspaceDir(cfg, agentId);
	if (!workspaceDir) return roots;
	const normalizedWorkspaceDir = path.resolve(workspaceDir);
	if (!roots.includes(normalizedWorkspaceDir)) roots.push(normalizedWorkspaceDir);
	return roots;
}

//#endregion
export { getDefaultMediaLocalRoots as n, getAgentScopedMediaLocalRoots as t };