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

Function renderThinkingBlock

packages/cli/src/pi-transcript.ts:1520–1530  ·  view source on GitHub ↗
(
  entry: MakaPiThinkingEntry,
  width: number,
  expanded: boolean,
)

Source from the content-addressed store, hash-verified

1518// Thinking stays collapsed to a one-line marker by default so reasoning
1519// never floods the scrollback; Ctrl+T expands every thinking entry on demand.
1520function renderThinkingBlock(
1521 entry: MakaPiThinkingEntry,
1522 width: number,
1523 expanded: boolean,
1524): string[] {
1525 if (!entry.text.trim()) return [];
1526 if (!expanded) return [fitLine(ansi.dim('Thinking…'), width)];
1527 const lines = [fitLine(ansi.dim('Thinking'), width)];
1528 lines.push(...renderIndented(entry.text, width, 2).map((line) => fitLine(ansi.dim(line), width)));
1529 return lines;
1530}
1531
1532type MakaPiAssistantEntry = Extract<MakaPiTranscriptEntry, { kind: 'assistant' }>;
1533type MakaPiThinkingEntry = Extract<MakaPiTranscriptEntry, { kind: 'thinking' }>;

Callers 1

Calls 4

fitLineFunction · 0.85
renderIndentedFunction · 0.85
pushMethod · 0.65
trimMethod · 0.45

Tested by

no test coverage detected