(tool_input: Option<&Value>)
| 411 | } |
| 412 | |
| 413 | fn extract_file_path(tool_input: Option<&Value>) -> Option<String> { |
| 414 | let value = tool_input?; |
| 415 | for key in ["file_path", "filePath", "path", "target_file"] { |
| 416 | if let Some(path) = value.get(key).and_then(Value::as_str) { |
| 417 | return Some(path.to_string()); |
| 418 | } |
| 419 | } |
| 420 | None |
| 421 | } |
| 422 | |
| 423 | fn insert_if_missing(raw: &mut Value, key: &str, value: Value) { |
| 424 | if let Some(obj) = raw.as_object_mut() { |
no test coverage detected