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

Function parseOptionalCLIMemoryScope

internal/cli/memory.go:1300–1310  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

1298}
1299
1300func parseOptionalCLIMemoryScope(raw string) (memcontract.Scope, error) {
1301 scope := memcontract.Scope(strings.TrimSpace(raw)).Normalize()
1302 switch scope {
1303 case "":
1304 return "", nil
1305 case memcontract.ScopeGlobal, memcontract.ScopeWorkspace, memcontract.ScopeAgent:
1306 return scope, nil
1307 default:
1308 return "", errors.New("memory.scope.invalid: scope must be one of global, workspace, or agent")
1309 }
1310}
1311
1312func parseOptionalCLIAgentTier(raw string) (memcontract.AgentTier, error) {
1313 tier := memcontract.AgentTier(strings.TrimSpace(raw)).Normalize()

Callers 3

TestMemoryBundleHelpersFunction · 0.85

Calls 2

ScopeMethod · 0.80
NormalizeMethod · 0.45

Tested by 1

TestMemoryBundleHelpersFunction · 0.68