(
map: &mut serde_json::Map<String, Value>,
keys: TranscriptLocationMetadataKeys,
location: TranscriptLocation<'_>,
)
| 290 | } |
| 291 | |
| 292 | pub(crate) fn append_location_metadata( |
| 293 | map: &mut serde_json::Map<String, Value>, |
| 294 | keys: TranscriptLocationMetadataKeys, |
| 295 | location: TranscriptLocation<'_>, |
| 296 | ) { |
| 297 | let Some(cwd) = location.cwd else { |
| 298 | return; |
| 299 | }; |
| 300 | map.insert( |
| 301 | keys.cwd.to_string(), |
| 302 | Value::String(cwd.to_string_lossy().to_string()), |
| 303 | ); |
| 304 | if let Some(worktree) = crate::worktree::git_worktree_root(cwd) { |
| 305 | map.insert( |
| 306 | keys.worktree.to_string(), |
| 307 | Value::String(worktree.to_string_lossy().to_string()), |
| 308 | ); |
| 309 | } |
| 310 | map.insert( |
| 311 | keys.provenance.to_string(), |
| 312 | Value::String(location.provenance.to_string()), |
| 313 | ); |
| 314 | } |
| 315 | |
| 316 | /// Token-usage counter keys recognized by the savings dashboard |
| 317 | /// (`dashboard/savings_api.rs` `MESSAGE_TOKENS_CTE`): both the Anthropic |
no test coverage detected