* Build the `(part · part)` annotation for a compact row: duration/status * first, then the outcome. While running only the duration part shows * (`(running 12s)`). A placeholder outcome (`no output`) appears only when it * would be the annotation's sole content — `(5s)` needs no silence disclaim
(entry: MakaPiToolEntry)
| 90 | * are): only protected annotations are reserved whole during truncation. |
| 91 | */ |
| 92 | function compactAnnotation(entry: MakaPiToolEntry): { text: string; protect: boolean } { |
| 93 | const parts: string[] = []; |
| 94 | const duration = toolDurationText(entry); |
| 95 | if (duration) parts.push(duration); |
| 96 | let protect = true; |
| 97 | if (entry.status !== 'running') { |
| 98 | const summary = compactToolSummary(entry); |
| 99 | if (summary && !(summary.placeholder && parts.length > 0)) { |
| 100 | parts.push(collapseToSingleLine(summary.text)); |
| 101 | protect = summary.protect === true; |
| 102 | } |
| 103 | } |
| 104 | return { text: parts.length > 0 ? `(${parts.join(' · ')})` : '', protect }; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Lay out `head target (annotation)` on one line. A protected annotation is |
no test coverage detected