From c3dba47bcda10bbcd72010c177afa8fd301e87e1 Mon Sep 17 00:00:00 2001 From: "A.J. Shulman" Date: Wed, 21 May 2025 13:11:52 -0400 Subject: feat: add codebase exploration tools for agent assistance Add three new agent tools to improve navigation and understanding of the codebase: FileContentTool: retrieves complete content of specified files (max 3) FileNamesTool: lists all available files in the codebase CodebaseSummarySearchTool: performs semantic search across file summaries --- src/server/ApiManagers/AssistantManager.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/server/ApiManagers/AssistantManager.ts') diff --git a/src/server/ApiManagers/AssistantManager.ts b/src/server/ApiManagers/AssistantManager.ts index 9d0427b52..c7c347c71 100644 --- a/src/server/ApiManagers/AssistantManager.ts +++ b/src/server/ApiManagers/AssistantManager.ts @@ -118,6 +118,19 @@ export default class AssistantManager extends ApiManager { }, }); + // Register an endpoint to retrieve file names from the file_summaries.json file + register({ + method: Method.GET, + subscription: '/getFileNames', + secureHandler: async ({ res }) => { + const filePath = path.join(filesDirectory, Directory.vectorstore, 'file_summaries.json'); + const data = fs.readFileSync(filePath, 'utf8'); + console.log(Object.keys(JSON.parse(data))); + + res.send(Object.keys(JSON.parse(data))); + }, + }); + // Register an endpoint to retrieve file content from the content json file register({ method: Method.POST, -- cgit v1.2.3-70-g09d2