support for reading ./ paths (again?...)
This commit is contained in:
parent
1218c14f89
commit
fa779a7f04
1 changed files with 6 additions and 2 deletions
|
|
@ -20,13 +20,17 @@ export const readFileTool: Tool = {
|
|||
readonly: true,
|
||||
isBuiltIn: true,
|
||||
preprocess: async (args) => {
|
||||
throwIfFileIsSecurityConcern(args.filepath);
|
||||
let { filepath } = args;
|
||||
if (filepath.startsWith("./")) {
|
||||
filepath = filepath.slice(2);
|
||||
}
|
||||
throwIfFileIsSecurityConcern(filepath);
|
||||
return {
|
||||
args,
|
||||
preview: [
|
||||
{
|
||||
type: "text",
|
||||
content: `Will read ${formatToolArgument(args.filepath)}`,
|
||||
content: `Will read ${formatToolArgument(filepath)}`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue