"""Tooling helpers extracted from the duplex pipeline.""" from __future__ import annotations from typing import Any def normalize_tool_name(name: Any, aliases: dict[str, str]) -> str: """Normalize tool name with alias mapping.""" normalized = str(name or "").strip() if not normalized: return "" return aliases.get(normalized, normalized)