/** * Localhost detection + loopback retry helpers for HTTP MCP connections. * * Extracted purely so the retry-decision logic is unit-testable on any platform * (we have no Windows CI). Windows 11 resolves `localhost` → ::1 (IPv6) first, * but many MCP servers (Playwright MCP `--port`, Node's default HTTP listen) * bind to 127.0.0.1 (IPv4-only). The client's first `fetch` then hits a dead * socket (ECONNREFUSED). These helpers decide whether a connect is local and, * on failure, which alternate hostname to retry with. */ /** Whether a URL points at the local machine (no OAuth, retry-eligible). */ export declare function isLocalhost(url: URL): boolean; /** * The alternate loopback hostname to try when a localhost connect fails, or * `undefined` if the hostname isn't a known loopback (so a retry would be * pointless). Maps between the IPv4 / IPv6 / name representations. */ export declare function alternateLoopback(hostname: string): string | undefined; /** * Whether an error is a low-level network failure (worth a loopback retry) vs. * a protocol/auth error (not — retrying won't help). Node's `fetch` surfaces * these as `TypeError: fetch failed` wrapping a `cause` with a code like * `ECONNREFUSED`; the SSE transport surfaces `SseError`. We check the message, * the cause message, and the cause code. */ export declare function isNetworkError(err: unknown): boolean; //# sourceMappingURL=loopback.d.ts.map