(socket: WebSocket)
| 205 | } |
| 206 | |
| 207 | private async initializeSocket(socket: WebSocket): Promise<void> { |
| 208 | await this.sendRequest(socket, "initialize", { |
| 209 | clientName: this.options.clientName ?? "Runtime Client", |
| 210 | clientPlatform: this.options.clientPlatform ?? "unknown", |
| 211 | ...(this.options.clientVersion ? { clientVersion: this.options.clientVersion } : {}), |
| 212 | protocolVersion: this.options.protocolVersion ?? 1, |
| 213 | }) |
| 214 | if (this.lastCursor) { |
| 215 | await this.sendRequest(socket, "subscription/update", { methods: ["*"], cursor: this.lastCursor }) |
| 216 | } |
| 217 | this.emitStatus("connected") |
| 218 | } |
| 219 | |
| 220 | private emitStatus(status: RuntimeClientStatus): void { |
| 221 | if (this.lastStatus === status) return |
no test coverage detected