(server: Command)
| 45 | } |
| 46 | |
| 47 | export function registerKillCommand(server: Command): void { |
| 48 | server |
| 49 | .command('kill') |
| 50 | .description('Stop the running Kimi server (graceful API + forced PID kill).') |
| 51 | .action(async () => { |
| 52 | try { |
| 53 | await handleKillCommand(DEFAULT_KILL_DEPS); |
| 54 | } catch (error) { |
| 55 | process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`); |
| 56 | process.exit(1); |
| 57 | } |
| 58 | }); |
| 59 | } |
| 60 | |
| 61 | export async function handleKillCommand(deps: KillCommandDeps): Promise<void> { |
| 62 | const lock = deps.getLiveLock(); |
no test coverage detected