(goal: ThreadGoal)
| 161 | } |
| 162 | |
| 163 | function formatGoalUsage(goal: ThreadGoal): string { |
| 164 | const parts: string[] = [`Goal ${formatGoalStatus(goal.status)}`]; |
| 165 | if (goal.tokenBudget !== null && goal.tokenBudget !== undefined) { |
| 166 | parts.push(`${goal.tokensUsed}/${goal.tokenBudget} tokens`); |
| 167 | } else if (goal.tokensUsed > 0) { |
| 168 | parts.push(`${goal.tokensUsed} tokens`); |
| 169 | } |
| 170 | return parts.join(' · '); |
| 171 | } |
| 172 | |
| 173 | function stripAnsi(value: string): string { |
| 174 | return value.replace(/\u001b\[[0-9;]*m/g, ''); |
no test coverage detected