()
| 271 | } |
| 272 | |
| 273 | private createDefaultSdkClient(): SdkClientLike { |
| 274 | return new Client( |
| 275 | { |
| 276 | name: this.options.clientName ?? DEFAULT_CLIENT_NAME, |
| 277 | version: this.options.clientVersion ?? '0.1.0', |
| 278 | }, |
| 279 | { |
| 280 | capabilities: {}, |
| 281 | listChanged: { |
| 282 | tools: { |
| 283 | onChanged: (error, tools) => { |
| 284 | if (error || !tools) { |
| 285 | this.cachedTools = undefined; |
| 286 | this.discoveredTools = undefined; |
| 287 | return; |
| 288 | } |
| 289 | |
| 290 | try { |
| 291 | this.cachedTools = [...tools]; |
| 292 | this.discoveredTools = discoverLearnTools(this.cachedTools); |
| 293 | } catch { |
| 294 | this.cachedTools = [...tools]; |
| 295 | this.discoveredTools = undefined; |
| 296 | } |
| 297 | }, |
| 298 | }, |
| 299 | }, |
| 300 | }, |
| 301 | ); |
| 302 | } |
| 303 | |
| 304 | private createTransport(sessionId?: string): TransportLike { |
| 305 | if (this.options.createTransport) { |
no test coverage detected