MCPcopy Create free account
hub / github.com/diillson/chatcli / resolveRemoteSkillMeta

Method resolveRemoteSkillMeta

cli/skill_handler.go:645–657  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

643// Otherwise every configured registry is consulted and the richest result
644// wins under selectRichestRemote's rules.
645func (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:

Callers 1

InfoMethod · 0.95

Calls 3

selectRichestRemoteFunction · 0.85
GetSkillMetaFromMethod · 0.80
GetAllSkillMetaMethod · 0.80

Tested by

no test coverage detected