1
0

feat: consolidate file write, move, grep, and delete operations into unified tools and update context compaction heuristics

This commit is contained in:
2026-03-06 01:14:56 +01:00
parent 7a6e9785d6
commit 003345edc0
6 changed files with 230 additions and 261 deletions

View File

@@ -39,27 +39,6 @@ internal static class DirTools
}
}
[Description("Delete a directory and all its contents permanently.")]
public static string DeleteDir(
[Description("Path to the directory to delete.")] string path,
[Description("If true, delete recursively. Defaults to true.")] bool recursive = true)
{
path = ResolvePath(path);
Log($"Deleting directory: {path}");
if (!Directory.Exists(path))
return $"ERROR: Directory not found: {path}";
try
{
Directory.Delete(path, recursive);
return $"OK: Directory deleted: '{path}'";
}
catch (Exception ex)
{
return $"ERROR deleting directory '{path}': {ex.Message}";
}
}
[Description("Create a new directory. Creates parent directories if they don't exist. Returns OK on success, or an error message if the directory already exists or creation fails.")]
public static string CreateDir(
[Description("Path to the directory to create.")] string path)