(input ReadFileInput, execCtx ExecutionContext)
| 49 | } |
| 50 | |
| 51 | func BackfillReadFileInput(input ReadFileInput, execCtx ExecutionContext) ReadFileInput { |
| 52 | path := input.FilePath |
| 53 | if path != "" && !filepath.IsAbs(path) { |
| 54 | cwd := stringFromExecCtx(execCtx, "cwd") |
| 55 | if cwd == "" { |
| 56 | cwd = "." |
| 57 | } |
| 58 | if resolved, err := filepath.Abs(filepath.Join(cwd, path)); err == nil { |
| 59 | path = resolved |
| 60 | } else { |
| 61 | path = filepath.Join(cwd, path) |
| 62 | } |
| 63 | } |
| 64 | return ReadFileInput{FilePath: path, Offset: input.Offset, Limit: input.Limit} |
| 65 | } |
| 66 | |
| 67 | func RenderWriteFileToolUse(input WriteFileInput) string { |
| 68 | name := filepath.Base(input.FilePath) |
no test coverage detected