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

Function write_entry_to

src/monitor.rs:84–99  ·  view source on GitHub ↗

Write a tool-call entry to a specific mmap directory (for testing).

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

Source from the content-addressed store, hash-verified

82
83/// Write a tool-call entry to a specific mmap directory (for testing).
84pub fn write_entry_to(
85 dir: &Path,
86 project_root: &Path,
87 prefix: &str,
88 tool_name: &str,
89 delta: u64,
90 before: u64,
91) {
92 let _ = std::fs::create_dir_all(dir);
93 let mmap_path = dir.join(MMAP_FILENAME);
94 let project = project_root
95 .file_name()
96 .map(|n| n.to_string_lossy().to_string())
97 .unwrap_or_default();
98 let _ = write_entry_inner(&mmap_path, prefix, &project, tool_name, delta, before);
99}
100
101fn write_str(mmap: &mut memmap2::MmapMut, offset: usize, value: &str) {
102 let bytes = value.as_bytes();

Callers 1

writeFunction · 0.85

Calls 1

write_entry_innerFunction · 0.85

Tested by 1

writeFunction · 0.68