| 1178 | } |
| 1179 | |
| 1180 | func agentEventsBundle(events []AgentEventRecord) outputBundle { |
| 1181 | return listBundle( |
| 1182 | events, |
| 1183 | events, |
| 1184 | "Prompt Events", |
| 1185 | []string{sessionTimestampValue, sessionTypeValue, "Detail", "Stop"}, |
| 1186 | "prompt_events", |
| 1187 | []string{networkTimestampKey, extensionTypeKey, "detail", "stop_reason"}, |
| 1188 | func(event AgentEventRecord) []string { |
| 1189 | return []string{ |
| 1190 | stringOrDash(formatTime(event.Timestamp)), |
| 1191 | stringOrDash(event.Type), |
| 1192 | stringOrDash(firstNonEmpty(event.Text, event.Title, event.Error, compactJSON(event.Raw))), |
| 1193 | stringOrDash(event.StopReason), |
| 1194 | } |
| 1195 | }, |
| 1196 | func(event AgentEventRecord) []string { |
| 1197 | return []string{ |
| 1198 | formatTime(event.Timestamp), |
| 1199 | event.Type, |
| 1200 | firstNonEmpty(event.Text, event.Title, event.Error, compactJSON(event.Raw)), |
| 1201 | event.StopReason, |
| 1202 | } |
| 1203 | }, |
| 1204 | ) |
| 1205 | } |
| 1206 | |
| 1207 | func sessionPromptBundle(record SessionPromptRecord) outputBundle { |
| 1208 | if record.Prompt.Status == "" && len(record.Events) > 0 { |