(input any, toolUseData *uctypes.UIMessageDataToolUse)
| 245 | } |
| 246 | |
| 247 | func verifyEditTextFileInput(input any, toolUseData *uctypes.UIMessageDataToolUse) error { |
| 248 | params, err := parseEditTextFileInput(input) |
| 249 | if err != nil { |
| 250 | return err |
| 251 | } |
| 252 | |
| 253 | expandedPath, err := wavebase.ExpandHomeDir(params.Filename) |
| 254 | if err != nil { |
| 255 | return fmt.Errorf("failed to expand path: %w", err) |
| 256 | } |
| 257 | |
| 258 | if !filepath.IsAbs(expandedPath) { |
| 259 | return fmt.Errorf("path must be absolute, got relative path: %s", params.Filename) |
| 260 | } |
| 261 | |
| 262 | _, err = validateTextFile(expandedPath, "edit", true) |
| 263 | if err != nil { |
| 264 | return err |
| 265 | } |
| 266 | |
| 267 | toolUseData.InputFileName = params.Filename |
| 268 | return nil |
| 269 | } |
| 270 | |
| 271 | // EditTextFileDryRun applies edits to a file and returns the original and modified content |
| 272 | // without writing to disk. Takes the same input format as editTextFileCallback. |
nothing calls this directly
no test coverage detected