(report: DoctorReport)
| 5 | } |
| 6 | |
| 7 | export function formatDoctorText(report: DoctorReport): string { |
| 8 | const lines = [ |
| 9 | `Overall: ${report.ok ? 'ok' : 'failed'}`, |
| 10 | `Runtime: Node ${report.runtime.version} (${report.runtime.supported ? 'supported' : 'unsupported'})`, |
| 11 | `Endpoint: ${report.endpoint}`, |
| 12 | `Reachability: ${report.reachability.ok ? 'ok' : 'failed'} (${report.reachability.detail})`, |
| 13 | `MCP connect: ${report.mcp.connected ? 'ok' : 'failed'}`, |
| 14 | `Tool discovery: ${report.mcp.discovered ? 'ok' : 'failed'}`, |
| 15 | 'Mapped tools:', |
| 16 | ` search: ${report.tools.docsSearch ?? 'missing'}`, |
| 17 | ` fetch: ${report.tools.docsFetch ?? 'missing'}`, |
| 18 | ` code-search: ${report.tools.codeSearch ?? 'missing'}`, |
| 19 | ]; |
| 20 | |
| 21 | if (report.errors.length > 0) { |
| 22 | lines.push('Errors:'); |
| 23 | for (const error of report.errors) { |
| 24 | lines.push(` - ${error}`); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | return ensureTrailingNewline(lines.join('\n')); |
| 29 | } |
no test coverage detected