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

Method Search

internal/desktop/entity_service.go:29–47  ·  view source on GitHub ↗
(kind, query string)

Source from the content-addressed store, hash-verified

27}
28
29func (s *EntityService) Search(kind, query string) ([]EntityDTO, error) {
30 all, err := s.List(kind)
31 if err != nil {
32 return nil, err
33 }
34 q := strings.ToLower(strings.TrimSpace(query))
35 if q == "" {
36 return all, nil
37 }
38 out := []EntityDTO{}
39 for _, entity := range all {
40 if strings.Contains(strings.ToLower(entity.Name), q) ||
41 strings.Contains(strings.ToLower(entity.Description), q) ||
42 strings.Contains(strings.ToLower(strings.Join(entity.Tags, " ")), q) {
43 out = append(out, entity)
44 }
45 }
46 return out, nil
47}
48
49func (s *EntityService) Save(kind string, input EntityDTO) (EntityDTO, error) {
50 store, err := entityStore(kind)

Callers 3

SearchRegistryMethod · 0.45
ListRegistryMethod · 0.45

Calls 1

ListMethod · 0.95

Tested by 1