(
record: &Value,
message: &Value,
event_cwd: Option<&Path>,
location_provenance: &str,
)
| 1153 | } |
| 1154 | |
| 1155 | fn message_metadata( |
| 1156 | record: &Value, |
| 1157 | message: &Value, |
| 1158 | event_cwd: Option<&Path>, |
| 1159 | location_provenance: &str, |
| 1160 | ) -> Value { |
| 1161 | let mut metadata = serde_json::Map::new(); |
| 1162 | metadata.insert( |
| 1163 | "source".to_string(), |
| 1164 | Value::String("cursor_transcript".to_string()), |
| 1165 | ); |
| 1166 | metadata.insert( |
| 1167 | "raw_type".to_string(), |
| 1168 | record.get("type").cloned().unwrap_or(Value::Null), |
| 1169 | ); |
| 1170 | append_location_metadata( |
| 1171 | &mut metadata, |
| 1172 | CURSOR_EVENT_LOCATION_KEYS, |
| 1173 | TranscriptLocation::new(event_cwd, location_provenance), |
| 1174 | ); |
| 1175 | append_tool_calls_metadata(&mut metadata, message); |
| 1176 | // Cursor transcripts carry no token counters today (verified across |
| 1177 | // 100k+ real lines); this probe is future-proofing for when they do. |
| 1178 | append_usage_metadata(&mut metadata, &[record, message]); |
| 1179 | Value::Object(metadata) |
| 1180 | } |
| 1181 | |
| 1182 | fn dispatch_message_metadata( |
| 1183 | record: &Value, |
no test coverage detected