(models: ModelCapability[])
| 52 | |
| 53 | // Longest-id-first so substring match prefers most specific; secondary key for stable isEqual |
| 54 | function sortForMatching(models: ModelCapability[]): ModelCapability[] { |
| 55 | return [...models].sort( |
| 56 | (a, b) => b.id.length - a.id.length || a.id.localeCompare(b.id), |
| 57 | ) |
| 58 | } |
| 59 | |
| 60 | // Keyed on cache path so tests that set CLAUDE_CONFIG_DIR get a fresh read |
| 61 | const loadCache = memoize( |
no outgoing calls
no test coverage detected