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

Function removeGoalQueueItem

apps/kimi-code/src/tui/goal-queue-store.ts:84–96  ·  view source on GitHub ↗
(
  session: GoalQueueSession,
  input: { readonly goalId: string },
)

Source from the content-addressed store, hash-verified

82}
83
84export async function removeGoalQueueItem(
85 session: GoalQueueSession,
86 input: { readonly goalId: string },
87): Promise<GoalQueueSnapshot> {
88 return withQueueMutationLock(session, async () => {
89 const state = await readQueueFile(session);
90 const index = findGoalIndex(state, input.goalId);
91 const goals = state.goals.filter((_, goalIndex) => goalIndex !== index);
92 const next: GoalQueueFile = { version: GOAL_QUEUE_VERSION, goals };
93 await writeQueueFile(session, next);
94 return toSnapshot(next);
95 });
96}
97
98export async function restoreGoalQueueItem(
99 session: GoalQueueSession,

Callers 3

promoteNextQueuedGoalMethod · 0.90

Calls 5

withQueueMutationLockFunction · 0.85
findGoalIndexFunction · 0.85
writeQueueFileFunction · 0.85
toSnapshotFunction · 0.85
readQueueFileFunction · 0.70

Tested by

no test coverage detected