( runs: AutonomyRunRecord[], limit = 10, )
| 1129 | } |
| 1130 | |
| 1131 | export function formatAutonomyRunsList( |
| 1132 | runs: AutonomyRunRecord[], |
| 1133 | limit = 10, |
| 1134 | ): string { |
| 1135 | const slice = runs.slice(0, limit) |
| 1136 | if (slice.length === 0) { |
| 1137 | return 'No autonomy runs recorded.' |
| 1138 | } |
| 1139 | return slice |
| 1140 | .map(run => { |
| 1141 | const source = run.sourceLabel ?? run.sourceId ?? 'auto' |
| 1142 | const flow = |
| 1143 | run.parentFlowId && run.flowStepName |
| 1144 | ? ` | flow=${run.parentFlowId} step=${run.flowStepName}` |
| 1145 | : '' |
| 1146 | const ended = |
| 1147 | run.endedAt != null |
| 1148 | ? ` -> ${new Date(run.endedAt).toLocaleTimeString()}` |
| 1149 | : '' |
| 1150 | const error = run.error ? ` | ${run.error}` : '' |
| 1151 | return `${run.runId} | ${run.runtime} | ${run.trigger} | ${run.status} | ${source}${flow} | ${new Date(run.createdAt).toLocaleTimeString()}${ended}\n ${run.promptPreview}${error}` |
| 1152 | }) |
| 1153 | .join('\n') |
| 1154 | } |
no outgoing calls
no test coverage detected