MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / write_entry

Function write_entry

src/monitor.rs:70–81  ·  view source on GitHub ↗

Write a tool-call entry to the global monitor mmap. `project_root` is used to derive the folder name. `prefix` identifies the tool suite (e.g. "tracedecay"). Best-effort: silently returns on any failure.

(project_root: &Path, prefix: &str, tool_name: &str, delta: u64, before: u64)

Source from the content-addressed store, hash-verified

68/// the tool suite (e.g. "tracedecay"). Best-effort: silently returns on
69/// any failure.
70pub fn write_entry(project_root: &Path, prefix: &str, tool_name: &str, delta: u64, before: u64) {
71 let Some(dir) = global_tracedecay_dir() else {
72 return;
73 };
74 let _ = std::fs::create_dir_all(&dir);
75 let mmap_path = dir.join(MMAP_FILENAME);
76 let project = project_root
77 .file_name()
78 .map(|n| n.to_string_lossy().to_string())
79 .unwrap_or_default();
80 let _ = write_entry_inner(&mmap_path, prefix, &project, tool_name, delta, before);
81}
82
83/// Write a tool-call entry to a specific mmap directory (for testing).
84pub fn write_entry_to(

Callers 1

handle_tools_callMethod · 0.85

Calls 2

global_tracedecay_dirFunction · 0.85
write_entry_innerFunction · 0.85

Tested by

no test coverage detected