feat(tools): enhance ExecTool with enable flag and custom deny_patterns

- Add `enable` flag to `ExecToolConfig` to conditionally register the tool.
- Add `deny_patterns` to allow users to override the default command blacklist.
- Remove `allow_patterns` (whitelist) to maintain tool flexibility.
- Fix initialization logic to properly handle empty list (`[]`), allowing users to completely clear the default blacklist.
This commit is contained in:
angleyanalbedo
2026-03-10 15:10:09 +08:00
parent a1b5f21b8b
commit 746d7f5415
2 changed files with 10 additions and 7 deletions

View File

@@ -305,9 +305,10 @@ class WebToolsConfig(Base):
class ExecToolConfig(Base):
"""Shell exec tool configuration."""
enable: bool = True
timeout: int = 60
path_append: str = ""
deny_patterns: list[str] | None = None
class MCPServerConfig(Base):
"""MCP server connection configuration (stdio or HTTP)."""