MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / normalizeThreadTitle

Function normalizeThreadTitle

shared/pi-message-mapper.ts:247–256  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

245}
246
247export function normalizeThreadTitle(value: unknown) {
248 const text = String(value || '')
249 .replace(/\s+/g, ' ')
250 .trim()
251 if (!text) {
252 return 'New thread'
253 }
254
255 return text.length > 72 ? `${text.slice(0, 69)}...` : text
256}
257
258function mapUserMessage(id: string, runtimeMessage: RuntimeMessage): Message | null {
259 const content = extractUserContent(runtimeMessage.content)

Callers 3

getFirstUserTurnTitleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected