| 16 | |
| 17 | /** The unauthenticated health endpoint every Executor server exposes. */ |
| 18 | const probeServer = async (): Promise<boolean> => { |
| 19 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-raw-fetch -- boundary: fetch rejects when the server is down, which is precisely the signal being read |
| 20 | try { |
| 21 | const response = await fetch("/api/health", { cache: "no-store" }); |
| 22 | return response.ok && (await response.text()).trim() === "ok"; |
| 23 | } catch { |
| 24 | return false; |
| 25 | } |
| 26 | }; |
| 27 | |
| 28 | const showDisconnectedOverlay = (): void => { |
| 29 | if (document.getElementById(OVERLAY_ID)) return; |