Skip to main content

make_edit

Function make_edit 

Source
pub fn make_edit(options: MakeEditOptions) -> FunctionTool
Expand description

Creates a sandbox-routed edit tool: replaces the one occurrence of old_str with new_str, inserted literally.

The call fails when path is not absolute or has a .. segment, when old_str is empty, and when it appears in the file zero times or more than once.

use strands::vended_tools::edit::{DEFAULT_EDIT_DESCRIPTION, MakeEditOptions, make_edit};

let tool = make_edit(MakeEditOptions::default());
assert_eq!(strands::Tool::description(&tool), DEFAULT_EDIT_DESCRIPTION);