MCPcopy
hub / github.com/continuedev/continue / viewSubdirectoryImpl

Function viewSubdirectoryImpl

core/tools/implementations/viewSubdirectory.ts:8–42  ·  view source on GitHub ↗
(args: any, extras)

Source from the content-addressed store, hash-verified

6import { getStringArg } from "../parseArgs";
7
8export const viewSubdirectoryImpl: ToolImpl = async (args: any, extras) => {
9 const directory_path = getStringArg(args, "directory_path");
10
11 const resolvedPath = await resolveInputPath(extras.ide, directory_path);
12
13 if (!resolvedPath) {
14 throw new ContinueError(
15 ContinueErrorReason.DirectoryNotFound,
16 `Directory path "${directory_path}" does not exist or is not accessible.`,
17 );
18 }
19
20 // Check if the resolved path actually exists
21 const exists = await extras.ide.fileExists(resolvedPath.uri);
22 if (!exists) {
23 throw new ContinueError(
24 ContinueErrorReason.DirectoryNotFound,
25 `Directory path "${directory_path}" does not exist or is not accessible.`,
26 );
27 }
28
29 const repoMap = await generateRepoMap(extras.llm, extras.ide, {
30 dirUris: [resolvedPath.uri],
31 outputRelativeUriPaths: true,
32 includeSignatures: false,
33 });
34
35 return [
36 {
37 name: "Repo map",
38 description: `Map of ${resolvedPath.displayPath}`,
39 content: repoMap,
40 },
41 ];
42};

Callers 2

callBuiltInToolFunction · 0.90

Calls 4

getStringArgFunction · 0.90
resolveInputPathFunction · 0.90
generateRepoMapFunction · 0.85
fileExistsMethod · 0.65

Tested by

no test coverage detected