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

Function collapseToSingleLine

packages/cli/src/pi-transcript-format.ts:154–156  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

152
153/** Fold line breaks into spaces so a summary can never split a one-line slot. */
154export function collapseToSingleLine(text: string): string {
155 return text.replace(/\s*\n\s*/g, ' ');
156}
157
158export function limitText(text: string, maxChars: number): string {
159 if (text.length <= maxChars) return text;

Callers 2

renderCompactToolBlockFunction · 0.85
compactAnnotationFunction · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected