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

Method Save

internal/desktop/entity_service.go:49–66  ·  view source on GitHub ↗
(kind string, input EntityDTO)

Source from the content-addressed store, hash-verified

47}
48
49func (s *EntityService) Save(kind string, input EntityDTO) (EntityDTO, error) {
50 store, err := entityStore(kind)
51 if err != nil {
52 return EntityDTO{}, err
53 }
54 entity := entities.Entity{
55 Name: input.Name, Description: input.Description, Content: input.Content, Path: input.Path,
56 Apps: input.Apps, Tags: input.Tags, Metadata: input.Metadata,
57 }
58 if err := store.Put(entity); err != nil {
59 return EntityDTO{}, wrapError("ENTITY_SAVE_FAILED", err)
60 }
61 saved, err := store.Get(input.Name)
62 if err != nil {
63 return EntityDTO{}, wrapError("ENTITY_LOAD_FAILED", err)
64 }
65 return entityDTO(saved), nil
66}
67
68func (s *EntityService) Uninstall(kind, name string) (OperationResult, error) {
69 store, err := entityStore(kind)

Callers 2

InstallMethod · 0.95

Calls 5

entityStoreFunction · 0.85
wrapErrorFunction · 0.85
entityDTOFunction · 0.85
PutMethod · 0.80
GetMethod · 0.45

Tested by 1