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

Function uninstall

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

Source from the content-addressed store, hash-verified

113 }
114
115 async function uninstall(): Promise<LifecycleResult> {
116 if (!(await deps.taskExists())) {
117 deleteInstallPlan();
118 return { ok: true, message: 'Scheduled task was not installed; nothing to remove.' };
119 }
120
121 await deps.execSchtasks(['/End', '/TN', KIMI_SERVER_TASK_NAME]).catch(() => undefined);
122 const del = await deps.execSchtasks(['/Delete', '/TN', KIMI_SERVER_TASK_NAME, '/F']);
123 if (del.code !== 0) {
124 return {
125 ok: false,
126 message: `schtasks /Delete failed: ${detail(del) ?? 'unknown error'}`,
127 };
128 }
129 deleteInstallPlan();
130 return { ok: true, message: `Scheduled task removed (${KIMI_SERVER_TASK_NAME}).` };
131 }
132
133 async function start(): Promise<LifecycleResult> {
134 if (!(await deps.taskExists())) {

Callers

nothing calls this directly

Calls 4

deleteInstallPlanFunction · 0.90
taskExistsMethod · 0.80
execSchtasksMethod · 0.80
detailFunction · 0.70

Tested by

no test coverage detected