Changesets · Branches · Tags · Compare
| Changeset | 7a512fed920fb670c82e9782b2cdff71b6b489101ecea48ce56b92bd1c9e8017 |
|---|---|
| Author | Dallin Romney <dallinromney@gmail.com> · 2025-09-08 16:27 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-09-08 16:27 -07:00 |
| Parents | d1aa4d889681, e035bf028461 |
1 file changed
modified extensions/cli/src/tools/readFile.ts +6 −2
| @@ -25,13 +25,17 @@ | ||
| 25 | 25 | readonly: true, |
| 26 | 26 | isBuiltIn: true, |
| 27 | 27 | preprocess: async (args) => { |
| 28 | - throwIfFileIsSecurityConcern(args.filepath); | |
| 28 | + let { filepath } = args; | |
| 29 | + if (filepath.startsWith("./")) { | |
| 30 | + filepath = filepath.slice(2); | |
| 31 | + } | |
| 32 | + throwIfFileIsSecurityConcern(filepath); | |
| 29 | 33 | return { |
| 30 | 34 | args, |
| 31 | 35 | preview: [ |
| 32 | 36 | { |
| 33 | 37 | type: "text", |
| 34 | - content: `Will read ${formatToolArgument(args.filepath)}`, | |
| 38 | + content: `Will read ${formatToolArgument(filepath)}`, | |
| 35 | 39 | }, |
| 36 | 40 | ], |
| 37 | 41 | }; |