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

Function append_location_metadata

src/sessions/shared.rs:292–314  ·  view source on GitHub ↗
(
    map: &mut serde_json::Map<String, Value>,
    keys: TranscriptLocationMetadataKeys,
    location: TranscriptLocation<'_>,
)

Source from the content-addressed store, hash-verified

290}
291
292pub(crate) fn append_location_metadata(
293 map: &mut serde_json::Map<String, Value>,
294 keys: TranscriptLocationMetadataKeys,
295 location: TranscriptLocation<'_>,
296) {
297 let Some(cwd) = location.cwd else {
298 return;
299 };
300 map.insert(
301 keys.cwd.to_string(),
302 Value::String(cwd.to_string_lossy().to_string()),
303 );
304 if let Some(worktree) = crate::worktree::git_worktree_root(cwd) {
305 map.insert(
306 keys.worktree.to_string(),
307 Value::String(worktree.to_string_lossy().to_string()),
308 );
309 }
310 map.insert(
311 keys.provenance.to_string(),
312 Value::String(location.provenance.to_string()),
313 );
314}
315
316/// Token-usage counter keys recognized by the savings dashboard
317/// (`dashboard/savings_api.rs` `MESSAGE_TOKENS_CTE`): both the Anthropic

Callers 15

session_metadataFunction · 0.85
message_metadataFunction · 0.85
session_from_rowFunction · 0.85
message_from_rowFunction · 0.85
session_metadataFunction · 0.85
message_metadataFunction · 0.85
session_metadataFunction · 0.85
message_metadataFunction · 0.85
session_metadataFunction · 0.85
message_metadataFunction · 0.85
session_metadataFunction · 0.85
message_metadataFunction · 0.85

Calls 2

git_worktree_rootFunction · 0.85
insertMethod · 0.80

Tested by

no test coverage detected