(forceRefresh = false)
| 95 | } |
| 96 | |
| 97 | async getToolMapping(forceRefresh = false): Promise<DiscoveredLearnTools> { |
| 98 | await this.loadPersistentCache(); |
| 99 | |
| 100 | if (!forceRefresh && this.cachedTools && this.discoveredTools) { |
| 101 | return this.discoveredTools; |
| 102 | } |
| 103 | |
| 104 | await this.ensureConnected(); |
| 105 | |
| 106 | if (forceRefresh || !this.cachedTools || !this.discoveredTools) { |
| 107 | this.cachedTools = await this.listAllTools(); |
| 108 | this.discoveredTools = discoverLearnTools(this.cachedTools); |
| 109 | await this.persistCache(); |
| 110 | } |
| 111 | |
| 112 | return this.discoveredTools; |
| 113 | } |
| 114 | |
| 115 | async searchDocs(query: string): Promise<string> { |
| 116 | const result = await this.callMappedTool('docsSearch', { query }); |
no test coverage detected