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

Function findGoalIndex

apps/kimi-code/src/tui/goal-queue-store.ts:219–225  ·  view source on GitHub ↗
(file: GoalQueueFile, goalId: string)

Source from the content-addressed store, hash-verified

217}
218
219function findGoalIndex(file: GoalQueueFile, goalId: string): number {
220 const index = file.goals.findIndex((goal) => goal.id === goalId);
221 if (index === -1) {
222 throw new KimiError(ErrorCodes.GOAL_NOT_FOUND, 'No queued goal found');
223 }
224 return index;
225}
226
227function isGoalQueueFile(value: unknown): value is GoalQueueFile {
228 if (!isRecord(value)) return false;

Callers 3

updateGoalQueueItemFunction · 0.85
removeGoalQueueItemFunction · 0.85
moveGoalQueueItemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected