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

Method Get

internal/daemon/memory_runtime.go:916–936  ·  view source on GitHub ↗
(
	ctx context.Context,
	workspaceID string,
	name string,
)

Source from the content-addressed store, hash-verified

914}
915
916func (s daemonMemoryProviderService) Get(
917 ctx context.Context,
918 workspaceID string,
919 name string,
920) (contract.MemoryProviderPayload, error) {
921 if s.registry == nil {
922 return contract.MemoryProviderPayload{}, errors.New("daemon: memory provider registry is not configured")
923 }
924 active, activeErr := s.registry.Select(ctx, workspaceID, "")
925 if activeErr != nil && !isMemoryProviderNotFound(activeErr) {
926 return contract.MemoryProviderPayload{}, activeErr
927 }
928 registration, err := s.registry.Select(ctx, workspaceID, name)
929 if err != nil {
930 if isMemoryProviderNotFound(err) {
931 return contract.MemoryProviderPayload{}, fmt.Errorf("%w: %w", os.ErrNotExist, err)
932 }
933 return contract.MemoryProviderPayload{}, err
934 }
935 return memoryProviderPayload(registration, registration.Name == active.Name), nil
936}
937
938func (s daemonMemoryProviderService) Select(
939 ctx context.Context,

Callers 4

SelectMethod · 0.95
EnableMethod · 0.95
DisableMethod · 0.95

Calls 3

isMemoryProviderNotFoundFunction · 0.85
memoryProviderPayloadFunction · 0.85
SelectMethod · 0.65

Tested by 1