(status: unknown)
| 146 | } |
| 147 | |
| 148 | function formatGoalStatus(status: unknown): string { |
| 149 | switch (status) { |
| 150 | case 'active': |
| 151 | return 'active'; |
| 152 | case 'paused': |
| 153 | return 'paused'; |
| 154 | case 'budgetLimited': |
| 155 | return 'limited by budget'; |
| 156 | case 'complete': |
| 157 | return 'complete'; |
| 158 | default: |
| 159 | return typeof status === 'string' ? status : 'updated'; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | function formatGoalUsage(goal: ThreadGoal): string { |
| 164 | const parts: string[] = [`Goal ${formatGoalStatus(goal.status)}`]; |