MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / probeReady

Function probeReady

projects/runtime-node/src/codexAppServerBridge.ts:160–175  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

158}
159
160function probeReady(url: string): Promise<boolean> {
161 return new Promise((resolve) => {
162 const parsed = new URL(url)
163 const client = parsed.protocol === "https:" ? https : http
164 const request = client.request(parsed, { method: "GET", timeout: 1000 }, (response) => {
165 response.resume()
166 resolve((response.statusCode ?? 0) >= 200 && (response.statusCode ?? 0) < 300)
167 })
168 request.once("timeout", () => {
169 request.destroy()
170 resolve(false)
171 })
172 request.once("error", () => resolve(false))
173 request.end()
174 })
175}
176
177export class RuntimeNodeCodexAppServerBridge implements RuntimeNodeServerProtocolAgentBridge {
178 readonly providerId: string

Callers 1

startManagedProcessMethod · 0.85

Calls 3

resolveFunction · 0.85
destroyMethod · 0.80
requestMethod · 0.65

Tested by

no test coverage detected