(input any, execCtx ExecutionContext)
| 11 | } |
| 12 | |
| 13 | func (t *EditFileTool) BackfillObservableInput(input any, execCtx ExecutionContext) any { |
| 14 | in := deref[EditFileInput](input) |
| 15 | path := in.FilePath |
| 16 | if path != "" && !filepath.IsAbs(path) { |
| 17 | cwd := stringFromExecCtx(execCtx, "cwd") |
| 18 | if cwd == "" { |
| 19 | cwd = "." |
| 20 | } |
| 21 | if resolved, err := filepath.Abs(filepath.Join(cwd, path)); err == nil { |
| 22 | path = resolved |
| 23 | } else { |
| 24 | path = filepath.Join(cwd, path) |
| 25 | } |
| 26 | } |
| 27 | return EditFileInput{ |
| 28 | FilePath: path, |
| 29 | OldString: in.OldString, |
| 30 | NewString: in.NewString, |
| 31 | ReplaceAll: in.ReplaceAll, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func (t *BashTool) BackfillObservableInput(input any, _ ExecutionContext) any { |
| 36 | return BackfillBashInput(deref[BashInput](input)) |
nothing calls this directly
no test coverage detected