chore: cleanup tools to stop using rootFolder and remove unused imports

This commit is contained in:
Ralph Khreish
2025-05-02 21:50:35 +02:00
parent 8f8a3dc45d
commit 9f86306766
16 changed files with 14 additions and 69 deletions

View File

@@ -32,22 +32,11 @@ export function registerNextTaskTool(server) {
try {
log.info(`Finding next task with args: ${JSON.stringify(args)}`);
// Get project root from args or session
const rootFolder =
args.projectRoot || getProjectRootFromSession(session, log);
// Ensure project root was determined
if (!rootFolder) {
return createErrorResponse(
'Could not determine project root. Please provide it explicitly or ensure your session contains valid root information.'
);
}
// Resolve the path to tasks.json
// Use args.projectRoot directly (guaranteed by withNormalizedProjectRoot)
let tasksJsonPath;
try {
tasksJsonPath = findTasksJsonPath(
{ projectRoot: rootFolder, file: args.file },
{ projectRoot: args.projectRoot, file: args.file },
log
);
} catch (error) {
@@ -59,9 +48,7 @@ export function registerNextTaskTool(server) {
const result = await nextTaskDirect(
{
// Pass the explicitly resolved path
tasksJsonPath: tasksJsonPath
// No other args specific to this tool
},
log
);