import type { ChatToolItem } from '../types' function capitalize(str: string): string { const spaced = str.replace(/_/g, ' ') return spaced.charAt(0).toUpperCase() + spaced.slice(1) } export function getToolLabel(tool: ChatToolItem): string { if (tool.status === 'running') { return tool.runningLabel ?? capitalize(tool.name) } return tool.label ?? capitalize(tool.name) }