(allowedTools []string, cacheMemoryConfig *CacheMemoryConfig)
| 255 | } |
| 256 | |
| 257 | func appendCacheMemoryTools(allowedTools []string, cacheMemoryConfig *CacheMemoryConfig) []string { |
| 258 | if cacheMemoryConfig == nil { |
| 259 | return allowedTools |
| 260 | } |
| 261 | for _, cache := range cacheMemoryConfig.Caches { |
| 262 | cacheDir := cacheMemoryDirFor(cache.ID) |
| 263 | cacheDirPattern := cacheDir + "/*" |
| 264 | allowedTools = sliceutil.MergeUnique(allowedTools, fmt.Sprintf("Read(%s)", cacheDirPattern)) |
| 265 | allowedTools = sliceutil.MergeUnique(allowedTools, fmt.Sprintf("Write(%s)", cacheDirPattern)) |
| 266 | allowedTools = sliceutil.MergeUnique(allowedTools, fmt.Sprintf("Edit(%s)", cacheDirPattern)) |
| 267 | allowedTools = sliceutil.MergeUnique(allowedTools, fmt.Sprintf("MultiEdit(%s)", cacheDirPattern)) |
| 268 | allowedTools = appendCacheMemoryBashTools(allowedTools, cacheDir) |
| 269 | } |
| 270 | return allowedTools |
| 271 | } |
| 272 | |
| 273 | func appendCacheMemoryBashTools(allowedTools []string, cacheDir string) []string { |
| 274 | if slices.Contains(allowedTools, "Bash") { |
no test coverage detected