(toolName: string)
| 36 | } |
| 37 | |
| 38 | export function toToolKind(toolName: string): ToolKind { |
| 39 | const tool = toolName.toLocaleLowerCase() |
| 40 | |
| 41 | switch (tool) { |
| 42 | case "bash": |
| 43 | case "shell": |
| 44 | return "execute" |
| 45 | |
| 46 | case "webfetch": |
| 47 | return "fetch" |
| 48 | |
| 49 | case "edit": |
| 50 | case "apply_patch": |
| 51 | case "patch": |
| 52 | case "write": |
| 53 | return "edit" |
| 54 | |
| 55 | case "grep": |
| 56 | case "glob": |
| 57 | case "context": |
| 58 | case "context7_resolve_library_id": |
| 59 | case "context7_get_library_docs": |
| 60 | return "search" |
| 61 | |
| 62 | case "read": |
| 63 | return "read" |
| 64 | |
| 65 | case "task": |
| 66 | return "think" |
| 67 | |
| 68 | default: |
| 69 | return "other" |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | export function toLocations(toolName: string, input: ToolInput, cwd?: string): ToolCallLocation[] { |
| 74 | const tool = toolName.toLocaleLowerCase() |
no outgoing calls
no test coverage detected