MCPcopy
hub / github.com/Dimillian/CodexMonitor / truncateText

Function truncateText

src/utils/threadItems.shared.ts:34–40  ·  view source on GitHub ↗
(text: string, maxLength = MAX_ITEM_TEXT)

Source from the content-addressed store, hash-verified

32}
33
34export function truncateText(text: string, maxLength = MAX_ITEM_TEXT) {
35 if (text.length <= maxLength) {
36 return text;
37 }
38 const sliceLength = Math.max(0, maxLength - 3);
39 return `${text.slice(0, sliceLength)}...`;
40}
41
42export function truncateToolText(toolType: string, text: string) {
43 const maxLength = LARGE_TOOL_TYPES.has(toolType)

Callers 3

normalizeItemFunction · 0.90
prepareThreadItemsFunction · 0.90
truncateToolTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected