MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / summarize_commitment

Function summarize_commitment

atomic-agent/src/provenance/classify.rs:527–550  ·  view source on GitHub ↗
(tool_name: &str, tool_input: Option<&serde_json::Value>)

Source from the content-addressed store, hash-verified

525}
526
527fn 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
552fn summarize_verification(
553 tool_input: Option<&serde_json::Value>,

Callers 1

summarize_tool_callFunction · 0.85

Calls 2

getMethod · 0.65
as_strMethod · 0.45

Tested by

no test coverage detected