const POLLING_TOOL_NAMES = new Set(["poll_message", "get_message"]);
/**
 * Main flow: normalize common MCP separators, then use the final segment as
 * the semantic tool name that controls timeout policy.
 */
export function getSemanticToolName(toolName) {
    const normalized = toolName.trim().toLowerCase();
    const segments = normalized.split(/__|[./]/).filter(Boolean);
    return segments.at(-1) ?? normalized;
}
/**
 * Main flow: classify only exact polling tool names so similarly named tools
 * keep the regular MCP timeout.
 */
export function isMcpPollingToolName(toolName) {
    return POLLING_TOOL_NAMES.has(getSemanticToolName(toolName));
}
