(value: string)
| 203 | } |
| 204 | |
| 205 | function normalizeObjective(value: string): string { |
| 206 | const objective = value.trim(); |
| 207 | if (objective.length === 0) { |
| 208 | throw new KimiError(ErrorCodes.GOAL_OBJECTIVE_EMPTY, 'Goal objective cannot be empty'); |
| 209 | } |
| 210 | if (objective.length > MAX_GOAL_OBJECTIVE_LENGTH) { |
| 211 | throw new KimiError( |
| 212 | ErrorCodes.GOAL_OBJECTIVE_TOO_LONG, |
| 213 | `Goal objective cannot exceed ${MAX_GOAL_OBJECTIVE_LENGTH} characters`, |
| 214 | ); |
| 215 | } |
| 216 | return objective; |
| 217 | } |
| 218 | |
| 219 | function findGoalIndex(file: GoalQueueFile, goalId: string): number { |
| 220 | const index = file.goals.findIndex((goal) => goal.id === goalId); |
no outgoing calls
no test coverage detected