identifyLocalRepoKeys returns the set of repo keys that come from local sources (skill_repos.json files), as opposed to remote/bundled sources.
(kind entities.Kind)
| 772 | // identifyLocalRepoKeys returns the set of repo keys that come from local |
| 773 | // sources (skill_repos.json files), as opposed to remote/bundled sources. |
| 774 | func identifyLocalRepoKeys(kind entities.Kind) map[string]bool { |
| 775 | keys := make(map[string]bool) |
| 776 | |
| 777 | cfg, err := camconfig.Load("") |
| 778 | if err != nil { |
| 779 | return keys |
| 780 | } |
| 781 | repoKey := string(kind) + "s" |
| 782 | src, ok := cfg.Repositories[repoKey] |
| 783 | if !ok { |
| 784 | return keys |
| 785 | } |
| 786 | for _, s := range src.Sources { |
| 787 | if s.Type != "local" || s.Path == "" { |
| 788 | continue |
| 789 | } |
| 790 | local, err := repoconfig.LoadLocalSource(s.Path) |
| 791 | if err != nil || local == nil { |
| 792 | continue |
| 793 | } |
| 794 | for k := range local { |
| 795 | keys[k] = true |
| 796 | } |
| 797 | } |
| 798 | return keys |
| 799 | } |
| 800 | |
| 801 | // ============================================================================ |
| 802 | // Skill validation — verify results follow the skill standard |
no test coverage detected