feat: consolidate file write, move, grep, and delete operations into unified tools and update context compaction heuristics
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user