* 完成解析
(exitCode?: number)
| 461 | |
| 462 | return lines.join('\n'); |
| 463 | } |
| 464 | |
| 465 | private formatJsonValue(value: unknown): string { |
| 466 | if (typeof value === 'string') { |
| 467 | return stripAnsiSequences(value); |
| 468 | } |
| 469 | |
| 470 | try { |
| 471 | return stripAnsiSequences(JSON.stringify(value, null, 2)); |
| 472 | } catch { |
| 473 | return stripAnsiSequences(String(value)); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | private getMcpToolStatus(item: CodexItem): ToolStatus { |
| 478 | const rawStatus = item.status?.toLowerCase(); |
| 479 | |
| 480 | if (item.error != null) return 'failed'; |
| 481 | if (rawStatus === 'completed' || rawStatus === 'success' || rawStatus === 'succeeded') return 'success'; |
| 482 | if (rawStatus === 'failed' || rawStatus === 'error' || rawStatus === 'cancelled' || rawStatus === 'canceled') return 'failed'; |
| 483 | if (rawStatus === 'denied') return 'denied'; |
| 484 | if (rawStatus === 'pending_approval') return 'pending_approval'; |
| 485 | if (rawStatus === 'timed_out' || rawStatus === 'timeout') return 'timed_out'; |
nothing calls this directly
no test coverage detected