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

Function handleGoalCommand

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

Source from the content-addressed store, hash-verified

121}
122
123export async function handleGoalCommand(host: SlashCommandHost, args: string): Promise<void> {
124 const parsed = parseGoalCommand(args);
125 switch (parsed.kind) {
126 case 'error':
127 if (parsed.severity === 'hint') host.showStatus(parsed.message);
128 else host.showError(parsed.message);
129 return;
130 case 'status':
131 await showGoalStatus(host);
132 return;
133 case 'pause':
134 await pauseGoal(host);
135 return;
136 case 'resume':
137 await resumeGoal(host);
138 return;
139 case 'cancel':
140 await cancelGoal(host);
141 return;
142 case 'next-add':
143 await queueNextGoal(host, parsed);
144 return;
145 case 'next-manage':
146 await showGoalQueueManager(host);
147 return;
148 case 'create':
149 await createGoal(host, parsed, args);
150 return;
151 }
152}
153
154function parseNextGoalCommand(tokens: readonly string[]): ParsedGoalCommand {
155 if (tokens.length === 2 && tokens[1] === 'manage') return { kind: 'next-manage' };

Callers 2

goal.test.tsFile · 0.85

Calls 10

parseGoalCommandFunction · 0.85
showGoalStatusFunction · 0.85
queueNextGoalFunction · 0.85
showGoalQueueManagerFunction · 0.85
pauseGoalFunction · 0.70
resumeGoalFunction · 0.70
cancelGoalFunction · 0.70
createGoalFunction · 0.70
showStatusMethod · 0.65
showErrorMethod · 0.65

Tested by

no test coverage detected