@internal
(exchange: CopilotRequestExchange)
| 245 | |
| 246 | /** @internal */ |
| 247 | async [kHandle](exchange: CopilotRequestExchange): Promise<void> { |
| 248 | const bridge = new CopilotWebSocketResponseBridge(exchange); |
| 249 | const ctx: InternalContext = { |
| 250 | requestId: exchange.requestId, |
| 251 | sessionId: exchange.sessionId, |
| 252 | transport: exchange.transport, |
| 253 | url: exchange.url, |
| 254 | headers: exchange.headers, |
| 255 | signal: exchange.signal, |
| 256 | [kBridge]: bridge, |
| 257 | }; |
| 258 | |
| 259 | if (exchange.transport === "websocket") { |
| 260 | await this.#handleWebSocket(exchange, ctx); |
| 261 | } else { |
| 262 | await this.#handleHttp(exchange, ctx); |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | async #handleHttp(exchange: CopilotRequestExchange, ctx: CopilotRequestContext): Promise<void> { |
| 267 | const request = await buildFetchRequest(exchange); |
nothing calls this directly
no test coverage detected