1
0

feat: introduce slash commands, token tracking, context compaction, grep_recursive tool, and update README with new features and project structure.

This commit is contained in:
2026-03-04 08:24:14 +01:00
parent 3ceb0e4884
commit 218c9cebb6
2 changed files with 45 additions and 10 deletions

View File

@@ -10,7 +10,7 @@ namespace AnchorCli.Tools;
/// On success, returns "OK fp:{fingerprint}" so the model can verify the mutation.
/// On failure, returns a descriptive ERROR string — no exceptions reach the LLM.
/// </summary>
internal static class EditTools
internal static partial class EditTools
{
public static Action<string> Log { get; set; } = Console.WriteLine;
@@ -19,7 +19,7 @@ internal static class EditTools
/// Format: "lineNumber:hexHash|" e.g. "5:a3|"
/// </summary>
private static readonly Regex HashlinePrefix =
new(@"^\d+:[0-9a-fA-F]{2}\|", RegexOptions.Compiled);
MyRegex();
/// <summary>
/// Strips accidental hashline prefixes from lines the LLM sends as new content.
@@ -328,4 +328,7 @@ internal static class EditTools
return $"ERROR appending to '{path}': {ex.Message}";
}
}
[GeneratedRegex(@"^\d+:[0-9a-fA-F]{2}\|", RegexOptions.Compiled)]
private static partial Regex MyRegex();
}