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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user