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

Function sanitizeSurfaceKey

src/utils/commitAttribution.ts:88–100  ·  view source on GitHub ↗
(surfaceKey: string)

Source from the content-addressed store, hash-verified

86 * Converts internal model variants to their public equivalents.
87 */
88export function sanitizeSurfaceKey(surfaceKey: string): string {
89 // Split surface key into surface and model parts (e.g., "cli/opus-4-5-fast" -> ["cli", "opus-4-5-fast"])
90 const slashIndex = surfaceKey.lastIndexOf('/')
91 if (slashIndex === -1) {
92 return surfaceKey
93 }
94
95 const surface = surfaceKey.slice(0, slashIndex)
96 const model = surfaceKey.slice(slashIndex + 1)
97 const sanitizedModel = sanitizeModelName(model)
98
99 return `${surface}/${sanitizedModel}`
100}
101
102/**
103 * Sanitize a model name to its public equivalent.

Callers

nothing calls this directly

Calls 1

sanitizeModelNameFunction · 0.85

Tested by

no test coverage detected