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

Function renderCompactToolBlock

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

* Compact tool card: a single line — `● Name target (annotation)`. The disc * carries the status color (green done / blue running / red failed / grey * detached); the parenthesized annotation carries the outcome in short fixed * shapes: counts (`5 matches`, `3 lines`), sizes (`42 bytes`), a diff

(entry: MakaPiToolEntry, width: number)

Source from the content-addressed store, hash-verified

70 * whole during truncation: a long command can never hide an `exit 1`.
71 */
72function renderCompactToolBlock(entry: MakaPiToolEntry, width: number): string[] {
73 const inputSummary = collapseToSingleLine(toolInputSummary(entry));
74 const head = `${toolDisc(entry)} ${entry.title ?? entry.toolName}`;
75 const annotation = compactAnnotation(entry);
76 return [
77 fitLine(
78 assembleCompactToolRow(head, inputSummary, annotation.text, width, annotation.protect),
79 width,
80 ),
81 ];
82}
83
84/**
85 * Build the `(part · part)` annotation for a compact row: duration/status

Callers 1

renderToolBlockFunction · 0.85

Calls 6

collapseToSingleLineFunction · 0.85
toolInputSummaryFunction · 0.85
toolDiscFunction · 0.85
compactAnnotationFunction · 0.85
fitLineFunction · 0.85
assembleCompactToolRowFunction · 0.85

Tested by

no test coverage detected