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