MCPcopy Create free account
hub / github.com/Noumena-Network/code / deriveSessionTitle

Function deriveSessionTitle

src/bridge/bridgeMain.ts:1973–1977  ·  view source on GitHub ↗

Derive a session title from a user message: first line, truncated.

(text: string)

Source from the content-addressed store, hash-verified

1971
1972/** Derive a session title from a user message: first line, truncated. */
1973function deriveSessionTitle(text: string): string {
1974 // Collapse whitespace — newlines/tabs would break the single-line status display.
1975 const flat = text.replace(/\s+/g, ' ').trim()
1976 return truncateToWidth(flat, TITLE_MAX_LEN)
1977}
1978
1979/**
1980 * One-shot fetch of a session's title via GET /v1/sessions/{id}.

Callers 1

runBridgeLoopFunction · 0.85

Calls 1

truncateToWidthFunction · 0.85

Tested by

no test coverage detected