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

Function normalizeTaskTitle

packages/server/src/services/task.service.ts:90–96  ·  view source on GitHub ↗
(title: string)

Source from the content-addressed store, hash-verified

88 }
89
90 const limit = Math.max(1, maxLength - 3);
91 const sliced = value.slice(0, limit);
92 const boundary = Math.max(
93 sliced.lastIndexOf(' '),
94 sliced.lastIndexOf(','),
95 sliced.lastIndexOf('。'),
96 sliced.lastIndexOf(','),
97 sliced.lastIndexOf('.')
98 );
99 const candidate = boundary >= Math.floor(limit * 0.6) ? sliced.slice(0, boundary) : sliced;

Callers 3

deriveTitleFromBodyFunction · 0.85
normalizeCreateTaskInputFunction · 0.85
normalizeUpdateTaskInputFunction · 0.85

Calls 2

truncateWithEllipsisFunction · 0.85
compactWhitespaceFunction · 0.70

Tested by

no test coverage detected