Changesets · Branches · Tags · Compare
| Changeset | e035bf028461845b5ea015f497a99b65781c77b03c2325f34aedc65d1f64fdd0 |
|---|---|
| Author | Nate <sestinj@gmail.com> · 2025-09-06 20:17 -07:00 |
| Committer | Nate <sestinj@gmail.com> · 2025-09-06 20:17 -07:00 |
| Parents | f679de86c340 |
1 file changed
modified extensions/cli/src/tools/readFile.ts +6 −2
| @@ -20,13 +20,17 @@ | ||
| 20 | 20 | readonly: true, |
| 21 | 21 | isBuiltIn: true, |
| 22 | 22 | preprocess: async (args) => { |
| 23 | - throwIfFileIsSecurityConcern(args.filepath); | |
| 23 | + let { filepath } = args; | |
| 24 | + if (filepath.startsWith("./")) { | |
| 25 | + filepath = filepath.slice(2); | |
| 26 | + } | |
| 27 | + throwIfFileIsSecurityConcern(filepath); | |
| 24 | 28 | return { |
| 25 | 29 | args, |
| 26 | 30 | preview: [ |
| 27 | 31 | { |
| 28 | 32 | type: "text", |
| 29 | - content: `Will read ${formatToolArgument(args.filepath)}`, | |
| 33 | + content: `Will read ${formatToolArgument(filepath)}`, | |
| 30 | 34 | }, |
| 31 | 35 | ], |
| 32 | 36 | }; |