MCPcopy Create free account
hub / github.com/openai/plugins / shutdown

Function shutdown

plugins/superpowers/skills/brainstorming/scripts/server.cjs:301–312  ·  view source on GitHub ↗
(reason)

Source from the content-addressed store, hash-verified

299 watcher.on('error', (err) => console.error('fs.watch error:', err.message));
300
301 function shutdown(reason) {
302 console.log(JSON.stringify({ type: 'server-stopped', reason }));
303 const infoFile = path.join(STATE_DIR, 'server-info');
304 if (fs.existsSync(infoFile)) fs.unlinkSync(infoFile);
305 fs.writeFileSync(
306 path.join(STATE_DIR, 'server-stopped'),
307 JSON.stringify({ reason, timestamp: Date.now() }) + '\n'
308 );
309 watcher.close();
310 clearInterval(lifecycleCheck);
311 server.close(() => process.exit(0));
312 }
313
314 function ownerAlive() {
315 if (!ownerPid) return true;

Callers 1

startServerFunction · 0.85

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected