MCPcopy Create free account
hub / github.com/github/gh-aw / appendCacheMemoryTools

Function appendCacheMemoryTools

pkg/workflow/claude_tools.go:257–271  ·  view source on GitHub ↗
(allowedTools []string, cacheMemoryConfig *CacheMemoryConfig)

Source from the content-addressed store, hash-verified

255}
256
257func 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
273func appendCacheMemoryBashTools(allowedTools []string, cacheDir string) []string {
274 if slices.Contains(allowedTools, "Bash") {

Callers 1

Calls 3

MergeUniqueFunction · 0.92
cacheMemoryDirForFunction · 0.85

Tested by

no test coverage detected