* Spawn a gateway from the local monorepo as a child process. * * Used when the operator picks 2+ agents in Compose and has no * gateway in Contacts yet — instead of asking them to `cd gateway && * npm start` in another terminal, comms launches it directly. * * Flow: * 1. Locate `gateway/`
| 925 | * persist these across restarts; that's a phase-3 concern. |
| 926 | */ |
| 927 | interface SpawnedGateway { |
| 928 | child: ChildProcess; |
| 929 | /** True iff this gateway was started with BINDU_GATEWAY_TLS_* in its |
| 930 | * env (Phase C). False means it serves plain HTTP and presents no |
| 931 | * client cert on outbound A2A. We track this so that when the personal |
| 932 | * agent comes up AFTER a gateway was already spawned, recycleStaleGateways |
| 933 | * can SIGTERM the HTTP one so the next /api/plan respawns it with TLS. */ |
| 934 | hasTls: boolean; |
| 935 | } |
| 936 | const spawnedGateways = new Map<string, SpawnedGateway>(); |
| 937 | |
| 938 | type GatewayHandle = |
nothing calls this directly
no outgoing calls
no test coverage detected