(
record: &Value,
tool_use_id: Option<&str>,
event_cwd: Option<&Path>,
location_provenance: &str,
)
| 1180 | } |
| 1181 | |
| 1182 | fn dispatch_message_metadata( |
| 1183 | record: &Value, |
| 1184 | tool_use_id: Option<&str>, |
| 1185 | event_cwd: Option<&Path>, |
| 1186 | location_provenance: &str, |
| 1187 | ) -> Value { |
| 1188 | let mut metadata = serde_json::Map::new(); |
| 1189 | metadata.insert( |
| 1190 | "source".to_string(), |
| 1191 | Value::String("cursor_transcript".to_string()), |
| 1192 | ); |
| 1193 | metadata.insert( |
| 1194 | "raw_type".to_string(), |
| 1195 | record.get("type").cloned().unwrap_or(Value::Null), |
| 1196 | ); |
| 1197 | metadata.insert( |
| 1198 | "tool_use_id".to_string(), |
| 1199 | tool_use_id.map_or(Value::Null, |id| Value::String(id.to_string())), |
| 1200 | ); |
| 1201 | append_location_metadata( |
| 1202 | &mut metadata, |
| 1203 | CURSOR_EVENT_LOCATION_KEYS, |
| 1204 | TranscriptLocation::new(event_cwd, location_provenance), |
| 1205 | ); |
| 1206 | Value::Object(metadata) |
| 1207 | } |
no test coverage detected