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

Function parseOptionalMemoryScope

internal/api/core/memory.go:2522–2532  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

2520}
2521
2522func parseOptionalMemoryScope(raw string) (memcontract.Scope, error) {
2523 scope := memcontract.Scope(strings.TrimSpace(raw)).Normalize()
2524 switch scope {
2525 case "":
2526 return "", nil
2527 case memcontract.ScopeGlobal, memcontract.ScopeWorkspace, memcontract.ScopeAgent:
2528 return scope, nil
2529 default:
2530 return "", NewMemoryValidationError(fmt.Errorf("scope must be one of global, workspace, or agent"))
2531 }
2532}
2533
2534// ResolveMemoryWorkspace validates and canonicalizes a workspace memory location.
2535func ResolveMemoryWorkspace(raw string) (string, error) {

Callers 4

resolveMemorySelectorMethod · 0.70
resolveMemoryWriteScopeFunction · 0.70
ParseOptionalMemoryScopeFunction · 0.70

Calls 3

NewMemoryValidationErrorFunction · 0.85
ScopeMethod · 0.80
NormalizeMethod · 0.45

Tested by

no test coverage detected