| 1298 | } |
| 1299 | |
| 1300 | func 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 | |
| 1312 | func parseOptionalCLIAgentTier(raw string) (memcontract.AgentTier, error) { |
| 1313 | tier := memcontract.AgentTier(strings.TrimSpace(raw)).Normalize() |