feat: update tool logs to be more coherent
This commit is contained in:
@@ -27,7 +27,7 @@ internal static class FileTools
|
||||
[Description("Last line to return (inclusive). Use 0 for EOF. Defaults to 0.")] int endLine = 0)
|
||||
{
|
||||
path = ResolvePath(path);
|
||||
Log($"Reading file: {path} {startLine}:{endLine}L");
|
||||
Log($" ● read_file: {path} {startLine}:{endLine}L");
|
||||
|
||||
if (!File.Exists(path))
|
||||
return $"ERROR: File not found: {path}";
|
||||
@@ -62,7 +62,7 @@ internal static class FileTools
|
||||
[Description("Path to the directory.")] string path = ".")
|
||||
{
|
||||
path = ResolvePath(path);
|
||||
Log($"Listing directory: {path}");
|
||||
Log($" ● list_dir: {path}");
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
return $"ERROR: Directory not found: {path}";
|
||||
@@ -95,7 +95,7 @@ internal static class FileTools
|
||||
[Description("Glob pattern (supports * and **).")] string pattern)
|
||||
{
|
||||
path = ResolvePath(path);
|
||||
Log($"Finding files: {pattern} in {path}");
|
||||
Log($" ● find_files: {pattern} in {path}");
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
return $"ERROR: Directory not found: {path}";
|
||||
@@ -139,7 +139,7 @@ internal static class FileTools
|
||||
|
||||
if (mode == "file")
|
||||
{
|
||||
Log($"Searching file: {path}");
|
||||
Log($" ● grep_file: {path}");
|
||||
|
||||
if (!File.Exists(path))
|
||||
if (Directory.Exists(path))
|
||||
@@ -186,7 +186,7 @@ internal static class FileTools
|
||||
}
|
||||
else if (mode == "recursive")
|
||||
{
|
||||
Log($"Recursive grep: {pattern} in {path}" + (filePattern != null ? $" (files: {filePattern})" : ""));
|
||||
Log($" ● grep_recursive: {pattern} in {path}" + (filePattern != null ? $" (files: {filePattern})" : ""));
|
||||
|
||||
if (!Directory.Exists(path))
|
||||
if (File.Exists(path))
|
||||
@@ -297,7 +297,7 @@ internal static class FileTools
|
||||
[Description("Path to the file.")] string path)
|
||||
{
|
||||
path = ResolvePath(path);
|
||||
Log($"Getting file info: {path}");
|
||||
Log($" ● get_file_info: {path}");
|
||||
|
||||
if (!File.Exists(path))
|
||||
return $"ERROR: File not found: {path}";
|
||||
|
||||
Reference in New Issue
Block a user