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

Function showGoalQueueEditDialog

apps/kimi-code/src/tui/commands/goal.ts:271–300  ·  view source on GitHub ↗
(
  host: SlashCommandHost,
  goalId: string,
)

Source from the content-addressed store, hash-verified

269}
270
271async function showGoalQueueEditDialog(
272 host: SlashCommandHost,
273 goalId: string,
274): Promise<void> {
275 let snapshot: GoalQueueSnapshot;
276 try {
277 snapshot = await readGoalQueue(host.requireSession());
278 } catch (error) {
279 host.showError(`Failed to load upcoming goals: ${formatErrorMessage(error)}`);
280 return;
281 }
282
283 const goal = snapshot.goals.find((item) => item.id === goalId);
284 if (goal === undefined) {
285 host.showStatus('Queued goal no longer exists.');
286 await showGoalQueueManager(host);
287 return;
288 }
289
290 host.mountEditorReplacement(
291 new GoalQueueEditDialogComponent({
292 goal,
293 onDone: (result) => {
294 void handleGoalQueueEditResult(host, result).catch((error: unknown) => {
295 host.showError(`Failed to update upcoming goal: ${formatErrorMessage(error)}`);
296 });
297 },
298 }),
299 );
300}
301
302async function handleGoalQueueEditResult(
303 host: SlashCommandHost,

Callers 1

Calls 8

readGoalQueueFunction · 0.90
formatErrorMessageFunction · 0.90
showGoalQueueManagerFunction · 0.85
requireSessionMethod · 0.65
showErrorMethod · 0.65
showStatusMethod · 0.65

Tested by

no test coverage detected