(allowedTools []string, cacheDir string)
| 271 | } |
| 272 | |
| 273 | func appendCacheMemoryBashTools(allowedTools []string, cacheDir string) []string { |
| 274 | if slices.Contains(allowedTools, "Bash") { |
| 275 | return allowedTools |
| 276 | } |
| 277 | cacheDirSlash := cacheDir + "/" |
| 278 | bashCacheTools := []string{ |
| 279 | fmt.Sprintf("Bash(mkdir -p %s)", cacheDirSlash), |
| 280 | fmt.Sprintf("Bash(cat %s)", cacheDirSlash), |
| 281 | fmt.Sprintf("Bash(cat > %s)", cacheDirSlash), |
| 282 | fmt.Sprintf("Bash(mv %s)", cacheDirSlash), |
| 283 | } |
| 284 | for _, bashTool := range bashCacheTools { |
| 285 | allowedTools = sliceutil.MergeUnique(allowedTools, bashTool) |
| 286 | } |
| 287 | allowedTools = sliceutil.MergeUnique(allowedTools, "BashOutput") |
| 288 | allowedTools = sliceutil.MergeUnique(allowedTools, "KillBash") |
| 289 | return allowedTools |
| 290 | } |
| 291 | |
| 292 | func appendMCPToolPermissions(allowedTools []string, toolName string, toolValue any) []string { |
| 293 | mcpConfig, ok := toolValue.(map[string]any) |
no test coverage detected