* Closing interface: Closes the DocsAgent engine via HTTP request.
()
| 238 | * Closing interface: Closes the DocsAgent engine via HTTP request. |
| 239 | */ |
| 240 | public async close(): Promise<void> { |
| 241 | try { |
| 242 | await this.request("/close", "GET"); |
| 243 | } catch { |
| 244 | // If request fails (e.g. already closed), fallback to local kill if we started it |
| 245 | if (this.process) { |
| 246 | this.process.kill(); |
| 247 | this.process = null; |
| 248 | } |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Starts an MCP server instance using this DocsAgent engine. |
no test coverage detected