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

Function event_session_id

src/sessions/cursor.rs:1023–1040  ·  view source on GitHub ↗
(event: &Value, transcript_path: &Path)

Source from the content-addressed store, hash-verified

1021}
1022
1023fn event_session_id(event: &Value, transcript_path: &Path) -> String {
1024 event
1025 .get("session_id")
1026 .or_else(|| event.get("conversation_id"))
1027 .or_else(|| event.get("chat_id"))
1028 .and_then(Value::as_str)
1029 .filter(|id| !id.is_empty())
1030 .map_or_else(
1031 || {
1032 transcript_path
1033 .file_stem()
1034 .and_then(|stem| stem.to_str())
1035 .unwrap_or("unknown")
1036 .to_string()
1037 },
1038 str::to_string,
1039 )
1040}
1041
1042fn event_project(event: &Value) -> (String, String) {
1043 let cwd_root = event_cwd(event).and_then(|cwd| crate::config::discover_project_root(&cwd));

Callers 2

transcript_pathsMethod · 0.70
parse_newMethod · 0.70

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected