* 工具名称到动作类型的映射
(toolName: string)
| 378 | * 工具名称到动作类型的映射 |
| 379 | */ |
| 380 | function toolNameToAction(toolName: string): ActionType { |
| 381 | const mapping: Record<string, ActionType> = { |
| 382 | shell: 'command_run', |
| 383 | read: 'file_read', |
| 384 | write: 'file_edit', |
| 385 | edit: 'file_edit', |
| 386 | delete: 'file_edit', |
| 387 | grep: 'search', |
| 388 | glob: 'search', |
| 389 | semsearch: 'search', |
| 390 | ls: 'other', |
| 391 | todo: 'todo_management', |
| 392 | mcp: 'tool', |
| 393 | web_search: 'search', |
| 394 | web_fetch: 'web_fetch', |
| 395 | }; |
| 396 | return mapping[toolName] || 'tool'; |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * Normalize Cursor todo status strings to standard format |
no outgoing calls
no test coverage detected