()
| 152 | } |
| 153 | |
| 154 | async function stop(): Promise<LifecycleResult> { |
| 155 | const target = `${deps.guiDomain()}/${KIMI_SERVER_LABEL}`; |
| 156 | const result = await deps.execLaunchctl(['kill', 'SIGTERM', target]); |
| 157 | if (result.code !== 0) { |
| 158 | |
| 159 | const bootout = await deps.execLaunchctl(['bootout', target]); |
| 160 | if (bootout.code !== 0) { |
| 161 | return { |
| 162 | ok: false, |
| 163 | message: `launchctl kill + bootout both failed: ${detail(result) ?? 'unknown'} / ${detail(bootout) ?? 'unknown'}`, |
| 164 | }; |
| 165 | } |
| 166 | } |
| 167 | return { ok: true, message: `Kimi server stopped (${KIMI_SERVER_LABEL}).` }; |
| 168 | } |
| 169 | |
| 170 | async function restart(): Promise<LifecycleResult> { |
| 171 | const target = `${deps.guiDomain()}/${KIMI_SERVER_LABEL}`; |
nothing calls this directly
no test coverage detected