M1: edit tool with opencode's replacer chain, ported verbatim
Ports opencode's multi-strategy string-replacer chain (and its test table) into harness-tools::edit, giving the edit tool the same fuzzy-match fallback behavior opencode relies on.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
mod bash;
|
||||
mod edit;
|
||||
mod glob;
|
||||
mod grep;
|
||||
mod paths;
|
||||
@@ -6,6 +7,7 @@ mod read;
|
||||
mod write;
|
||||
|
||||
pub use bash::BashTool;
|
||||
pub use edit::EditTool;
|
||||
pub use glob::GlobTool;
|
||||
pub use grep::GrepTool;
|
||||
pub use read::ReadTool;
|
||||
@@ -15,10 +17,11 @@ use std::sync::Arc;
|
||||
|
||||
use harness_core::tool::ToolRegistry;
|
||||
|
||||
/// Registers the M1 built-ins (`edit` is added separately once its replacer chain lands).
|
||||
/// Registers all M1 built-ins: read, write, edit, bash, glob, grep.
|
||||
pub fn register_builtins(registry: &mut ToolRegistry) {
|
||||
registry.register(Arc::new(ReadTool));
|
||||
registry.register(Arc::new(WriteTool));
|
||||
registry.register(Arc::new(EditTool::new()));
|
||||
registry.register(Arc::new(BashTool));
|
||||
registry.register(Arc::new(GlobTool));
|
||||
registry.register(Arc::new(GrepTool));
|
||||
|
||||
Reference in New Issue
Block a user