MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / sanitizeSurfaceKey

Function sanitizeSurfaceKey

source code/utils/commitAttribution.ts:137–149  ·  view source on GitHub ↗
(surfaceKey: string)

Source from the content-addressed store, hash-verified

135 * Converts internal model variants to their public equivalents.
136 */
137export function sanitizeSurfaceKey(surfaceKey: string): string {
138 // Split surface key into surface and model parts (e.g., "cli/opus-4-5-fast" -> ["cli", "opus-4-5-fast"])
139 const slashIndex = surfaceKey.lastIndexOf('/')
140 if (slashIndex === -1) {
141 return surfaceKey
142 }
143
144 const surface = surfaceKey.slice(0, slashIndex)
145 const model = surfaceKey.slice(slashIndex + 1)
146 const sanitizedModel = sanitizeModelName(model)
147
148 return `${surface}/${sanitizedModel}`
149}
150
151// @[MODEL LAUNCH]: Add a mapping for the new model ID so git commit trailers show the public name.
152/**

Callers

nothing calls this directly

Calls 1

sanitizeModelNameFunction · 0.85

Tested by

no test coverage detected