Type: simplification (DRY) · Difficulty: medium
The loopback server URL is rebuilt inline in ~8 places even though httpClient.baseUrl() (packages/cli/src/httpClient.ts:7) already owns it: serverSpawn.ts:115, mcpInstall.ts:28, SetupCommand.ts:58, bootConfig.ts:83. Separately, four commands hand-roll a /health fetch with no timeout — IndexCommand.ts:41, IngestCommand.ts:44, LsCommand.ts:29, PullCommand.ts:46 — unlike every call in httpClient.ts which uses AbortSignal.timeout.
Do: export baseUrl() (+ mcpUrl(), healthUrl()) and an isServerHealthy() helper (with a short AbortSignal.timeout) from httpClient.ts; replace the inline copies.
Done when: no command builds the loopback URL or probes /health inline; the health probe has a timeout.
Type: simplification (DRY) · Difficulty: medium
The loopback server URL is rebuilt inline in ~8 places even though
httpClient.baseUrl()(packages/cli/src/httpClient.ts:7) already owns it:serverSpawn.ts:115,mcpInstall.ts:28,SetupCommand.ts:58,bootConfig.ts:83. Separately, four commands hand-roll a/healthfetchwith no timeout —IndexCommand.ts:41,IngestCommand.ts:44,LsCommand.ts:29,PullCommand.ts:46— unlike every call inhttpClient.tswhich usesAbortSignal.timeout.Do: export
baseUrl()(+mcpUrl(),healthUrl()) and anisServerHealthy()helper (with a shortAbortSignal.timeout) fromhttpClient.ts; replace the inline copies.Done when: no command builds the loopback URL or probes
/healthinline; the health probe has a timeout.