MCPcopy Create free account
hub / github.com/apache/maka / compactAnnotation

Function compactAnnotation

packages/cli/src/pi-transcript-tools.ts:92–105  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

90 * are): only protected annotations are reserved whole during truncation.
91 */
92function 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

Callers 1

renderCompactToolBlockFunction · 0.85

Calls 5

toolDurationTextFunction · 0.85
compactToolSummaryFunction · 0.85
collapseToSingleLineFunction · 0.85
joinMethod · 0.80
pushMethod · 0.65

Tested by

no test coverage detected