Refactored orchestrator for staged file handling, added structured prompt support, adjusted Feishu file handling

This commit is contained in:
whlaoding
2026-03-08 22:38:29 +08:00
parent e2f806edb3
commit 52b8dbb835
30 changed files with 9325 additions and 34 deletions

View File

@@ -94,6 +94,9 @@ func (t *Tool) Call(ctx context.Context, input string) (string, error) {
if runtime.GOOS == "windows" {
// Windows 下使用 cmd /C 执行,兼容 date、dir 等内建命令。
cmd = exec.CommandContext(runCtx, "cmd", "/C", trimmed)
} else if requiresShellParsing(trimmed) {
// 包含管道、重定向等语法时,必须交给 shell 解释。
cmd = exec.CommandContext(runCtx, "sh", "-c", trimmed)
} else {
cmd = exec.CommandContext(runCtx, base, parts[1:]...)
}
@@ -126,3 +129,7 @@ func normalizeWindowsCommand(command string) string {
return command
}
}
func requiresShellParsing(command string) bool {
return strings.ContainsAny(command, "|&;<>()$`\\\n")
}