huskies: merge 824
This commit is contained in:
@@ -58,6 +58,22 @@ pub(crate) async fn tool_remove_worktree(args: &Value, ctx: &AppContext) -> Resu
|
||||
Ok(format!("Worktree for story '{story_id}' removed."))
|
||||
}
|
||||
|
||||
/// MCP tool handler for `cleanup_worktrees` — removes stale worktrees whose stories are done or archived.
|
||||
pub(crate) async fn tool_cleanup_worktrees(
|
||||
args: &Value,
|
||||
ctx: &AppContext,
|
||||
) -> Result<String, String> {
|
||||
let confirm = args
|
||||
.get("confirm")
|
||||
.and_then(|v| v.as_bool())
|
||||
.unwrap_or(false);
|
||||
|
||||
let project_root = ctx.services.agents.get_project_root(&ctx.state)?;
|
||||
let config = crate::config::ProjectConfig::load(&project_root)?;
|
||||
let report = worktree::run_cleanup(&project_root, &config, confirm).await;
|
||||
Ok(worktree::format_report(&report, confirm))
|
||||
}
|
||||
|
||||
pub(crate) fn tool_get_editor_command(args: &Value, ctx: &AppContext) -> Result<String, String> {
|
||||
let worktree_path = args
|
||||
.get("worktree_path")
|
||||
|
||||
Reference in New Issue
Block a user