MCPcopy Create free account
hub / github.com/agent-tower/core / buildTextPreview

Function buildTextPreview

packages/server/src/services/task.service.ts:182–188  ·  view source on GitHub ↗
(value: string | null | undefined, maxLength = TASK_PREVIEW_MAX_LENGTH)

Source from the content-addressed store, hash-verified

180 sourceEndOffsets: number[];
181} {
182 let compacted = '';
183 let sourceOffset = 0;
184 let pendingWhitespaceEnd = 0;
185 let hasPendingWhitespace = false;
186 const sourceEndOffsets: number[] = [];
187
188 for (const character of value) {
189 sourceOffset += character.length;
190 if (/\s/u.test(character)) {
191 if (compacted.length > 0) {

Callers 5

contentPreviewMethod · 0.85
compactContentPreviewMethod · 0.85
withTaskPreviewsFunction · 0.85
findBodyByIdMethod · 0.85

Calls 3

truncateWithEllipsisFunction · 0.85
trimMethod · 0.80
compactWhitespaceFunction · 0.70

Tested by

no test coverage detected