resolveRemoteSkillMeta returns the best registry-side metadata for the skill. When `fromRegistry` is set the query is limited to that registry. Otherwise every configured registry is consulted and the richest result wins under selectRichestRemote's rules.
( ctx context.Context, name, fromRegistry string, )
| 643 | // Otherwise every configured registry is consulted and the richest result |
| 644 | // wins under selectRichestRemote's rules. |
| 645 | func (sh *SkillHandler) resolveRemoteSkillMeta( |
| 646 | ctx context.Context, name, fromRegistry string, |
| 647 | ) *registry.SkillMeta { |
| 648 | if fromRegistry != "" { |
| 649 | meta, err := sh.registryMgr.GetSkillMetaFrom(ctx, name, fromRegistry) |
| 650 | if err != nil || meta == nil || meta.Name == "" { |
| 651 | return nil |
| 652 | } |
| 653 | return meta |
| 654 | } |
| 655 | allRemote := sh.registryMgr.GetAllSkillMeta(ctx, name) |
| 656 | return selectRichestRemote(allRemote) |
| 657 | } |
| 658 | |
| 659 | // selectRichestRemote picks the most useful remote-meta entry from a slice |
| 660 | // of candidates. Preference order: |
no test coverage detected