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

Function parseOptionalMemoryType

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

Source from the content-addressed store, hash-verified

1333}
1334
1335func parseOptionalMemoryType(raw string) (memcontract.Type, error) {
1336 typ := memcontract.Type(strings.TrimSpace(raw)).Normalize()
1337 if typ == "" {
1338 return "", nil
1339 }
1340 if err := typ.Validate(); err != nil {
1341 return "", err
1342 }
1343 return typ, nil
1344}
1345
1346func resolveMemoryContent(cmd *cobra.Command, deps commandDeps, raw string) (string, error) {
1347 flag := cmd.Flags().Lookup(memoryContentKey)

Callers 4

TestMemoryBundleHelpersFunction · 0.85
newMemoryListCommandFunction · 0.85
newMemoryEditCommandFunction · 0.85
parseRequiredMemoryTypeFunction · 0.85

Calls 2

ValidateMethod · 0.65
NormalizeMethod · 0.45

Tested by 1

TestMemoryBundleHelpersFunction · 0.68