//#region src/config/soul-config-helpers.ts
function setSoulInConfig(sourceConfig, agentId, preset) {
	if (!sourceConfig.agents) sourceConfig.agents = {};
	if (!Array.isArray(sourceConfig.agents.list)) sourceConfig.agents.list = [];
	const entry = sourceConfig.agents.list.find((e) => e.id.toLowerCase() === agentId.toLowerCase());
	if (entry) entry.soul = {
		...entry.soul ?? {},
		preset
	};
	else sourceConfig.agents.list.push({
		id: agentId,
		soul: { preset }
	});
}
function removeSoulFromConfig(sourceConfig, agentId) {
	const list = sourceConfig.agents?.list;
	if (!Array.isArray(list)) return;
	const entry = list.find((e) => e.id.toLowerCase() === agentId.toLowerCase());
	if (entry) delete entry.soul;
}
//#endregion
export { setSoulInConfig as n, removeSoulFromConfig as t };
