()
| 83 | } |
| 84 | |
| 85 | private initialize(): Promise<void> { |
| 86 | if (!this.initPromise) { |
| 87 | this.initPromise = this.doInitialize().catch((err) => { |
| 88 | this.initPromise = null; |
| 89 | throw err; |
| 90 | }); |
| 91 | } |
| 92 | return this.initPromise; |
| 93 | } |
| 94 | |
| 95 | /** Parse an SSE-streamed MCP response and return the first result text. */ |
| 96 | private async parseSseResponse(res: Response): Promise<string> { |