//#region src/types/tool-policies.ts
/**
* Helper function to normalize McpToolSelection[] into separate arrays
*/
function normalizeToolSelections(selections) {
	if (!selections || selections.length === 0) return {
		selectedTools: [],
		toolPolicies: {}
	};
	const selectedTools = [];
	const toolPolicies = {};
	for (const selection of selections) if (typeof selection === "string") selectedTools.push(selection);
	else {
		selectedTools.push(selection.name);
		const policy = {};
		if (selection.needsApproval !== void 0) policy.needsApproval = selection.needsApproval;
		if (Object.keys(policy).length > 0) toolPolicies[selection.name] = policy;
	}
	return {
		selectedTools,
		toolPolicies
	};
}

//#endregion
export { normalizeToolSelections };