MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / normalizeObjective

Function normalizeObjective

apps/kimi-code/src/tui/goal-queue-store.ts:205–217  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

203}
204
205function 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
219function findGoalIndex(file: GoalQueueFile, goalId: string): number {
220 const index = file.goals.findIndex((goal) => goal.id === goalId);

Callers 2

appendGoalQueueItemFunction · 0.85
updateGoalQueueItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected