MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isExecutorServerReachable

Function isExecutorServerReachable

apps/cli/src/daemon.ts:88–98  ·  view source on GitHub ↗
(
  input: ExecutorServerReachabilityInput,
)

Source from the content-addressed store, hash-verified

86};
87
88export const isExecutorServerReachable = (
89 input: ExecutorServerReachabilityInput,
90): Effect.Effect<boolean> =>
91 Effect.tryPromise(async () => {
92 // The unauthenticated liveness probe — never forwards a credential, so a
93 // misconfigured base URL can't leak the bearer token to a third-party host.
94 const url = new URL("/api/health", input.baseUrl);
95 const response = await fetch(url, { signal: AbortSignal.timeout(2000) });
96 const body = await response.text();
97 return response.ok && body.trim() === "ok";
98 }).pipe(Effect.catchCause(() => Effect.succeed(false)));
99
100// ---------------------------------------------------------------------------
101// Process spec

Callers 2

daemon.test.tsFile · 0.90
isServerReachableFunction · 0.90

Calls 2

textMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected