fix viewSubdirectory tool
This commit is contained in:
parent
99de578e64
commit
011534feed
1 changed files with 11 additions and 1 deletions
|
|
@ -1,11 +1,21 @@
|
|||
import generateRepoMap from "../../util/generateRepoMap";
|
||||
import { resolveRelativePathInWorkspace } from "../../util/ideUtils";
|
||||
|
||||
import { ToolImpl } from ".";
|
||||
|
||||
export const viewSubdirectoryImpl: ToolImpl = async (args: any, extras) => {
|
||||
const { directory_path } = args;
|
||||
const absolutePath = await resolveRelativePathInWorkspace(
|
||||
directory_path,
|
||||
extras.ide,
|
||||
);
|
||||
|
||||
if (!absolutePath) {
|
||||
throw new Error(`Directory path "${directory_path}" does not exist.`);
|
||||
}
|
||||
|
||||
const repoMap = await generateRepoMap(extras.llm, extras.ide, {
|
||||
dirs: [directory_path],
|
||||
dirs: [absolutePath],
|
||||
});
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue