(event: &Value, transcript_path: &Path)
| 1021 | } |
| 1022 | |
| 1023 | fn 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 | |
| 1042 | fn event_project(event: &Value) -> (String, String) { |
| 1043 | let cwd_root = event_cwd(event).and_then(|cwd| crate::config::discover_project_root(&cwd)); |
no test coverage detected