(args: Record<string, unknown>, context: ToolContext)
| 122 | } |
| 123 | |
| 124 | export async function fileEdit(args: Record<string, unknown>, context: ToolContext): Promise<ToolResult> { |
| 125 | const edit: EditSpec = { |
| 126 | file_path: String(args.file_path ?? ""), |
| 127 | old_string: String(args.old_string ?? ""), |
| 128 | new_string: String(args.new_string ?? ""), |
| 129 | replace_all: parseReplaceAll(args.replace_all), |
| 130 | } |
| 131 | const [result] = editOneFile(context.cwd, [edit]) |
| 132 | return { text: result, isError: result.startsWith("FAILED") } |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Compute the diff a file-modifying tool call would produce, without writing |
nothing calls this directly
no test coverage detected