(tool_name: &str, tool_input: Option<&serde_json::Value>)
| 525 | } |
| 526 | |
| 527 | fn summarize_commitment(tool_name: &str, tool_input: Option<&serde_json::Value>) -> String { |
| 528 | let path = tool_input |
| 529 | .and_then(|v| { |
| 530 | v.get("path") |
| 531 | .or_else(|| v.get("file")) |
| 532 | .or_else(|| v.get("file_path")) |
| 533 | .or_else(|| v.get("filePath")) |
| 534 | }) |
| 535 | .and_then(|v| v.as_str()); |
| 536 | |
| 537 | let verb = match tool_name.to_lowercase().as_str() { |
| 538 | "create" | "create_file" | "createfile" | "write" | "write_file" | "writefile" |
| 539 | | "write_to_file" => "Create", |
| 540 | "delete_file" | "remove_file" => "Delete", |
| 541 | "mv" | "move" | "rename" | "move_path" => "Move", |
| 542 | "copy" | "copy_path" => "Copy", |
| 543 | _ => "Edit", |
| 544 | }; |
| 545 | |
| 546 | match path { |
| 547 | Some(p) => format!("{} {}", verb, p), |
| 548 | None => format!("{} file", verb), |
| 549 | } |
| 550 | } |
| 551 | |
| 552 | fn summarize_verification( |
| 553 | tool_input: Option<&serde_json::Value>, |
no test coverage detected