(surfaceKey: string)
| 86 | * Converts internal model variants to their public equivalents. |
| 87 | */ |
| 88 | export 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. |
nothing calls this directly
no test coverage detected