MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / priority

Function priority

graph-ui/src/architecture/container-source.ts:120–124  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

118function fairSourcePaths(paths: string[], project: ServiceProject, services: ContainerTopology['services']): string[] {
119 const available = new Map(paths.map(path => [normalizeSourcePath(project.rootPath, path), path]));
120 const priority = (path: string) => {
121 const name = path.split('/').at(-1) ?? '';
122 if (/(?:impl|client|gateway|transport)\.[^.]+$/i.test(name)) return 0;
123 return /(?:service|controller|repository)/i.test(name) ? 1 : 2;
124 };
125 const queues = [...services].sort((a, b) => a.id.localeCompare(b.id)).map(service => service.sourcePaths
126 .flatMap(path => available.has(path) ? [available.get(path)!] : [])
127 .sort((a, b) => priority(a) - priority(b) || a.localeCompare(b))).filter(queue => queue.length);

Callers 1

fairSourcePathsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected