chore: revert out-of-scope regex in shell.go to keep PR focused

This commit is contained in:
Andrew 2026-02-24 01:19:58 +00:00
parent 12ba514761
commit 6a3f0975dc

View file

@ -290,9 +290,8 @@ func (t *ExecTool) guardCommand(command, cwd string) string {
return "" return ""
} }
// Match absolute paths: Unix (starts with / after space/start/quotes/=/:) or Windows (X:\) // Match absolute paths: Unix (starts with /) or Windows (X:\)
// This regex is careful not to match scoped packages like @mastra/core pathPattern := regexp.MustCompile(`(?:\s|^|["'|&;])(/[^\s\"'|&;:]+)|([A-Za-z]:\\[^\\\"'|&;:]+)`)
pathPattern := regexp.MustCompile(`(?:\s|^|["'|&;=:])(/[^\s\"'|&;:]+)|([A-Za-z]:\\[^\\\"'|&;:]+)`)
matches := pathPattern.FindAllStringSubmatch(cmd, -1) matches := pathPattern.FindAllStringSubmatch(cmd, -1)
for _, match := range matches { for _, match := range matches {