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

Function renderUserBlock

packages/cli/src/pi-transcript.ts:1658–1664  ·  view source on GitHub ↗

A user turn: a dim `>` quote prefix per line, no speaker label.

(text: string, width: number)

Source from the content-addressed store, hash-verified

1656
1657/** A user turn: a dim `>` quote prefix per line, no speaker label. */
1658function renderUserBlock(text: string, width: number): string[] {
1659 if (!text.trim()) return [];
1660 const prefix = ansi.dim('>');
1661 // renderIndented reserves a 2-column gutter; reuse it and swap the two
1662 // leading spaces for `> ` so wrapped lines stay aligned under the prefix.
1663 return renderIndented(text, width, 2).map((line) => fitLine(`${prefix} ${line.slice(2)}`, width));
1664}
1665
1666function renderLegacyAutomationBlock(text: string, width: number): string[] {
1667 if (!text.trim()) return [];

Callers 1

Calls 3

renderIndentedFunction · 0.85
fitLineFunction · 0.85
trimMethod · 0.45

Tested by

no test coverage detected