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

Function DiscoverCatalogResources

internal/metadata/catalog.go:15–26  ·  view source on GitHub ↗

DiscoverCatalogResources reads a generated markdown catalog file from a repo and turns each catalog table row into a resource. Generated awesome repos use these tables instead of concrete SKILL.md/plugin.json manifests.

(root, catalogFile string, kind entities.Kind)

Source from the content-addressed store, hash-verified

13// and turns each catalog table row into a resource. Generated awesome repos use
14// these tables instead of concrete SKILL.md/plugin.json manifests.
15func DiscoverCatalogResources(root, catalogFile string, kind entities.Kind) []DiscoveredResource {
16 catalogFile = strings.TrimSpace(strings.Trim(catalogFile, "/"))
17 if catalogFile == "" {
18 return nil
19 }
20 path := filepath.Join(root, filepath.FromSlash(catalogFile))
21 data, err := os.ReadFile(path)
22 if err != nil {
23 return nil
24 }
25 return parseCatalogMarkdown(string(data), filepath.ToSlash(catalogFile), kind)
26}
27
28func inferCatalogFile(root string, kind entities.Kind) string {
29 for _, candidate := range catalogCandidates(kind) {

Callers 2

fetchAndDiscoverMethod · 0.85

Calls 2

parseCatalogMarkdownFunction · 0.85
ReadFileMethod · 0.80

Tested by 1