@@ -12,6 +12,8 @@ import (
1212 "paperdebugger/internal/libs/logger"
1313 "paperdebugger/internal/services"
1414 "paperdebugger/internal/services/toolkit/registry"
15+ filetools "paperdebugger/internal/services/toolkit/tools/files"
16+ latextools "paperdebugger/internal/services/toolkit/tools/latex"
1517 "paperdebugger/internal/services/toolkit/tools/xtramcp"
1618 chatv2 "paperdebugger/pkg/gen/api/chat/v2"
1719 "strings"
@@ -109,40 +111,26 @@ func initializeToolkitV2(
109111) * registry.ToolRegistryV2 {
110112 toolRegistry := registry .NewToolRegistryV2 ()
111113
112- // Register static file tools (create/delete don't need ProjectService - they're placeholder only)
113- // toolRegistry.Register("create_file", filetools.CreateFileToolDescriptionV2, filetools.CreateFileTool)
114- // toolRegistry.Register("delete_file", filetools.DeleteFileToolDescriptionV2, filetools.DeleteFileTool)
115- // toolRegistry.Register("create_folder", filetools.CreateFolderToolDescriptionV2, filetools.CreateFolderTool)
116- // toolRegistry.Register("delete_folder", filetools.DeleteFolderToolDescriptionV2, filetools.DeleteFolderTool)
117-
118- // Register file tools with ProjectService injection
119- // readFileTool := filetools.NewReadFileTool(projectService)
120- // toolRegistry.Register("read_file", filetools.ReadFileToolDescriptionV2, readFileTool.Call)
121-
122- // listFolderTool := filetools.NewListFolderTool(projectService)
123- // toolRegistry.Register("list_folder", filetools.ListFolderToolDescriptionV2, listFolderTool.Call)
124-
125- // searchStringTool := filetools.NewSearchStringTool(projectService)
126- // toolRegistry.Register("search_string", filetools.SearchStringToolDescriptionV2, searchStringTool.Call)
127-
128- // searchFileTool := filetools.NewSearchFileTool(projectService)
129- // toolRegistry.Register("search_file", filetools.SearchFileToolDescriptionV2, searchFileTool.Call)
130-
131- logger .Info ("[AI Client V2] Registered static file tools" , "count" , 0 )
132-
133- // Register LaTeX tools with ProjectService injection
134- // documentStructureTool := latextools.NewDocumentStructureTool(projectService)
135- // toolRegistry.Register("get_document_structure", latextools.GetDocumentStructureToolDescriptionV2, documentStructureTool.Call)
136-
137- // toolRegistry.Register("locate_section", latextools.LocateSectionToolDescriptionV2, latextools.LocateSectionTool)
138-
139- // readSectionSourceTool := latextools.NewReadSectionSourceTool(projectService)
140- // toolRegistry.Register("read_section_source", latextools.ReadSectionSourceToolDescriptionV2, readSectionSourceTool.Call)
141-
142- // readSourceLineRangeTool := latextools.NewReadSourceLineRangeTool(projectService)
143- // toolRegistry.Register("read_source_line_range", latextools.ReadSourceLineRangeToolDescriptionV2, readSourceLineRangeTool.Call)
144-
145- logger .Info ("[AI Client V2] Registered static LaTeX tools" , "count" , 0 )
114+ readFileTool := filetools .NewReadFileTool (projectService )
115+ listFolderTool := filetools .NewListFolderTool (projectService )
116+ searchStringTool := filetools .NewSearchStringTool (projectService )
117+ searchFileTool := filetools .NewSearchFileTool (projectService )
118+ documentStructureTool := latextools .NewDocumentStructureTool (projectService )
119+ readSectionSourceTool := latextools .NewReadSectionSourceTool (projectService )
120+ readSourceLineRangeTool := latextools .NewReadSourceLineRangeTool (projectService )
121+
122+ toolRegistry .Register ("create_file" , filetools .CreateFileToolDescriptionV2 , filetools .CreateFileTool )
123+ toolRegistry .Register ("delete_file" , filetools .DeleteFileToolDescriptionV2 , filetools .DeleteFileTool )
124+ toolRegistry .Register ("create_folder" , filetools .CreateFolderToolDescriptionV2 , filetools .CreateFolderTool )
125+ toolRegistry .Register ("delete_folder" , filetools .DeleteFolderToolDescriptionV2 , filetools .DeleteFolderTool )
126+ toolRegistry .Register ("read_file" , filetools .ReadFileToolDescriptionV2 , readFileTool .Call )
127+ toolRegistry .Register ("list_folder" , filetools .ListFolderToolDescriptionV2 , listFolderTool .Call )
128+ toolRegistry .Register ("search_string" , filetools .SearchStringToolDescriptionV2 , searchStringTool .Call )
129+ toolRegistry .Register ("search_file" , filetools .SearchFileToolDescriptionV2 , searchFileTool .Call )
130+ toolRegistry .Register ("get_document_structure" , latextools .GetDocumentStructureToolDescriptionV2 , documentStructureTool .Call )
131+ toolRegistry .Register ("locate_section" , latextools .LocateSectionToolDescriptionV2 , latextools .LocateSectionTool )
132+ toolRegistry .Register ("read_section_source" , latextools .ReadSectionSourceToolDescriptionV2 , readSectionSourceTool .Call )
133+ toolRegistry .Register ("read_source_line_range" , latextools .ReadSourceLineRangeToolDescriptionV2 , readSourceLineRangeTool .Call )
146134
147135 // Load tools dynamically from backend
148136 xtraMCPLoader := xtramcp .NewXtraMCPLoaderV2 (db , projectService , cfg .XtraMCPURI )
0 commit comments