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

Function formatHuman

apps/kimi-code/src/cli/sub/server/lifecycle.ts:199–223  ·  view source on GitHub ↗
(result: Record<string, unknown>)

Source from the content-addressed store, hash-verified

197}
198
199function formatHuman(result: Record<string, unknown>): string {
200 const rawAction = result['action'];
201 const action = typeof rawAction === 'string' ? rawAction : 'action';
202 const rawMessage = result['message'];
203 const message = typeof rawMessage === 'string' ? `: ${rawMessage}` : '';
204 const lines = [`${action}${message}`];
205
206 const url = result['url'];
207 if (typeof url === 'string') lines.push(`URL: ${url}`);
208
209 const running = result['running'];
210 if (typeof running === 'boolean') lines.push(`Status: ${running ? 'running' : 'not running'}`);
211
212 const logPath = result['logPath'];
213 if (typeof logPath === 'string') lines.push(`Log: ${logPath}`);
214
215 const notes = result['notes'];
216 if (Array.isArray(notes)) {
217 for (const note of notes) {
218 if (typeof note === 'string' && note.length > 0) lines.push(`Note: ${note}`);
219 }
220 }
221
222 return `${lines.join('\n')}\n`;
223}
224
225async function readStatus(mgr: ServiceManager): Promise<ServiceStatus | undefined> {
226 try {

Callers 1

runLifecycleFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected