(rows: &[UsageSummary], kind: AgentReportKind)
| 7 | }; |
| 8 | |
| 9 | pub(crate) fn report_from_rows(rows: &[UsageSummary], kind: AgentReportKind) -> Value { |
| 10 | let rows_json = rows |
| 11 | .iter() |
| 12 | .map(|row| crate::adapter::opencode::agent_summary_json(row, kind, false)) |
| 13 | .collect::<Vec<_>>(); |
| 14 | serde_json::json!({ |
| 15 | rows_key(kind): rows_json, |
| 16 | "totals": totals_json(rows), |
| 17 | }) |
| 18 | } |
| 19 | |
| 20 | pub(super) fn summary_period(row: &UsageSummary) -> &str { |
| 21 | row.date |