MCPcopy Create free account
hub / github.com/google-gemini/gemini-cli / cleanMessage

Function cleanMessage

packages/cli/src/utils/sessionUtils.ts:151–156  ·  view source on GitHub ↗
(message: string)

Source from the content-addressed store, hash-verified

149 * @returns Sanitized message suitable for display
150 */
151export const cleanMessage = (message: string): string =>
152 message
153 .replace(/\n+/g, ' ')
154 .replace(/\s+/g, ' ')
155 .replace(/[^\x20-\x7E]+/g, '') // Non-printable.
156 .trim();
157
158/**
159 * Extracts the first meaningful user message from conversation messages.

Callers 3

extractFirstUserMessageFunction · 0.85
getAllSessionFilesFunction · 0.85
findTextMatchesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected