(normalized: &str, command_hint: Option<&str>)
| 86 | } |
| 87 | |
| 88 | fn categorize_normalized_tool(normalized: &str, command_hint: Option<&str>) -> UsageCategory { |
| 89 | if normalized.starts_with("tracedecay_memory") |
| 90 | || normalized == "tracedecay_fact_store" |
| 91 | || normalized == "tracedecay_memory_status" |
| 92 | { |
| 93 | return UsageCategory::Memory; |
| 94 | } |
| 95 | if normalized.starts_with("tracedecay_lcm") |
| 96 | || normalized.contains("session") |
| 97 | || normalized.contains("transcript") |
| 98 | { |
| 99 | return UsageCategory::LcmSession; |
| 100 | } |
| 101 | if normalized.starts_with("tracedecay_") { |
| 102 | return UsageCategory::TraceDecayGraph; |
| 103 | } |
| 104 | if matches!( |
| 105 | normalized, |
| 106 | "read" | "readfile" | "cat" | "sed" | "grep" | "rg" | "glob" | "search" | "find" |
| 107 | ) { |
| 108 | return UsageCategory::BroadFileSearch; |
| 109 | } |
| 110 | if matches!(normalized, "apply_patch" | "edit" | "write") { |
| 111 | return UsageCategory::Edit; |
| 112 | } |
| 113 | if matches!( |
| 114 | normalized, |
| 115 | "bash" | "shell" | "exec_command" | "functions.exec_command" |
| 116 | ) { |
| 117 | return command_hint.map_or(UsageCategory::Shell, command_category); |
| 118 | } |
| 119 | UsageCategory::Other |
| 120 | } |
| 121 | |
| 122 | pub fn categorize_skill(raw: &str) -> UsageCategory { |
| 123 | let normalized = raw.trim().to_ascii_lowercase(); |
no test coverage detected