(toolName: string)
| 106 | } |
| 107 | |
| 108 | export function getToolDisplayInfo(toolName: string): { |
| 109 | name: string |
| 110 | type: string |
| 111 | } { |
| 112 | const TOOL_NAME_OVERRIDES: Record<string, string> = { |
| 113 | list_directory: 'List Directories', |
| 114 | } |
| 115 | |
| 116 | const capitalizeWords = (str: string) => { |
| 117 | return str.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase()) |
| 118 | } |
| 119 | |
| 120 | return { |
| 121 | name: TOOL_NAME_OVERRIDES[toolName] ?? capitalizeWords(toolName), |
| 122 | type: 'tool', |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | function toYaml(obj: any, indent = 0): string { |
| 127 | const spaces = ' '.repeat(indent) |
no test coverage detected