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

Function start

packages/server/src/svc/schtasks.ts:133–148  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131 }
132
133 async function start(): Promise<LifecycleResult> {
134 if (!(await deps.taskExists())) {
135 return {
136 ok: false,
137 message: 'Scheduled task is not installed. Run `kimi server install` first.',
138 };
139 }
140 const result = await deps.execSchtasks(['/Run', '/TN', KIMI_SERVER_TASK_NAME]);
141 if (result.code !== 0) {
142 return {
143 ok: false,
144 message: `schtasks /Run failed: ${detail(result) ?? 'unknown error'}`,
145 };
146 }
147 return { ok: true, message: `Kimi server started (${KIMI_SERVER_TASK_NAME}).` };
148 }
149
150 async function stop(): Promise<LifecycleResult> {
151 const result = await deps.execSchtasks(['/End', '/TN', KIMI_SERVER_TASK_NAME]);

Callers

nothing calls this directly

Calls 3

taskExistsMethod · 0.80
execSchtasksMethod · 0.80
detailFunction · 0.70

Tested by

no test coverage detected