fix(tasks): Enable removing multiple tasks/subtasks via comma-separated IDs

- Refactors the core `removeTask` function (`task-manager/remove-task.js`) to accept and iterate over comma-separated task/subtask IDs.

- Updates dependency cleanup and file regeneration logic to run once after processing all specified IDs.

- Adjusts the `remove-task` CLI command (`commands.js`) description and confirmation prompt to handle multiple IDs correctly.

- Fixes a bug in the CLI confirmation prompt where task/subtask titles were not being displayed correctly.

- Updates the `remove_task` MCP tool description to reflect the new multi-ID capability.

This addresses the previously known issue where only the first ID in a comma-separated list was processed.

Closes #140
This commit is contained in:
Eyal Toledano
2025-04-28 00:41:32 -04:00
parent 66ac9ab9f6
commit 5aea93d4c0
7 changed files with 327 additions and 194 deletions

View File

@@ -23,7 +23,9 @@ export function registerRemoveTaskTool(server) {
parameters: z.object({
id: z
.string()
.describe("ID of the task or subtask to remove (e.g., '5' or '5.2')"),
.describe(
"ID of the task or subtask to remove (e.g., '5' or '5.2'). Can be comma-separated to update multiple tasks/subtasks at once."
),
file: z.string().optional().describe('Absolute path to the tasks file'),
projectRoot: z
.string()