(raw string)
| 2520 | } |
| 2521 | |
| 2522 | func 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. |
| 2535 | func ResolveMemoryWorkspace(raw string) (string, error) { |
no test coverage detected