(serviceName: string)
| 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 |
no test coverage detected