MCPcopy Create free account
hub / github.com/53AI/53AIHub / normalizeSandboxRuntimePath

Function normalizeSandboxRuntimePath

api/service/tools/executor.go:852–870  ·  view source on GitHub ↗
(fileName string)

Source from the content-addressed store, hash-verified

850}
851
852func normalizeSandboxRuntimePath(fileName string) (string, error) {
853 normalized, err := normalizeSandboxRelativePath(fileName)
854 if err != nil {
855 return "", err
856 }
857 if normalized == "" || normalized == "." {
858 return "", fmt.Errorf("missing path argument")
859 }
860 if strings.HasPrefix(normalized, "output/") || strings.HasPrefix(normalized, "outputs/") {
861 return normalized, nil
862 }
863 if strings.HasPrefix(normalized, "inputs/") || strings.HasPrefix(normalized, "tmp/") || strings.HasPrefix(normalized, "skills/") {
864 return normalized, nil
865 }
866 if shouldNormalizeSandboxDeliverablePath(normalized) {
867 return "output/" + filepath.Base(normalized), nil
868 }
869 return filepath.ToSlash(filepath.Join("inputs", normalized)), nil
870}
871
872func executeRunShell(ctx context.Context, args map[string]interface{}) (*ToolResult, error) {
873 command, ok := args["command"].(string)

Calls 3

ErrorfMethod · 0.80

Tested by

no test coverage detected