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

Function appendCacheMemoryBashTools

pkg/workflow/claude_tools.go:273–290  ·  view source on GitHub ↗
(allowedTools []string, cacheDir string)

Source from the content-addressed store, hash-verified

271}
272
273func 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
292func appendMCPToolPermissions(allowedTools []string, toolName string, toolValue any) []string {
293 mcpConfig, ok := toolValue.(map[string]any)

Callers 1

appendCacheMemoryToolsFunction · 0.85

Calls 1

MergeUniqueFunction · 0.92

Tested by

no test coverage detected