(connection: EditorConnection, WebSocketImpl: typeof WebSocket)
| 388 | } |
| 389 | |
| 390 | function openEditorSocket(connection: EditorConnection, WebSocketImpl: typeof WebSocket) { |
| 391 | if (!connection.authToken) return new WebSocketImpl(connection.url) |
| 392 | |
| 393 | return new WebSocketImpl(connection.url, { |
| 394 | headers: { |
| 395 | "x-claude-code-ide-authorization": connection.authToken, |
| 396 | }, |
| 397 | } as any) |
| 398 | } |
| 399 | |
| 400 | function parseMessage(value: unknown) { |
| 401 | if (typeof value !== "string") return |