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

Function sortForMatching

src/utils/model/modelCapabilities.ts:55–59  ·  view source on GitHub ↗
(models: ModelCapability[])

Source from the content-addressed store, hash-verified

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

Callers 1

refreshModelCapabilitiesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected