pub struct GitTool { /* private fields */ }Expand description
Git 工具:执行 Git 操作。
安全限制:
- 仅允许白名单中的命令
- 禁止危险参数(防止命令注入)
- 限制工作目录范围
- 自动检测只读/写入操作
输入格式:
{
"command": "status",
"args": ["--porcelain"]
}支持命令:
- 只读:status, log, diff, show, branch, remote, config, rev-parse
- 写入:add, commit, checkout, stash, reset, revert, merge, rebase, pull, push, fetch, clone, init
Implementations§
Trait Implementations§
Source§impl Tool for GitTool
impl Tool for GitTool
Source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
返回工具描述。
Source§fn categories(&self) -> &'static [ToolCategory]
fn categories(&self) -> &'static [ToolCategory]
返回工具分类。
Source§fn input_schema(&self) -> Value
fn input_schema(&self) -> Value
返回输入参数的 JSON Schema。
Source§fn call<'life0, 'async_trait>(
&'life0 self,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
input: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
执行 Git 命令。
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
获取工具定义 (ToolDefinition) Read more
Auto Trait Implementations§
impl Freeze for GitTool
impl RefUnwindSafe for GitTool
impl Send for GitTool
impl Sync for GitTool
impl Unpin for GitTool
impl UnsafeUnpin for GitTool
impl UnwindSafe for GitTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more