Enhance tool documentation and add new features

- Added module-level documentation for memory tools (`remember`, `recall`, `forget`) to clarify their purpose.
- Improved documentation in `recall.rs` and `remember.rs` to describe the functionality and flow of memory entry operations.
- Updated `mod.rs` to include descriptions for the tool trait and execution context.
- Enhanced `plan.rs` with detailed comments on plan-mode signaling tools.
- Documented text search tools in `search.rs` to explain their functionality.
- Improved sequential-thinking tool documentation in `seqthink.rs`.
- Added safety filter documentation in `shell_filter` for credential and git operations.
- Enhanced utility tools documentation, including `cd`, `dir_cache_update`, and `todowrite`.
- Improved rendering documentation in view modules (`chat`, `markdown`, `status`, `workflow`) to clarify rendering flows and purposes.
This commit is contained in:
asepharyana
2026-07-12 11:28:39 +07:00
parent 7158d362fd
commit 2efd40ca88
124 changed files with 2379 additions and 19 deletions
+13
View File
@@ -1,9 +1,12 @@
//! Generic tool for running arbitrary git subcommands.
use std::process::Command;
use serde_json::{json, Value};
use anyhow::{Result, anyhow};
use super::Tool;
use super::ToolCtx;
/// Tool that runs `git <operation> [args...]` and returns combined stdout/stderr.
pub struct GitOperator;
impl Tool for GitOperator {
@@ -33,6 +36,16 @@ impl Tool for GitOperator {
})
}
/// Run `git <operation> [args...]` and return its combined output.
///
/// Flow: extract `operation` + `args` → spawn `git <operation> <args>` → trim and
/// join stdout/stderr.
///
/// Why: no allowlist here — the model may run any git subcommand; destructive
/// operations are blocked upstream by `shell_filter::git`, not by this tool.
///
/// Return: trimmed combined output on success; error including exit code and
/// stderr on failure.
fn run(&self, _ctx: &ToolCtx, args: &Value) -> Result<String> {
let operation = args.get("operation")
.and_then(|v| v.as_str())