| 157 | } |
| 158 | |
| 159 | func stepsToJSON(steps []requests.StepRow) []map[string]any { |
| 160 | out := make([]map[string]any, 0, len(steps)) |
| 161 | for _, s := range steps { |
| 162 | out = append(out, map[string]any{ |
| 163 | "request_id": s.RequestID, |
| 164 | "step_index": s.StepIndex, |
| 165 | "step_type": s.StepType, |
| 166 | "input_json": json.RawMessage(s.InputJSON), |
| 167 | "output_json": json.RawMessage(s.OutputJSON), |
| 168 | "backend": s.Backend, |
| 169 | "status": s.Status, |
| 170 | "error": s.Error, |
| 171 | "latency_ms": s.LatencyMs, |
| 172 | "metadata_json": json.RawMessage(s.MetadataJSON), |
| 173 | }) |
| 174 | } |
| 175 | return out |
| 176 | } |
| 177 | |
| 178 | func replayCmd(cfgPath *string) *cobra.Command { |
| 179 | var mode, idsFile string |