MCPcopy Create free account
hub / github.com/compozy/agh / skillListItems

Function skillListItems

internal/cli/skill_workspace.go:140–166  ·  view source on GitHub ↗
(allSkills []*skills.Skill, sourceFilter string)

Source from the content-addressed store, hash-verified

138}
139
140func skillListItems(allSkills []*skills.Skill, sourceFilter string) ([]skillListItem, error) {
141 filter, err := normalizeSkillSourceFilter(sourceFilter)
142 if err != nil {
143 return nil, err
144 }
145
146 items := make([]skillListItem, 0, len(allSkills))
147 for _, skill := range allSkills {
148 if skill == nil {
149 continue
150 }
151
152 source := skillSourceLabel(skill.Source)
153 if filter != "" && source != filter {
154 continue
155 }
156
157 items = append(items, skillListItem{
158 Name: skill.Meta.Name,
159 Description: skill.Meta.Description,
160 Source: source,
161 Enabled: skill.Enabled,
162 })
163 }
164
165 return items, nil
166}
167
168func skillListItemsFromRecords(records []SkillRecord, sourceFilter string) ([]skillListItem, error) {
169 filter, err := normalizeSkillSourceFilter(sourceFilter)

Callers 1

newSkillListCommandFunction · 0.85

Calls 3

appendFunction · 0.85
skillSourceLabelFunction · 0.70

Tested by

no test coverage detected