mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 05:37:29 +08:00
26 lines
513 B
Go
26 lines
513 B
Go
package tools
|
|
|
|
import (
|
|
"path/filepath"
|
|
)
|
|
|
|
func normalizeMemoryNamespace(in string) string {
|
|
v := normalizeSubagentIdentifier(in)
|
|
if v == "" {
|
|
return "main"
|
|
}
|
|
return v
|
|
}
|
|
|
|
func memoryNamespaceBaseDir(workspace, namespace string) string {
|
|
ns := normalizeMemoryNamespace(namespace)
|
|
if ns == "main" {
|
|
return workspace
|
|
}
|
|
return filepath.Join(workspace, "agents", ns)
|
|
}
|
|
|
|
func parseMemoryNamespaceArg(args map[string]interface{}) string {
|
|
return normalizeMemoryNamespace(MapStringArg(args, "namespace"))
|
|
}
|