summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2025-11-27 12:39:41 +0300
committerGrail Finder <wohilas@gmail.com>2025-11-27 12:39:41 +0300
commit7bca1e3f2883f8f9da8c8bd93c95d1dbfbf4b26b (patch)
tree4397dbe621626237680637ec528fb324d5ccf999
parentc4013d815bdbe1e4b97783c28fa898476d09e591 (diff)
Enha: remove non POSIX command 'realpath'
-rw-r--r--tools.go45
1 files changed, 22 insertions, 23 deletions
diff --git a/tools.go b/tools.go
index fd422f5..eb9713e 100644
--- a/tools.go
+++ b/tools.go
@@ -500,27 +500,26 @@ func executeCommand(args map[string]string) []byte {
func isCommandAllowed(command string) bool {
allowedCommands := map[string]bool{
- "grep": true,
- "sed": true,
- "awk": true,
- "find": true,
- "cat": true,
- "head": true,
- "tail": true,
- "sort": true,
- "uniq": true,
- "wc": true,
- "ls": true,
- "echo": true,
- "cut": true,
- "tr": true,
- "cp": true,
- "mv": true,
- "rm": true,
- "mkdir": true,
- "rmdir": true,
- "pwd": true,
- "realpath": true,
+ "grep": true,
+ "sed": true,
+ "awk": true,
+ "find": true,
+ "cat": true,
+ "head": true,
+ "tail": true,
+ "sort": true,
+ "uniq": true,
+ "wc": true,
+ "ls": true,
+ "echo": true,
+ "cut": true,
+ "tr": true,
+ "cp": true,
+ "mv": true,
+ "rm": true,
+ "mkdir": true,
+ "rmdir": true,
+ "pwd": true,
}
return allowedCommands[command]
}
@@ -778,14 +777,14 @@ var baseTools = []models.Tool{
Type: "function",
Function: models.ToolFunc{
Name: "execute_command",
- Description: "Execute a shell command safely. Use when you need to run system commands like grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd realpath",
+ Description: "Execute a shell command safely. Use when you need to run system commands like grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd",
Parameters: models.ToolFuncParams{
Type: "object",
Required: []string{"command"},
Properties: map[string]models.ToolArgProps{
"command": models.ToolArgProps{
Type: "string",
- Description: "command to execute (only commands from whitelist are allowed: grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd realpath",
+ Description: "command to execute (only commands from whitelist are allowed: grep sed awk find cat head tail sort uniq wc ls echo cut tr cp mv rm mkdir rmdir pwd",
},
"args": models.ToolArgProps{
Type: "string",