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

Method connectOnce

projects/runtime-client/src/client.ts:292–305  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

290 }
291
292 private async connectOnce(): Promise<void> {
293 await this.transport.connect()
294 this.disposeMessageListener = this.transport.onMessage((message) => {
295 if (!isRuntimeNotification(message)) return
296 for (const listener of this.listeners) listener(message)
297 })
298 await this.requestRaw("initialize", {
299 clientName: this.options.clientName ?? "Runtime Local Client",
300 clientPlatform: this.options.clientPlatform ?? "desktop",
301 ...(this.options.clientVersion ? { clientVersion: this.options.clientVersion } : {}),
302 protocolVersion: this.options.protocolVersion ?? 1,
303 })
304 this.connected = true
305 }
306
307 subscribe(listener: NotificationListener): () => void {
308 this.listeners.add(listener)

Callers 1

connectMethod · 0.95

Calls 5

requestRawMethod · 0.95
isRuntimeNotificationFunction · 0.90
connectMethod · 0.65
onMessageMethod · 0.65
listenerFunction · 0.50

Tested by

no test coverage detected