MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / cmdRestart

Function cmdRestart

dev/local/cli.ts:617–648  ·  view source on GitHub ↗
(serviceName: string)

Source from the content-addressed store, hash-verified

615 const previous = snapshotCloudAgentPublicTunnelEnv(repoRoot);
616 startServiceInTmux(sessionName, 'cloud-agent-public-tunnels', undefined, serviceNames);
617 const captured = await waitForCloudAgentPublicTunnelCapture(
618 repoRoot,
619 previous,
620 CAPTURE_TIMEOUT_MS
621 );
622 if (!captured) {
623 throw new Error(
624 'Public sandbox tunnel URLs were not captured. Check the cloud-agent-public-tunnels window.'
625 );
626 }
627 const cloudAgentPane = findServicePane(sessionName, 'cloud-agent-next');
628 if (cloudAgentPane) {
629 const outcome = await restartServiceInTmux(sessionName, 'cloud-agent-next');
630 if (outcome === 'gave-up') {
631 throw new Error('cloud-agent-next did not restart with public tunnel URLs');
632 }
633 }
634 }
635 console.log(
636 noAttach
637 ? `Session ${sessionName} already running.`
638 : `Session ${sessionName} already running — attaching.`
639 );
640 return noAttach ? undefined : sessionName;
641 }
642
643 if (serviceNames.includes('kiloclaw-docker-tcp')) {
644 try {
645 execSync('which socat', { stdio: 'ignore' });
646 } catch {
647 console.error('socat is not installed. Install it with: brew install socat');
648 process.exit(1);
649 }
650 }
651

Callers 1

mainFunction · 0.85

Calls 8

getServiceFunction · 0.90
getSessionNameFunction · 0.90
sessionExistsFunction · 0.90
findServicePaneFunction · 0.90
restartServiceInTmuxFunction · 0.90
hasMethod · 0.80
errorMethod · 0.65
logMethod · 0.65

Tested by

no test coverage detected