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

Function appendGoalQueueItem

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

Source from the content-addressed store, hash-verified

43}
44
45export async function appendGoalQueueItem(
46 session: GoalQueueSession,
47 input: { readonly objective: string },
48): Promise<GoalQueueSnapshot> {
49 const objective = normalizeObjective(input.objective);
50 return withQueueMutationLock(session, async () => {
51 const state = await readQueueFile(session);
52 const now = new Date().toISOString();
53 const goal: UpcomingGoal = {
54 id: randomUUID(),
55 objective,
56 createdAt: now,
57 updatedAt: now,
58 };
59 const next: GoalQueueFile = { version: GOAL_QUEUE_VERSION, goals: [...state.goals, goal] };
60 await writeQueueFile(session, next);
61 return toSnapshot(next);
62 });
63}
64
65export async function updateGoalQueueItem(
66 session: GoalQueueSession,

Callers 2

queueNextGoalFunction · 0.90

Calls 5

normalizeObjectiveFunction · 0.85
withQueueMutationLockFunction · 0.85
writeQueueFileFunction · 0.85
toSnapshotFunction · 0.85
readQueueFileFunction · 0.70

Tested by

no test coverage detected