feat: shared SSH wait utility with TCP pre-check and stderr capture (#1779)

Replace 5 duplicated SSH wait implementations (AWS, DO, Hetzner, GCP,
Sprite) with a shared two-phase utility in cli/src/shared/ssh.ts:

- Phase 1: cheap TCP probe (2s intervals) until port 22 opens
- Phase 2: full SSH handshake (3s intervals) with stderr capture
- Adds BatchMode=yes to prevent interactive prompt hangs
- Removes ~220 lines of duplicated sleep/SSH_OPTS/waitForSsh code

Daytona (token auth) and Fly (WireGuard) left unchanged — too different.

Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
A 2026-02-22 19:17:09 -08:00 committed by GitHub
parent b62dc1af33
commit 0843c5e708
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 189 additions and 219 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "0.7.0",
"version": "0.7.1",
"type": "module",
"bin": {
"spawn": "cli.js"