(line: string)
| 74 | } |
| 75 | |
| 76 | export function parseDevcontainerStdoutLine(line: string): DevcontainerStdoutParse | null { |
| 77 | const trimmed = line.trim(); |
| 78 | if (!trimmed) return null; |
| 79 | if (!trimmed.startsWith("{")) { |
| 80 | return { kind: "raw", text: line }; |
| 81 | } |
| 82 | |
| 83 | const parsed = parseJsonLine(trimmed); |
| 84 | if (!parsed) { |
| 85 | return { kind: "raw", text: line }; |
| 86 | } |
| 87 | |
| 88 | if (isDevcontainerUpResult(parsed)) { |
| 89 | return { kind: "result", result: parsed }; |
| 90 | } |
| 91 | |
| 92 | if (isRecord(parsed)) { |
| 93 | const text = extractDevcontainerLogText(parsed); |
| 94 | if (text) { |
| 95 | return { kind: "log", text }; |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | return null; |
| 100 | } |
| 101 | |
| 102 | export function formatDevcontainerUpError( |
| 103 | result: DevcontainerUpResultLine, |
no test coverage detected