MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / inferCatalogFile

Function inferCatalogFile

internal/metadata/catalog.go:28–40  ·  view source on GitHub ↗
(root string, kind entities.Kind)

Source from the content-addressed store, hash-verified

26}
27
28func inferCatalogFile(root string, kind entities.Kind) string {
29 for _, candidate := range catalogCandidates(kind) {
30 path := filepath.Join(root, filepath.FromSlash(candidate))
31 data, err := os.ReadFile(path)
32 if err != nil {
33 continue
34 }
35 if len(parseCatalogMarkdown(string(data), candidate, kind)) > 0 {
36 return candidate
37 }
38 }
39 return ""
40}
41
42func catalogCandidates(kind entities.Kind) []string {
43 plural := string(kind) + "s"

Callers 3

fetchAndDiscoverMethod · 0.85
TestInferCatalogFileFunction · 0.85

Calls 3

catalogCandidatesFunction · 0.85
parseCatalogMarkdownFunction · 0.85
ReadFileMethod · 0.80

Tested by 2

TestInferCatalogFileFunction · 0.68