MCPcopy Create free account
hub / github.com/claude-code-best/claude-code / formatAutonomyRunsList

Function formatAutonomyRunsList

src/utils/autonomyRuns.ts:1131–1154  ·  view source on GitHub ↗
(
  runs: AutonomyRunRecord[],
  limit = 10,
)

Source from the content-addressed store, hash-verified

1129}
1130
1131export 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}

Callers 2

getAutonomyRunsTextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected