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

Function session_metadata

src/sessions/cursor.rs:1126–1153  ·  view source on GitHub ↗
(event: &Value, event_cwd: Option<&Path>, location_provenance: &str)

Source from the content-addressed store, hash-verified

1124}
1125
1126fn session_metadata(event: &Value, event_cwd: Option<&Path>, location_provenance: &str) -> Value {
1127 let mut metadata = serde_json::Map::new();
1128 metadata.insert(
1129 "source".to_string(),
1130 Value::String("cursor_transcript".to_string()),
1131 );
1132 metadata.insert(
1133 "conversation_id".to_string(),
1134 event.get("conversation_id").cloned().unwrap_or(Value::Null),
1135 );
1136 metadata.insert(
1137 "hook_event_name".to_string(),
1138 event.get("hook_event_name").cloned().unwrap_or(Value::Null),
1139 );
1140 metadata.insert(
1141 "cursor_version".to_string(),
1142 event.get("cursor_version").cloned().unwrap_or(Value::Null),
1143 );
1144 if let Some(roots) = event.get("workspace_roots") {
1145 metadata.insert("workspace_roots".to_string(), roots.clone());
1146 }
1147 append_location_metadata(
1148 &mut metadata,
1149 CURSOR_EVENT_LOCATION_KEYS,
1150 TranscriptLocation::new(event_cwd, location_provenance),
1151 );
1152 Value::Object(metadata)
1153}
1154
1155fn message_metadata(
1156 record: &Value,

Callers 1

parse_cursor_jsonlFunction · 0.70

Calls 2

append_location_metadataFunction · 0.85
insertMethod · 0.80

Tested by

no test coverage detected